Skip to content

[BUG] [Malformed input request] Issue calling bedrock after loading tools from mcp server #247

Open
@paulognr

Description

@paulognr

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

0.1.8

Python Version

3.10.5

Operating System

Windows 11 Enterprise

Installation Method

pip

Steps to Reproduce

  1. Create a MCPClient using awslabs.dynamodb-mcp-server
  2. Create an Agent with tools provided by the mcp server.
  3. Try to use it

Expected Behavior

Bedrock is able to parse the toolSpec and the API call is successful.

Actual Behavior

Bedrock API call crashes because of malformed input request.

Additional Context

ToolSpec example:
Image

Error from Bedrock API:
.venv\lib\site-packages\botocore\client.py", line 1061, in _make_api_call raise error_class(parsed_response, operation_name) botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the ConverseStream operation: The model returned the following errors: Malformed input request: #/toolConfig/tools/8/toolSpec/inputSchema/json: extraneous key [$defs] is not permitted, please reformat your input and try again.

Possible Solution

Sanitize all tools before calling bedrock.

Related Issues

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions