Bug Description
ctx_search returns Error: provide query or queries. when called with the singular query parameter, even though the MCP tool schema declares query as a valid (non-required) string parameter alongside queries (array).
Reproduction
Call ctx_search with { query: "some search", limit: 5 } — the server responds with an error instead of performing the search.
Using { queries: ["some search"], limit: 5 } works correctly.
Root Cause (from source analysis)
In server.bundle.mjs v1.0.169, the validation logic checks only r.query:
// Extracted from server.bundle.mjs
if (r.query), o.length === 0) return W("ctx_search", {
content: [{ type: "text", text: "Error: provide query or queries." }],
isError: true
});
The code builds the query array o from r.queries but the fallback to r.query (singular) appears to not populate o, so the length check fails and the error is returned.
Expected Behavior
When query (singular string) is provided, it should be treated as equivalent to queries: [query] per the schema contract.
Environment
- context-mode version: v1.0.169
- Platform: Linux (Claude Code CLI)
- MCP host: Claude Code
Workaround
Always use queries (array) instead of query (string).
Bug Description
ctx_searchreturnsError: provide query or queries.when called with the singularqueryparameter, even though the MCP tool schema declaresqueryas a valid (non-required) string parameter alongsidequeries(array).Reproduction
Call
ctx_searchwith{ query: "some search", limit: 5 }— the server responds with an error instead of performing the search.Using
{ queries: ["some search"], limit: 5 }works correctly.Root Cause (from source analysis)
In
server.bundle.mjsv1.0.169, the validation logic checks onlyr.query:The code builds the query array
ofromr.queriesbut the fallback tor.query(singular) appears to not populateo, so the length check fails and the error is returned.Expected Behavior
When
query(singular string) is provided, it should be treated as equivalent toqueries: [query]per the schema contract.Environment
Workaround
Always use
queries(array) instead ofquery(string).