Skip to main content

param_headers

Function param_headers 

Source
pub fn param_headers(
    input_schema: &Value,
    arguments: &Value,
) -> Vec<(String, String)>
Expand description

Extract the Mcp-Param-* headers for a tools/call from a tool’s input_schema + the call arguments, so an intermediary can route on a parameter without parsing the body. Walks the schema’s properties chains (the only statically- reachable path); for each property annotated with x-mcp-header, reads the value at that path from arguments (omitting when absent), stringifies the primitive, and value-encodes it. Assumes the schema passed validate_x_mcp_headers (a client rejects tools that don’t).