Skip to content

[BUG] Anthropic Computer Use tool error #1362

@Luke-Shepp

Description

@Luke-Shepp

Checks

  • I have updated to the lastest minor and patch version of Strands
  • I have checked the documentation and this is not expected behavior
  • I have searched ./issues and there are no duplicates of my issue

Strands Version

1.20.0

Python Version

3.13

Operating System

macos

Installation Method

pip

Steps to Reproduce

Create a Bedrock model, enabling computer use functionality;

sonnet_4 = BedrockModel(
    model_id="us.anthropic.claude-sonnet-4-20250514-v1:0",
    region_name=os.environ.get("AWS_REGION"),
    temperature=0.0,
    max_tokens=10000,
    additional_request_fields={
        "tools": [
            {
                "type": "computer_20250124",
                "name": "computer",
                "display_width_px": 1024,
                "display_height_px": 768,
                "display_number": 1,
            },
        ],
        "anthropic_beta": ["computer-use-2025-01-24"],
    },
)

Create the agent;

agent = Agent(
        name="computer_use_agent",
        model=sonnet_4,
        system_prompt="you are an agent with computer use tools to help the user navigate their desktop",
        session_manager=session_manager,
    )

Then invoke the agent with something like "help me open Google Chrome"

Output when the agent tries to invoke a tool called computer with {"action": "screenshot"}:

tool_name=<computer>, available_tools=<[]> | tool not found in registry

I also tried adding a custom tool to combat this, like:

@tool(context=True)
def computer(tool_context: ToolContext, **kwargs):
    """
    Execute a computer command on the user's machine.

    :param tool_context:
    :param command: The command to execute
    :return:
    """
    pass

But, understandably, receive this error:

botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the ConverseStream operation: The model returned the following errors: tools: Tool names must be unique.
└ Bedrock region: us-east-1
└ Model id: us.anthropic.claude-sonnet-4-20250514-v1:0

Expected Behavior

The built-in computer tool should be useable!

Actual Behavior

It's not

Additional Context

No response

Possible Solution

No response

Related Issues

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-providerRelated to model providersenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions