Interface ForgeToolInput

Input arguments accepted by the forge_tool meta-tool.

Mirrors ForgeToolRequest but typed as a Record<string, any> to satisfy the ITool generic constraint while retaining semantic clarity.

interface ForgeToolInput {
    name: string;
    description: string;
    inputSchema: JSONSchemaObject;
    outputSchema?: JSONSchemaObject;
    implementation: {
        mode: "compose";
        steps: {
            name: string;
            tool: string;
            inputMapping: Record<string, unknown>;
        }[];
    } | {
        mode: "sandbox";
        code: string;
        allowlist: string[];
    };
    testCases: {
        input: Record<string, unknown>;
        expectedOutput?: unknown;
    }[];
}

Hierarchy

  • Record<string, any>
    • ForgeToolInput

Properties

name: string

Machine-readable name for the new tool.

description: string

Natural language description of the tool's purpose.

inputSchema: JSONSchemaObject

JSON Schema for the tool's input arguments.

outputSchema?: JSONSchemaObject

JSON Schema for the tool's expected output (optional).

implementation: {
    mode: "compose";
    steps: {
        name: string;
        tool: string;
        inputMapping: Record<string, unknown>;
    }[];
} | {
    mode: "sandbox";
    code: string;
    allowlist: string[];
}

Implementation specification — either compose (chain existing tools) or sandbox (arbitrary code). Discriminated on the mode field.

Type declaration

  • mode: "compose"
  • steps: {
        name: string;
        tool: string;
        inputMapping: Record<string, unknown>;
    }[]

Type declaration

  • mode: "sandbox"
  • code: string
  • allowlist: string[]
testCases: {
    input: Record<string, unknown>;
    expectedOutput?: unknown;
}[]

One or more test cases for the judge to evaluate. Each has an input object and optional expectedOutput.

Type declaration

  • input: Record<string, unknown>
  • Optional expectedOutput?: unknown