intellibrix v1.0.0
    Preparing search index...

    Type Alias ToolDefinition<In, Out>

    A typed tool a Provider can be offered and the agent loop can execute.

    type ToolDefinition<In = any, Out = any> = {
        description: string;
        execute: (input: In, ctx: ToolContext) => Promise<Out>;
        input: StandardSchemaV1<In>;
        name: string;
        needsApproval?:
            | boolean
            | ((input: In, ctx: ToolContext) => boolean | Promise<boolean>);
        output?: StandardSchemaV1<Out>;
        resultTrust?: Trust;
    }

    Type Parameters

    • In = any
    • Out = any
    Index
    description: string
    execute: (input: In, ctx: ToolContext) => Promise<Out>
    input: StandardSchemaV1<In>

    A Standard Schema (e.g. a Zod 4 schema) describing the tool's input.

    name: string
    needsApproval?:
        | boolean
        | ((input: In, ctx: ToolContext) => boolean | Promise<boolean>)

    Whether this tool requires approval before executing. May be a static boolean or a predicate evaluated per-call (e.g. keying off ctx.trust).

    output?: StandardSchemaV1<Out>

    An optional Standard Schema describing the tool's output.

    resultTrust?: Trust

    Trust level stamped onto this tool's result Parts. Tools returning content fetched from outside the process (MCP, workspace reads, GitHub) should set 'untrusted'.