Bedrock Runtime: raise the 64-character tool-name limit for MCP interoperability

未关闭
#99 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
aws, python
领域
api, cloud

调研方向

No SDK file or test is identified because the report describes a Bedrock Runtime service-side constraint rather than a Python serialization issue. Reproduce the request using Converse with a 65-character toolSpec.name, then review the linked ToolSpecification API documentation; done means the service supports the requested longer names or documents a supported aliasing mechanism.

由索引模型根据 Issue 内容生成。

描述

Summary

Amazon Bedrock Runtime Converse limits toolConfig.tools[].toolSpec.name to 64 characters. Modern MCP clients qualify tool names with a server or application namespace, which can make otherwise valid tool names exceed this limit and cause Bedrock to reject the entire request before inference.

Please consider raising the Bedrock Runtime tool-name limit to at least 128 characters, or providing another service-supported mechanism for stable long-name aliases.

This is a Bedrock Runtime service API compatibility request rather than an SDK serialization bug. It is being filed here because the AWS SDK for Python currently targets Bedrock Runtime and provides a public AWS-owned feedback tracker.

Use case: Codex Apps over Bedrock

OpenAI Codex exposes app tools through MCP using model-visible names shaped like:

mcp__codex_apps__<tool_name>

The namespace consumes 17 characters, leaving only 47 characters for the individual tool name under the Bedrock limit.

Codex originally normalized MCP names to 64 bytes. OpenAI PR #39594 raised that limit to 128 bytes to match the OpenAI Responses API. Consequently, names between 65 and 128 characters are valid in Codex but fail when an OpenAI-compatible gateway forwards the request to Bedrock Runtime.

The Codex regression and reproduction details are tracked here:
https://github.com/openai/codex/issues/46188

Original Codex name-length issue and changes:

Reproduction

  1. Invoke Bedrock Runtime Converse with a model that supports tool use.
  2. Include a toolSpec.name containing 65 valid ASCII characters.
  3. Bedrock rejects the request with a ValidationException indicating that the member length must be less than or equal to 64.

The same failure occurs when one codex_apps MCP name exceeds the limit because Bedrock validates the complete tool configuration before model execution.

API constraint:
https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ToolSpecification.html

Expected behavior

Ideally, Bedrock Runtime would accept tool names of at least 128 characters consistently across:

  • ToolSpecification.name
  • SpecificToolChoice.name
  • returned toolUse.name values
  • tool names replayed in conversation history

If the runtime limit cannot be raised, a documented service-supported aliasing or capability-negotiation mechanism would help clients avoid provider-specific request failures.

Current workaround

A proxy deterministically shortens names to 64 characters, preserves uniqueness with a hash suffix, and reverse-maps returned tool calls to their original MCP names. This works but requires every client or gateway to implement its own bidirectional mapping.

Related AWS-owned reports currently work around the same constraint by shortening names rather than changing the Runtime limit:

Environment

  • Client: OpenAI Codex CLI 0.153.2 / Codex Apps MCP tools
  • Backend: Amazon Bedrock Runtime through an OpenAI-compatible gateway
  • Platform: macOS
  • SDK applicability: service-side constraint; reproducible through any AWS SDK exposing Converse
主要语言
Python
星标
171
派生
24
平均合并
10 小时 47 分钟
30 天内合并 PR
7

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

aws/aws-sdk-python 的其他 Issue

查看 aws/aws-sdk-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。