TomTom Maps for JavaScript
    Preparing search index...

    Type Alias ToolEntry<S>

    A tool definition — the universal format for both built-in and third-party tools. Combines execution (inputSchema + execute) with classifier metadata.

    type ToolEntry<S extends ToolState = ToolState> = {
        classificationPrompt?: string;
        dependsOn?: string[];
        description: string;
        examplePrompts?: string[];
        examples?: string[];
        execute: (input: any, state: S) => Promise<any>;
        inputSchema: z.ZodType;
        outputSchema?: z.ZodType;
        relatedTools?: string[];
        tags?: string[];
    }

    Type Parameters

    • S extends ToolState = ToolState

      The ToolState shape this tool requires. Default: base ToolState.

    Index

    Properties

    classificationPrompt?: string

    Compact one-liner for the intent classifier prompt.

    dependsOn?: string[]

    Tool names that must run before this one.

    description: string

    Description of the tool's purpose.

    examplePrompts?: string[]

    Natural language prompts (e.g. 'Where is the Louvre?').

    examples?: string[]

    Usage examples (e.g. 'geocode("Amsterdam")').

    execute: (input: any, state: S) => Promise<any>

    Function that executes the tool. Receives parsed input and the agent's state.

    inputSchema: z.ZodType

    Zod schema defining the tool's input parameters.

    outputSchema?: z.ZodType

    Optional Zod schema describing the tool's structured output.

    relatedTools?: string[]

    Tool names that are often used together with this tool.

    tags?: string[]

    Category tags (e.g. 'location', 'routing').