Skip to content

docs: describe query by when to use it, not how it works - #51

Merged
syswave-dev merged 2 commits into
mainfrom
feat/query-discoverability
Aug 1, 2026
Merged

docs: describe query by when to use it, not how it works#51
syswave-dev merged 2 commits into
mainfrom
feat/query-discoverability

Conversation

@syswave-dev

Copy link
Copy Markdown
Collaborator

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_url tool description now points to query for specific-information requests; the query param 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_tokens now states it has no effect without query.
  • Skill bundle (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).
  • Regression test: asserts content markers on the read_url schema (trigger phrasing present, no "BM25", figure kept, max_tokens inertness stated) so a later refactor cannot silently revert to a mechanism-only description.
  • Incidental fix: help.html's agent-prompt <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 passing
  • Blind acceptance test (post-merge, per handoff): fresh agent session with the MCP server registered, ask a specific question about a long docs page, verify query is set spontaneously; counter-test that full-page requests (summarize/translate) do NOT set it

🤖 Generated with Claude Code

https://claude.ai/code/session_01EsYPb8cabt2wdwe83kSvXw

syswave-dev and others added 2 commits August 1, 2026 11:29
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
@syswave-dev
syswave-dev merged commit 1b5ea0f into main Aug 1, 2026
4 checks passed
@syswave-dev
syswave-dev deleted the feat/query-discoverability branch August 1, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant