Member Junction
    Preparing search index...

    Interface ChatTool

    A single tool made available to the model for this request.

    Provider-neutral by design: every major vendor declares tool parameters as JSON Schema with per-property description strings, so that is the interchange format here — input_schema (Anthropic), parameters (OpenAI), parameters / parametersJsonSchema (Gemini).

    interface ChatTool {
        description?: string;
        inputSchema: Record<string, unknown>;
        name: string;
    }
    Index

    Properties

    description?: string

    What the tool does and — more importantly for call accuracy — WHEN the model should call it. Prescriptive phrasing ("Call this when…") measurably outperforms a bare description.

    inputSchema: Record<string, unknown>

    JSON Schema for the tool's input. Stick to the cross-provider common subset — type, description, enum, items, properties, required — because Gemini's classic function-declaration schema is an OpenAPI subset that rejects keywords like additionalProperties. Drivers adapt anything beyond that subset.

    name: string

    The tool's name, as the model will call it. Providers constrain this to [a-zA-Z0-9_-], 64 characters or fewer; callers building tools from names that can contain other characters (MJ Action names, say) must sanitize deterministically and keep a reverse map.