feat: expose candidateLimit as MCP tool parameter and CLI flag#255
Open
feat: expose candidateLimit as MCP tool parameter and CLI flag#255
Conversation
Reranking 40 chunks takes ~2 min on CPU (the default candidateLimit). The option already exists in hybridQuery()/structuredSearch() but was never surfaced to users. This adds: - `candidateLimit` param to the MCP `query` tool inputSchema - `candidateLimit` field to the REST /query endpoint - `--candidate-limit` / `-C` CLI flag for `qmd query` Default stays 40 (no behavior change). Users on CPU-only machines can lower it for a speed/recall tradeoff. Complements tobi#231. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
863849a to
87bd968
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
candidateLimitparam to MCPquerytool, REST/queryendpoint, and CLI (--candidate-limit/-C)Closes #254. Complements #231.
Changes (2 files, +13/-1)
src/mcp.tscandidateLimittoquerytool inputSchema (zodz.number().optional())structuredSearch()in both MCP handler and REST/queryendpointsrc/qmd.ts--candidate-limit/-CtoparseCLI()optionscandidateLimittoOutputOptionstypestructuredSearch()andhybridQuery()inquerySearch()--helpoutputTest plan
npm run buildcompiles without errorsnpm test— 539/545 pass (6 failures are pre-existing LLM-dependent timeouts)qmd query --candidate-limit 10 "test query"on indexed datacandidateLimit: 10via adapter🤖 Generated with Claude Code