This repository was archived by the owner on May 15, 2026. It is now read-only.
Repository navigation
Commit fbbe3c1
committed
feat: replace hyphen encoding with fuzzy matching for MCP tool names
Replace triple-underscore encoding (___) with fuzzy matching that treats
hyphens and underscores as equivalent. This keeps MCP tool names short
and readable while still handling model mangling of hyphens.
- Remove HYPHEN_ENCODING and decodeMcpName()
- Add normalizeForComparison() and toolNamesMatch() for fuzzy matching
- Update McpHub.findServerNameBySanitizedName() with fuzzy match fallback
- Update tests to reflect new behavior
Related to: #107661 parent 8b9f02a commit fbbe3c1
4 files changed
Lines changed: 291 additions & 152 deletions
File tree
- src
- core/prompts/tools/native-tools/__tests__
- services/mcp
- utils
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
| 943 | + | |
943 | 944 | | |
944 | 945 | | |
945 | 946 | | |
946 | 947 | | |
| 948 | + | |
947 | 949 | | |
948 | 950 | | |
949 | 951 | | |
950 | 952 | | |
951 | 953 | | |
952 | | - | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
953 | 967 | | |
954 | 968 | | |
955 | 969 | | |
| |||
0 commit comments