Add global search_docs tool and cross-resource doc discovery#181
Merged
Conversation
Give agents many ways to discover docs over one shared search index, so the focused tools (action=help, api_read describe, run_script_search_docs) stay while a single front door ties them together: - New `search_docs` tool: no query returns a table of contents across domains (resources, raw API endpoints, run_script scripting API); a query returns ranked cross-domain matches, each pointing at the tool to drill in - `productive` action=help now accepts a `query` for cross-resource search - `api_read` accepts `search="<term>"` to discover endpoints by keyword (path is now optional; provide path or search) - Reuses pure engines (searchResourceHelp, searchApiEndpoints, findDocSections) so nothing drifts; SKILL.md/CHANGELOG/tests updated Co-authored-by: Claude <claude@anthropic.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #181 +/- ##
==========================================
+ Coverage 97.23% 97.25% +0.01%
==========================================
Files 263 264 +1
Lines 8739 8802 +63
Branches 2716 2788 +72
==========================================
+ Hits 8497 8560 +63
Misses 236 236
Partials 6 6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Drop the separate run_script_search_docs tool and fold the scripting reference into the global search_docs, so there is one discovery front door instead of two overlapping ones: - search_docs now owns the run_script docs: it lists scripting topics in its table of contents and returns full matching section bodies on a query (it is the scripting drill-in, while resources/endpoints still point at action=help / api_read describe) - run/docs.ts is reduced to the shared content + matcher (DOC_SECTIONS, docSectionTitles, findDocSections); the standalone renderer and the run_script_search_docs handler/tool/wiring are removed - Update SKILL.md, CHANGELOG, and tests; tool list drops back to 7 Co-authored-by: Claude <claude@anthropic.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Follow-up to #180. Gives agents one front door to discover documentation across everything the server exposes, over one shared search index.
Motivation: the tools already had per-item discovery (
productive action=help/schema,api_read describe), and #180 added a scripting-docs tool — but there was no way to search across them ("which resource/endpoint handles invoices?"), and two overlapping discovery tools was redundant surface.What's added
search_docs— the single discovery tool. No query → a compact table of contents across domains (resources, raw API endpoints, run_script scripting API). A query → ranked cross-domain matches:productive action="help"api_read describeproductiveaction=help+query— cross-resource help search (which resources match a term, and where).api_readsearch="<term>"— discover documented endpoints by keyword;pathis now optional (providepathorsearch).All three are thin wrappers over pure, reused engines —
searchResourceHelp,searchApiEndpoints,findDocSections— so the indexes can't drift from the real docs.Consolidation (vs. the earlier iteration)
The separate
run_script_search_docstool is removed; its content now lives insearch_docs. There was never content duplication (both read oneDOC_SECTIONSsource), but two discovery tools was redundant surface — collapsing to one is simpler to maintain and gives agents a single place to look.run/docs.tsis reduced to the shared content + matcher.Token budget
Discovery content lives in tool responses, not schemas (TOC-first, drill-in on demand). The full
TOOLSlist stays modest and the heavy reference is never loaded wholesale.Testing
help.test.ts,api-utilssearch,run/docsmatcher) and the aggregator (search-docs.test.ts), plusapi_readsearch-mode and the help-query path.search_docs(TOC, cross-domain query, full scripting sections),action=helpquery, andapi_read searchthrough the real binary.npm run checkclean.🤖 Generated with Claude Code