Kiro answers a tool name longer than 64 characters "Invalid tool use
format." (REQUEST_BODY_INVALID), and has declined to raise the limit
(kirodotdev/Kiro#7684). Claude Code names a plugin's MCP tools
mcp__plugin_<plugin>_<server>__<tool>, e.g. the Cloudflare plugin's
mcp__plugin_cloudflare_cloudflare-docs__search_cloudflare_documentation
(71), so every turn that offered it failed. The plugin passed t.name
through as it was.
toolName keeps a name of [a-zA-Z0-9_-]{1,64} as it is; any other becomes
its head (other characters as _) plus _ and 12 hex of its sha256, at most
64 characters. It is the same each turn, so the declaration, the history's
toolUses and the tools declared for the history all agree without state.
toolNames maps each such name back from the request's tools and history,
and reply gives the caller's name on tool_use blocks, streamed and not.
Results pair by toolUseId, which is unchanged.
tool-names.test.mjs (the reporter's 71- and 70-character names) fails 3
of 3 without the change and passes; HOME=$(mktemp -d) bun test: 1003
pass, 0 fail across the repo; bun scripts/check.mjs kiro passes. Not
tried against Kiro itself: no Kiro sign-in on this machine.