Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Anthropics Anthropic sdk python BetaToolComputerUse 20251124

From Leeroopedia
Knowledge Sources
Domains API_Types, Beta_Features
Last Updated 2026-02-15 12:00 GMT

Overview

BetaToolComputerUse20251124Param is a TypedDict defining the parameter structure for the November 2025 version of the computer use tool. This is the latest version and introduces the enable_zoom capability, allowing the model to take zoomed-in screenshots of specific screen regions.

Description

BetaToolComputerUse20251124Param is the third and most recent iteration of the computer use tool. It extends the January 2025 version with one new optional field: enable_zoom. When enabled, the model can request zoomed-in screenshots of portions of the screen, improving its ability to read small text or interact with fine UI elements.

This version is identified by the type literal "computer_20251124" and the name literal "computer". It includes:

  • Required fields: Display width/height in pixels, name (always "computer"), and type (always "computer_20251124")
  • Optional fields: All fields from previous versions plus enable_zoom for zoomed screenshot capability

Usage

Use BetaToolComputerUse20251124Param for the most capable computer use tool configuration. This is the recommended version for new implementations. Enable the enable_zoom option when the model needs to interact with high-resolution displays or read small interface elements.

Code Reference

Source Location

  • Repository: Anthropic SDK Python
  • File: src/anthropic/types/beta/beta_tool_computer_use_20251124_param.py

Signature

class BetaToolComputerUse20251124Param(TypedDict, total=False):
    display_height_px: Required[int]
    display_width_px: Required[int]
    name: Required[Literal["computer"]]
    type: Required[Literal["computer_20251124"]]
    allowed_callers: List[Literal["direct", "code_execution_20250825"]]
    cache_control: Optional[BetaCacheControlEphemeralParam]
    defer_loading: bool
    display_number: Optional[int]
    enable_zoom: bool
    input_examples: Iterable[Dict[str, object]]
    strict: bool

Import

from anthropic.types.beta import BetaToolComputerUse20251124Param

I/O Contract

Field Type Required Description
display_height_px int Yes The height of the display in pixels
display_width_px int Yes The width of the display in pixels
name Literal["computer"] Yes Tool name; always "computer"
type Literal["computer_20251124"] Yes Tool version identifier
allowed_callers List[Literal["direct", "code_execution_20250825"]] No Which callers may invoke this tool
cache_control Optional[BetaCacheControlEphemeralParam] No Cache control breakpoint for this tool definition
defer_loading bool No If true, tool is not included in initial system prompt
display_number Optional[int] No X11 display number (e.g., 0, 1)
enable_zoom bool No Whether to enable zoomed-in screenshot action
input_examples Iterable[Dict[str, object]] No Example inputs for the tool
strict bool No When true, guarantees schema validation on tool names and inputs

Version Comparison

Feature 20241022 20250124 20251124
Display dimensions Yes Yes Yes
X11 display number Yes Yes Yes
Cache control Yes Yes Yes
Deferred loading Yes Yes Yes
Allowed callers Yes Yes Yes
Input examples Yes Yes Yes
Strict validation Yes Yes Yes
Zoom support No No Yes

Usage Examples

Basic Configuration

from anthropic.types.beta import BetaToolComputerUse20251124Param

tool: BetaToolComputerUse20251124Param = {
    "type": "computer_20251124",
    "name": "computer",
    "display_width_px": 1920,
    "display_height_px": 1080,
}

With Zoom Enabled

from anthropic.types.beta import BetaToolComputerUse20251124Param

tool: BetaToolComputerUse20251124Param = {
    "type": "computer_20251124",
    "name": "computer",
    "display_width_px": 3840,
    "display_height_px": 2160,
    "enable_zoom": True,
    "display_number": 0,
}

Full API Call

import anthropic

client = anthropic.Anthropic()

message = client.beta.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=4096,
    tools=[
        {
            "type": "computer_20251124",
            "name": "computer",
            "display_width_px": 1920,
            "display_height_px": 1080,
            "enable_zoom": True,
        }
    ],
    messages=[{"role": "user", "content": "Read the small text at the bottom of the screen."}],
    betas=["computer-use-2025-11-24"],
)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment