atxtechbro / atxtechbro/dotfiles
Claude Code: Tool name length validation error on macOS with Bedrock integration
- Dominant language
- Shell
- Stars
- 27
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
# Problem
Claude Code fails with API Error on macOS when `WORK_MACHINE=true` and Bedrock integration is enabled:
```
API Error: 400 tools.93.custom.name: String should have at most 64 characters
```
## Root Cause Analysis
**Confirmed Root Cause**: Claude Code enforces a 64-character limit on MCP tool names, while Claude Desktop does not have this restriction.
**External Reference**: [anthropics/claude-code#2445](https://github.com/anthropics/claude-code/issues/2445) - "Documented MCP import from Claude Desktop fails due to tool name length validation"
## Environment Details
- **Platform**: macOS
- **Configuration**: `WORK_MACHINE=true` in `~/.bash_exports.local`
- **Integration**: Bedrock integration enabled for work machine
- **MCP Servers**: Standard + work-specific servers (Atlassian, GitLab)
- **Tool Count**: Tool #93 suggests 90+ tools loaded from combined MCP servers
## Investigation Results
### MCP Server Tool Counts
- **Atlassian MCP**: 42 tools (all under 64 char limit individually)
- **Combined servers**: 90+ tools when all MCP servers load together
- **Issue**: Tool #93 in the combined list exceeds 64 characters
### Debug Infrastructure Created
Added systematic debugging approach:
1. **Debug alias**: `claude-debug` with `DEBUG=1` and `-p` flags
2. **Protocol testing**: Commands to test each MCP server individually
3. **Work server detection**: Proper handling of `WORK_MACHINE=true` environment
## Solution Approach
### Immediate Fix Options
1. **Identify tool #93**: Use protocol-level testing to find the specific long tool name
2. **Shorten tool names**: Edit MCP server implementations to use abbreviations
3. **Remove redundant prefixes**: Optimize tool naming conventions
### Systematic Debugging Procedure
Created comprehensive debugging procedure in `knowledge/procedures/claude-code-debugging.md`:
```bash
# Test individual MCP servers for long tool names
for server in git github-read github-write gitlab brave-search filesystem gdrive atlassian; do
echo "Testing $server..."
# Protocol-level testing commands...
done
```
## Files Modified
- **Added**: `.bash_aliases.d/ai-providers.sh` - `claude-debug` alias
- **Created**: `knowledge/procedures/claude-code-debugging.md` - Systematic debugging procedure
- **Enhanced**: MCP server testing capabilities
## Next Steps
1. **Reproduce consistently**: Use `claude-debug` to trigger the exact error
2. **Identify tool #93**: Determine which MCP server provides the long-named tool
3. **Implement fix**: Shorten the problematic tool name(s)
4. **Test verification**: Ensure Claude Code works with all MCP servers loaded
## Systems Stewardship Impact
This debugging infrastructure investment creates:
- **Faster issue resolution** for future Claude Code problems
- **Systematic approach** preventing repeated investigation
- **Documentation** enabling team knowledge sharing
- **Debug aliases** reducing cognitive overhead
**Principle**: Systems stewardship - invest in debugging capabilities to make all future debugging faster.
## References
- **External Issue**: [anthropics/claude-code#2445](https://github.com/anthropics/claude-code/issues/2445)
- **Claude Code Docs**: [Model Context Protocol (MCP) - Anthropic](https://docs.anthropic.com/en/docs/claude-code/mcp)
- **Debugging Procedure**: `knowledge/procedures/claude-code-debugging.md`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with .bash_aliases.d/ai-providers.sh and knowledge/procedures/claude-code-debugging.md, then run the claude-debug procedure with WORK_MACHINE=true. Test the listed MCP servers individually to identify the tool exceeding 64 characters. Done means the offending name is identified and Claude Code works with all configured servers loaded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, shell
- Domain
- devtools, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100