Theia API Documentation v1.69.0
    Preparing search index...

    Interface ToolRequest<TContext>

    Defines a tool that can be invoked by language models.

    interface ToolRequest<
        TContext extends ToolInvocationContext = ToolInvocationContext,
    > {
        checkAutoAction?: (argString: string) => undefined | AutoActionResult;
        confirmAlwaysAllow?: string | boolean;
        description?: string;
        handler: (arg_string: string, ctx?: TContext) => Promise<ToolCallResult>;
        id: string;
        name: string;
        parameters: ToolRequestParameters;
        providerName?: string;
        getArgumentsShortLabel?(
            args: string,
        ): undefined | { hasMore: boolean; label: string };
    }

    Type Parameters

    Index

    Properties

    checkAutoAction?: (argString: string) => undefined | AutoActionResult

    Optional hook to determine automatic action for this tool invocation.

    Type Declaration

      • (argString: string): undefined | AutoActionResult
      • Parameters

        • argString: string

          The JSON argument string passed to the tool

        Returns undefined | AutoActionResult

        • { action: 'allow' } - Auto-approve without confirmation
          • { action: 'deny', reason } - Auto-deny without confirmation
          • undefined - Show confirmation UI (default behavior)
    confirmAlwaysAllow?: string | boolean

    If set, this tool requires extra confirmation before auto-approval can be enabled.

    When a tool has this flag:

    • It defaults to CONFIRM mode (not ALWAYS_ALLOW) even if global default is ALWAYS_ALLOW
    • When user selects "Always Allow", an extra confirmation modal is shown
    • The modal displays a warning about the tool's capabilities

    If a string is provided, it will be displayed as the custom warning message. If true, a generic warning message will be shown.

    Use for tools with broad system access (shell execution, file deletion, etc.)

    description?: string
    handler: (arg_string: string, ctx?: TContext) => Promise<ToolCallResult>
    id: string
    name: string
    providerName?: string

    Methods

    • Optional method that returns a short, human-readable label for the tool's arguments to display in the chat UI summary.

      Parameters

      • args: string

        The raw arguments JSON string passed to the tool.

      Returns undefined | { hasMore: boolean; label: string }

      An object with:

      • label: A short text to display (e.g. the most important argument value).
      • hasMore: Whether there are additional arguments not shown in the label (renders as ... suffix). Returns undefined if no short label can be determined. If this method is not provided, a generic condensed rendering of the arguments JSON is used as fallback.