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

Parameters that are declared separately but passed to the handler as one value, such as a function named by an address and an architecture. More...

Detailed Description

template<class... Params>
requires (std::derived_from<Params, detail::SingleProperty<Params>> && ...)
class BinaryNinja::MCP::Group< Params >

Parameters that are declared separately but passed to the handler as one value, such as a function named by an address and an architecture.

Call Parse, Lookup or both before passing the group to ToolBuilder::Param.

Public Member Functions

 Group (Params... params)
template<detail::ParseFunction< typename Params::Value... > ParseFn>
GroupParam< ParseFn, detail::KeepParsed, Params... > Parse (ParseFn parse) &&
 Sets the function that combines the arguments into one value.
template<detail::LookupFunction< typename Params::Value... > LookupFn>
auto Lookup (LookupFn lookup) &&
 Sets the function that finds what the arguments refer to.

Constructor & Destructor Documentation

◆ Group()

template<class... Params>
BinaryNinja::MCP::Group< Params >::Group ( Params... params)
inlineexplicit

Member Function Documentation

◆ Parse()

template<class... Params>
template<detail::ParseFunction< typename Params::Value... > ParseFn>
GroupParam< ParseFn, detail::KeepParsed, Params... > BinaryNinja::MCP::Group< Params >::Parse ( ParseFn parse) &&
inline

Sets the function that combines the arguments into one value.

It is called as parse(ToolCall&, Params::Value&...) and returns an ArgumentResult<T>. Its error is reported as invalid_params.

◆ Lookup()

template<class... Params>
template<detail::LookupFunction< typename Params::Value... > LookupFn>
auto BinaryNinja::MCP::Group< Params >::Lookup ( LookupFn lookup) &&
inline

Sets the function that finds what the arguments refer to.

It is called as lookup(ToolCall&, Params::Value&...) and returns a bn::base::expected<T, ToolResult>. Its error becomes the tool's result. It runs only after every argument has been parsed.