Mcp: limit tool names to 64 characters for Claude Code
This commit is contained in:
parent
20c56dd9ff
commit
04f48d7be4
1 changed files with 9 additions and 0 deletions
|
|
@ -83,6 +83,15 @@ func nameFormat(log *util.Logger) func(name string) string {
|
|||
res = strings.ReplaceAll(res, "{", "with_")
|
||||
res = strings.ReplaceAll(res, "}", "")
|
||||
res = strings.ToLower(res)
|
||||
|
||||
// Claude Code has a 64 character limit for tool names
|
||||
if len(res) > 64 {
|
||||
res = strings.ReplaceAll(res, "with_", "w_")
|
||||
if len(res) > 64 {
|
||||
res = res[:64]
|
||||
}
|
||||
}
|
||||
|
||||
log.TRACE.Println("adding tool:", res)
|
||||
return res
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue