Skip to main content

schema_from_clap

Function schema_from_clap 

Source
pub fn schema_from_clap(
    cmd: &Command,
    name: &str,
    description: &str,
    examples: impl IntoIterator<Item = (&'static str, &'static str)>,
) -> ToolSchema
Expand description

Build a ToolSchema for a builtin from its clap Command reflection plus hand-written description and examples.

Bool flags are recognised via ArgAction::SetTrue / ArgAction::SetFalse. Aliases include the short flag (as a single-char string) and all visible long aliases. --json is excluded — it’s the global output flag and handled by the kernel after apply_output_format, not declared as a per-tool param.