class

Smith::Tools::McpTool

Inherits Smith::Tools::MutatingTool < Smith::Tools::Tool < Reference < Object

One tool exported by an MCP server, wearing smith's Tool interface.

Marked mutating without exception. A server can do anything — write files, call an API, spend money — and smith cannot tell which from a name and a schema. Optimism here would be a security decision made by guessing; narrowing it down is what permission rules such as allow = ["mcp__filesystem__read_*"] are for.

Constants

MAX_OUTPUT_BYTES = Bash::MAX_OUTPUT_BYTES

The same ceiling bash uses. A server that returns a database dump would otherwise blow the context window in a single call.

Constructors

new(name : String, handle : Smith::MCP::ServerHandle, definition : Smith::MCP::ToolDefinition, max_output_bytes : Int32 = MAX_OUTPUT_BYTES)
Source

Class methods

register_all(registry : Registry, manager : Smith::MCP::Manager, max_output_bytes : Int32 = MAX_OUTPUT_BYTES) : Int32

Registers every tool of every running server, and arranges for them to be withdrawn again if a server is given up on.

Lives here rather than in MCP::Manager so the protocol side stays free of any dependency on the tool layer.

Source

Instance methods

description
Source
name
Source
parameters
Source
run(args : JSON::Any) : String
Source