Public Member Functions | |
| ToolBuilder (ToolDefinition definition) | |
| template<ToolParam P> | |
| ToolBuilder< Params..., P > | Param (P param) && |
| template<class Transform> | |
| auto | With (Transform &&transform) && |
Passes the builder to transform and continues with what it returns, so that a group of parameters shared by several tools can be added in the middle of a chain, as in MakeTool(...).With(ListPaginationParams).Param(...). | |
| ToolBuilder | OutputSchema (std::string schema) && |
| template<class Handler> | |
| Ref< Tool > | Register (Handler handler) && |
| Registers the tool. | |
| template<class Handler> | |
| ToolSpec | Build (Handler handler) && |
| Completes the tool without registering it, such as for an MCP server to create with CreateTool. | |
Friends | |
| template<class... Others> | |
| class | ToolBuilder |
|
inlineexplicit |
|
inline |
|
inline |
Passes the builder to transform and continues with what it returns, so that a group of parameters shared by several tools can be added in the middle of a chain, as in MakeTool(...).With(ListPaginationParams).Param(...).
|
inline |
|
inline |
Registers the tool.
The handler is called as handler(ToolCall&, Params::Value&...) only once every argument has been checked and converted. Missing, invalid and undeclared arguments produce an invalid_params result instead. Returns null when the parameters or the definition are invalid.
|
inline |
Completes the tool without registering it, such as for an MCP server to create with CreateTool.
The handler is called as it is for Register. Throws std::invalid_argument when the parameters are invalid, such as when two share a name or a RelativeTo does not name an earlier integer parameter.
|
friend |