Polyman Documentation - v3.1.0
    Preparing search index...

    Interface Tool<A>

    A tool the model can call.

    interface Tool<A = unknown> {
        name: string;
        description: string;
        parameters: Record<string, unknown>;
        risk: Risk;
        needsProblem: boolean;
        timeoutMs?: number;
        describe?(args: A): { title: string; command?: string };
        run(args: A, ctx: ToolContext): Promise<ToolOutput>;
    }

    Type Parameters

    • A = unknown
    Index
    name: string

    Name shown to the model, in snake_case.

    description: string

    When to use it, in plain words.

    parameters: Record<string, unknown>

    JSON Schema of the arguments, an object schema.

    risk: Risk

    What the tool may do.

    needsProblem: boolean

    False only for tools that work before the problem folder exists.

    timeoutMs?: number

    Time limit of one call.

    • Short title and command, for approvals and the UI.

      Parameters

      • args: A

      Returns { title: string; command?: string }