docs: describe query by when to use it, not how it works - #51
Merged
Conversation
Agents never reached for query extraction: the read_url tool description never mentioned `query`, and the param description led with the mechanism (BM25) instead of the trigger condition. Rewrites all three strings so the schema states when to pass `query`, keeps the 70-95% token-saving figure, and inverts the default framing (full page is what needs justification). `docs` rather than `feat`: description strings only, zero behavior change - extraction, defaults, param names, types and validation ranges are untouched. Adds a content-marker regression test on the registered tool schema so a later refactor back to a mechanism-only description fails the suite. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EsYPb8cabt2wdwe83kSvXw
The MCP schema was fixed in the previous commit; the three remaining
surfaces still described `query` mechanically ("return only the sections
relevant to this text", "BM25 over the converted Markdown"), which says
what the parameter does but gives a model no trigger to match against.
All three now lead with the trigger (specific question instead of the
whole document, phrased in natural language), name the payoff (typically
70-95% fewer tokens on long pages) and frame the full-page fetch as the
case that needs a reason. `max_tokens` states it has no effect without
`query`. help.html changes are made in both language spans; the
`query=<text>` line in its agent prompt was also HTML-escaped, which it
had never been, so it was being swallowed by the parser.
Text only, no behavior change.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsYPb8cabt2wdwe83kSvXw
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
The query extraction feature (v3.4.0) works well but agents almost never use it: the MCP tool description never mentioned
query, and the parameter description named the mechanism (BM25) instead of the trigger condition. This PR changes description text only - no behavior change anywhere.lib/mcp.js:read_urltool description now points toqueryfor specific-information requests; thequeryparam description leads with the trigger ("set this when you need specific information from a page rather than the whole document, pass the question in natural language"), keeps the 70-95% token-saving figure, and frames the full-page fetch as the case that needs a reason (summarizing, translating, archiving).max_tokensnow states it has no effect withoutquery.SKILL.md), README,/help: same trigger-first treatment on the param tables, the universal agent prompt block, and the query sections (DE/EN in help.html).read_urlschema (trigger phrasing present, no "BM25", figure kept,max_tokensinertness stated) so a later refactor cannot silently revert to a mechanism-only description.<pre>contained an unescaped<text>that browsers swallowed; now properly escaped.Nothing changes for existing integrations except the likelihood that the parameter actually gets used.
Test plan
node --test- 1103/1103 passingqueryis set spontaneously; counter-test that full-page requests (summarize/translate) do NOT set it🤖 Generated with Claude Code
https://claude.ai/code/session_01EsYPb8cabt2wdwe83kSvXw