Loading...
Searching...
No Matches
BinaryNinja::MCP::ToolResult Class Reference

Public Member Functions

 ToolResult ()=default
 An empty, successful result.
ToolResult & AddText (std::string text)
ToolResult & AddWarning (std::string code, std::string message)
 An advisory warning about the result, such as analysis that has not finished.
void ApplyTo (BNMcpToolResult *result) const
std::string ToJson () const
 Serialized as an MCP CallToolResult.

Static Public Member Functions

static ToolResult Text (std::string text)
static ToolResult Structured (const rapidjson::Value &content)
 When no text is added, clients that ignore structured content see it serialized as text.
static ToolResult Error (std::string code, std::string message, const rapidjson::Value *details=nullptr)

Constructor & Destructor Documentation

◆ ToolResult()

BinaryNinja::MCP::ToolResult::ToolResult ( )
default

An empty, successful result.

Member Function Documentation

◆ Text()

ToolResult ToolResult::Text ( std::string text)
static

◆ Structured()

ToolResult ToolResult::Structured ( const rapidjson::Value & content)
static

When no text is added, clients that ignore structured content see it serialized as text.

◆ Error()

ToolResult ToolResult::Error ( std::string code,
std::string message,
const rapidjson::Value * details = nullptr )
static

◆ AddText()

ToolResult & ToolResult::AddText ( std::string text)

◆ AddWarning()

ToolResult & ToolResult::AddWarning ( std::string code,
std::string message )

An advisory warning about the result, such as analysis that has not finished.

Clients see it in the structured content's reserved warnings member, and after any text.

◆ ApplyTo()

void ToolResult::ApplyTo ( BNMcpToolResult * result) const

◆ ToJson()

std::string ToolResult::ToJson ( ) const

Serialized as an MCP CallToolResult.