![]() |
tool_error_handler — Maps a failed tool call to the isError text, or nullopt for a protocol error.
// In header: <boost/taar/mcp/endpoint.hpp> typedef std::function< std::optional< std::string >(taar::failure const &)> tool_error_handler;
Invoked as handler(taar::failure const&); the endpoint wraps what the tool threw with boost::taar::failure::from_exception once. A nullopt answer sends a JSON-RPC error built by the JSON-RPC error mapper (see jsonrpc::endpoint::set_error_mapper).