Loading...
Searching...
No Matches
BinaryNinja::MCP::ToolBuilder< Params > Class Template Reference

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

Constructor & Destructor Documentation

◆ ToolBuilder()

template<class... Params>
BinaryNinja::MCP::ToolBuilder< Params >::ToolBuilder ( ToolDefinition definition)
inlineexplicit

Member Function Documentation

◆ Param()

template<class... Params>
template<ToolParam P>
ToolBuilder< Params..., P > BinaryNinja::MCP::ToolBuilder< Params >::Param ( P param) &&
inline

◆ With()

template<class... Params>
template<class Transform>
auto BinaryNinja::MCP::ToolBuilder< Params >::With ( Transform && transform) &&
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(...).

◆ OutputSchema()

template<class... Params>
ToolBuilder BinaryNinja::MCP::ToolBuilder< Params >::OutputSchema ( std::string schema) &&
inline

◆ Register()

template<class... Params>
template<class Handler>
Ref< Tool > BinaryNinja::MCP::ToolBuilder< Params >::Register ( Handler handler) &&
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.

◆ Build()

template<class... Params>
template<class Handler>
ToolSpec BinaryNinja::MCP::ToolBuilder< Params >::Build ( Handler handler) &&
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.

◆ ToolBuilder

template<class... Params>
template<class... Others>
friend class ToolBuilder
friend