moonbitstack/moonmcp/tools does not have a README file

    Tool

    A registered tool.
    impl Component for Tool

    Tool::convert_result

    Convert a raw return value to a ToolResult, honouring the declared output schema.

    Tool::dispatch

    Server entry point for tool execution; subclasses customise dispatch by supplying a different run_fn at construction.

    Tool::get_meta

    fn Tool::get_meta(self : Tool) -> Map[String,
    Json
    ]

    Tool::identifier

    fn Tool::identifier(self : Tool) -> String

    Tool::key

    fn Tool::key(self : Tool) -> String

    Tool::new

    Register a tool. parameters is the JSON schema of its arguments and run_fn executes it.

    Tool::run

    Run the tool with arguments.

    Tool::run_with

    Run the tool with arguments and the request it serves. A tool registered from a function that wants only its arguments ignores the context.

    Tool::to_mcp_tool

    Convert the tool to its wire representation.

    Title precedence: explicit title, then annotation title, then a title derived from the name.

    ToolResult

    The canonical result of running a tool.

    ToolResult::equal

    fn ToolResult::equal(ToolResult, ToolResult) -> Bool

    ToolResult::from_mcp_result

    Wrap a protocol result while preserving its exact wire representation.

    ToolResult::input_required

    Wrap a client-input ask (SEP-2322) as an ordinary tool result.

    ToolResult::is_input_required

    fn ToolResult::is_input_required(self : ToolResult) -> Bool

    Whether this result carries a client-input ask (SEP-2322).

    ToolResult::new

    Create a tool result from explicit parts; content or structured content must be provided.

    ToolResult::not_equal

    fn ToolResult::not_equal(x : ToolResult, y : ToolResult) -> Bool

    ToolResult::to_mcp_result

    Convert to the protocol result, keeping the original wire representation when one was preserved.

    convert_to_content

    Convert a raw result to a sequence of content blocks.

    default_title

    fn default_title(name : String) -> String

    Derive a display title from a tool name.

    The MCP spec says clients should fall back to name for display when title is absent, but some clients instead drop the tool entirely. Always emitting a title avoids depending on that fallback.

    is_valid_tool_name

    fn is_valid_tool_name(name : String) -> Bool

    Whether a tool name is valid per the MCP specification (SEP-986): 1-64 characters of letters, digits, underscores and hyphens.