ADK for TypeScript: API Reference
    Preparing search index...

    Class ComputerUseTool

    A tool that wraps computer control functions for use with LLMs.

    This tool scales coordinates from a virtual coordinate space (by default 1000x1000) to the actual screen size. This lets the model work with a consistent coordinate system regardless of the actual screen dimensions, which makes its output more predictable.

    When the wrapped function returns a ComputerState, the tool returns {image: {mimetype, data}, url} with the screenshot base64-encoded; the agent then sends the image to the model as part of the function response.

    When the model marks a call with a safety_decision of require_confirmation, the tool asks the user to confirm before it runs and adds safety_acknowledgement: 'true' to the response once confirmed.

    Hierarchy (View Summary)

    "[BASE_TOOL_SIGNATURE_SYMBOL]": true

    A unique symbol to identify ADK base tool class.

    "[COMPUTER_USE_TOOL_SIGNATURE_SYMBOL]": true

    A unique symbol to identify ADK computer use tool class.

    "[FUNCTION_TOOL_SIGNATURE_SYMBOL]": true

    A unique symbol to identify ADK function tool class.

    description: string

    The wrapped computer control function.

    isLongRunning: boolean
    name: string
    screenSize: readonly [number, number]

    The actual screen size as (width, height) in pixels.

    virtualScreenSize: readonly [number, number]

    The virtual coordinate space as (width, height).

    • Whether this call needs user confirmation: when the model marked it with a safety_decision of require_confirmation, or when the base tool says so.

      Parameters

      • args: Record<string, unknown>

        The arguments the tool would run with.

      • OptionaltoolContext: Context

        The context of the call, when there is one.

      Returns Promise<boolean>

      Whether the call requires confirmation.