Skip to main content

build_tool_args

Function build_tool_args 

Source
pub fn build_tool_args(
    args: &[Arg],
    ctx: &ExecContext,
    schema: Option<&ToolSchema>,
) -> ToolArgs
Expand description

Build ToolArgs from AST Args, evaluating expressions.

If a schema is provided, uses it to determine argument types:

  • For --flag where schema says type is non-bool: consume next positional as value
  • For --flag where schema says type is bool (or unknown): treat as boolean flag

This enables natural shell syntax like mcp_tool --query "test" --limit 10.