You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: retrieve_tools misses non-contiguous underscore segments in tool names #1290
retrieve_tools handles exact, prefix, and contiguous wildcard matches for underscore-containing tool names, but it does not treat identifier segments as independently searchable terms.
For example, a tool named work_start_task_attachment_upload is not found by the query work_upload_attachment, even though every requested segment is present. A natural-language description query can find the same tool, so the limitation is specific to identifier-style discovery.
The current underscore regression test covers a contiguous substring (Get_current_TVL), which passes through the wildcard query, but not non-contiguous identifier segments.
This is intentionally narrower than hybrid/vector search in #31 and requires no external model or service.
Expected behavior
Treat underscore-separated identifier segments as an additional internal search signal.
Require all normalized query segments for that signal.
Keep the canonical tool name and exact-match boost unchanged.
Return the original canonical tool ID without publishing aliases or duplicate tools.
Steps to reproduce
Index this synthetic tool in internal/index:
&config.ToolMetadata{
Name: "work_start_task_attachment_upload",
ServerName: "fixture",
Description: "Create a signed request for a local file.",
ParamsJSON: `{"type":"object","properties":{}}`,
Hash: "synthetic",
}
Run SearchTools("work_upload_attachment", 10).
Observe that the result list is empty.
I reproduced this with MCPProxy v0.66.1 and current main at 8acb506deb0a64f9c538843cfed0882036f1da8a.
Implementation question
I can prepare a focused PR with index-level regression tests. Before settling the implementation, would you prefer:
A normalized internal index field, with an explicit safe rebuild/migration path; or
Segment-aware query clauses over the existing keyword field, avoiding an index mapping change?
The first option offers cleaner term semantics but changes the persisted Bleve mapping. The second keeps the existing index but needs careful segment-boundary and performance handling.
Environment
MCPProxy version: v0.66.1 (personal) darwin/arm64
Operating system: macOS
Pre-submission checklist
I searched existing issues and discussions and did not find a duplicate.
Activity
Dumbris commentedon Sep 17, 2026
Thanks for the clean repro and the two options, @neylwalecki!
Go with Option 2 — we don't have index-rebuild infra yet, so a mapping change would mean building that first for no real gain at our tool-set sizes.
Left a couple of correctness notes on #1291.