CTX7-1872: Improve Context7 documentation queries#2941
Open
enesgules wants to merge 6 commits into
Open
Conversation
enesgules
marked this pull request as ready for review
July 24, 2026 13:00
Collaborator
Author
|
CI note: the fresh run and one retry both passed lint, formatting, build, typecheck, 46 MCP tests, and 245 CLI tests. The only failure is the existing live Pi |
fahreddinozcan
approved these changes
Jul 24, 2026
Collaborator
Author
|
Fixed in |
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.
What changed
Updated MCP, CLI, SDK, Pi, plugin, rule, and skill prompts to ask agents what to look up in a library's documentation instead of passing the user's question or task directly.
Existing guidance remains intact, including examples, single-topic queries, multi-concept splitting, and the exception for questions about how concepts interact. The final
find-docswording distinguishes the documentation lookup from the task the agent needs to complete.Why
Agents can send broad implementation requests or project context to Context7 even though Context7 retrieves documentation. These prompts keep the query about the documentation needed while preserving useful natural-language documentation questions.
Benchmark
The CLI benchmark used the same 80 questions for production and local targets. In the latest run:
how todocumentation queries: 2 local, 4 productionimplementdocumentation queries: 0 local, 1 productionBenchmark harness: https://github.com/upstash/context7benchmark/pull/16
Checks
git diff --checkLinear: https://linear.app/upstash/issue/CTX7-1872/focus-context7-documentation-queries
App prompt: https://github.com/upstash/context7app/pull/814