Skip to content

Feature Request: Add tool_runner support for AnthropicBedrock client #1106

@lingjiekong

Description

@lingjiekong

Summary

The tool_runner API (client.beta.messages.tool_runner()) is not available on the AnthropicBedrock and AsyncAnthropicBedrock clients, despite the documentation stating "the rest of the API is the same" for Bedrock.

Current Behavior

from anthropic import AsyncAnthropic, AsyncAnthropicBedrock

# Direct Anthropic API - works ✅
client = AsyncAnthropic(api_key='...')
print(type(client.beta.messages))  
# <class 'anthropic.resources.beta.messages.messages.AsyncMessages'>
print(hasattr(client.beta.messages, 'tool_runner'))  # True ✅

# Bedrock API - missing tool_runner ❌
bedrock_client = AsyncAnthropicBedrock(aws_region='us-west-2')
print(type(bedrock_client.beta.messages))  
# <class 'anthropic.lib.bedrock._beta_messages.AsyncMessages'>
print(hasattr(bedrock_client.beta.messages, 'tool_runner'))  # False ❌

Attempting to use tool_runner on Bedrock results in:

AttributeError: 'AsyncMessages' object has no attribute 'tool_runner'

Expected Behavior

The tool_runner API should be available on AnthropicBedrock and AsyncAnthropicBedrock clients, enabling:

  • Automatic tool execution loop
  • Client-side compaction control (compaction_control parameter)
  • Consistent API surface across direct and Bedrock clients

Available Methods Comparison

Method AsyncAnthropic AsyncAnthropicBedrock
create
with_raw_response
with_streaming_response
tool_runner ❌ Missing

Use Case

We're building agentic applications that need:

  1. Automatic tool execution loops (what tool_runner provides)
  2. Client-side compaction control for long-running agent sessions
  3. AWS Bedrock for enterprise deployment (compliance, VPC, etc.)

Currently, we must choose between Bedrock (enterprise requirements) OR tool_runner features - we cannot have both.

Environment

  • Python SDK version: 0.75.0
  • Python version: 3.11

Workaround

Currently using direct Anthropic API (AsyncAnthropic) instead of Bedrock, but this doesn't meet enterprise deployment requirements.

Related

This is similar to other Bedrock feature gaps:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions