Skip to main content

tool

Attribute Macro tool 

Source
#[tool]
Expand description

Defines a tool handler.

The function signature should be:

async fn tool_name(ctx: &McpContext, args...) -> Result

§Attributes

  • name - Override the tool name (default: function name)
  • description - Tool description (default: doc comment)