Sign in

    colmugx/mcp/protocol/tool does not have a README file

    Tool

    pub(open) trait Tool {
    fn name(Self) -> String
    fn description(Self) -> String
    fn params(Self) -> Array[ParamDef]
    async fn execute(Self,
    RequestContext
    , Json) -> ToolCallOutcome
    }

    Core Tool trait following MCP protocol

    ParamDef

    pub(all) struct ParamDef {
    name : String
    description : String
    type_ : String
    required : Bool
    } derive(Eq,
    Debug
    )

    Parameter definition for tool schema

    ParamDef::equal

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

    ParamDef::not_equal

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

    ParamDef::to_repr

    ToolCallOutcome

    pub(all) enum ToolCallOutcome {
    Complete(
    ToolResult
    )
    InputRequired(input_requests~ : Map[String,
    InputRequestEntry
    ], state~ : Json)
    } derive(Eq,
    Debug
    )

    Outcome of a tool execution. Per the 2026-07-28 MRTR pattern, a tool may either complete normally (Complete) or request additional client input (InputRequired). On retry, the client resubmits with inputResponses and the echoed requestState; the tool receives responses and restored state through RequestContext, without modifying its business arguments.

    ToolCallOutcome::equal

    ToolCallOutcome::not_equal

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

    get_number

    fn get_number(json : Json, key : String) -> Result[Double,
    ToolResult
    ]

    Extract number from JSON, returning error ToolResult on failure

    get_optional_number

    fn get_optional_number(json : Json, key : String) -> Result[Double?,
    ToolResult
    ]

    Extract optional number from JSON

    get_optional_string

    fn get_optional_string(json : Json, key : String) -> Result[String?,
    ToolResult
    ]

    Extract optional string from JSON

    get_string

    fn get_string(json : Json, key : String) -> Result[String,
    ToolResult
    ]

    Extract string from JSON, returning error ToolResult on failure

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io