Description
When using BedrockChatClient with an Agent that has no tools configured, the client still sends toolConfig.toolChoice to the Bedrock API. This causes a validation error because AWS Bedrock requires toolConfig.tools to be present whenever toolConfig.toolChoice is specified.
Code Sample
import asyncio
from agent_framework import Agent
from agent_framework_bedrock import BedrockChatClient
async def main():
client = BedrockChatClient(
access_key="...",
secret_key="...",
region="eu-west-1",
model="anthropic.claude-sonnet-4-6"
)
# Agent with no tools
agent = Agent(
client=client,
name="TestAgent",
instructions="You are a helpful assistant",
tools=None, # No tools
default_options=None, # No tool options
)
# This fails with ParamValidationError
result = await agent.run("What is AI?")
print(result)
asyncio.run(main())
Error Messages / Stack Traces
botocore.exceptions.ParamValidationError: Parameter validation failed:
Missing required parameter in toolConfig: "tools"
Package Versions
agent-framework-bedrock version: 1.0.0b260402
Python Version
Python version: 3.10+
Additional Context
Expected behavior
When no tools are provided to the agent, the BedrockChatClient should NOT include toolConfig in the API request at all. This is similar to how PR #4535 fixed the tool_choice="none" case by omitting toolConfig entirely.
Actual behavior
The client sends a request with toolConfig.toolChoice (likely defaulting to {"auto": {}}) but without toolConfig.tools, causing AWS Bedrock to reject the request.
Description
When using
BedrockChatClientwith anAgentthat has no tools configured, the client still sendstoolConfig.toolChoiceto the Bedrock API. This causes a validation error because AWS Bedrock requirestoolConfig.toolsto be present whenevertoolConfig.toolChoiceis specified.Code Sample
import asyncio from agent_framework import Agent from agent_framework_bedrock import BedrockChatClient async def main(): client = BedrockChatClient( access_key="...", secret_key="...", region="eu-west-1", model="anthropic.claude-sonnet-4-6" ) # Agent with no tools agent = Agent( client=client, name="TestAgent", instructions="You are a helpful assistant", tools=None, # No tools default_options=None, # No tool options ) # This fails with ParamValidationError result = await agent.run("What is AI?") print(result) asyncio.run(main())Error Messages / Stack Traces
Package Versions
agent-framework-bedrock version: 1.0.0b260402
Python Version
Python version: 3.10+
Additional Context
Expected behavior
When no tools are provided to the agent, the
BedrockChatClientshould NOT includetoolConfigin the API request at all. This is similar to how PR #4535 fixed thetool_choice="none"case by omittingtoolConfigentirely.Actual behavior
The client sends a request with
toolConfig.toolChoice(likely defaulting to{"auto": {}}) but withouttoolConfig.tools, causing AWS Bedrock to reject the request.