Skip to content

feat: add get_mapbox_docs_index_tool#30

Merged
mattpodwysocki merged 2 commits intofeat/sublevel-llms-txt-resourcesfrom
feat/docs-index-tool
Apr 14, 2026
Merged

feat: add get_mapbox_docs_index_tool#30
mattpodwysocki merged 2 commits intofeat/sublevel-llms-txt-resourcesfrom
feat/docs-index-tool

Conversation

@mattpodwysocki
Copy link
Copy Markdown
Contributor

Summary

  • Adds get_mapbox_docs_index_tool — the model can now autonomously fetch a product's llms.txt documentation index without the user manually attaching a resource
  • Supports 13 product keys: api-reference, mapbox-gl-js, help-guides, style-spec, studio-manual, search-js, ios-maps, android-maps, ios-navigation, android-navigation, tiling-service, tilesets, catalog
  • Results are cached via docCache — first fetch hits the network, subsequent calls are instant
  • Branches off feat: use sublevel llms.txt per product for MCP resources #27 (uses fetchCachedText from docFetcher)

Motivation

Resources in the Claude Desktop / Claude Code chat UI require the user to manually attach them. That defeats the purpose of a docs server — the model should be able to pull the right index on its own. This tool makes the same content accessible as a callable tool.

Test plan

  • All 5 new unit tests pass (GetDocsIndexTool.test.ts)
  • Build succeeds (npm run build)
  • Restart Claude Desktop and ask: "What GL JS guides are available?" — model should call get_mapbox_docs_index_tool with mapbox-gl-js without prompting

🤖 Generated with Claude Code

New tool that fetches the llms.txt documentation index for any Mapbox
product — model can autonomously pull the right index without the user
manually attaching a resource. Supports 13 product keys, results cached
via docCache.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mattpodwysocki mattpodwysocki requested a review from a team as a code owner April 14, 2026 18:11
The custom 'Accept: text/markdown, text/plain;q=0.9, */*;q=0.8' header
was triggering a 403 Forbidden from the docs.mapbox.com CDN. Removing it
(and the equivalent in fetchDocContent's fallback path) fixes the issue —
the CDN serves the file correctly without an explicit Accept header.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mattpodwysocki mattpodwysocki merged commit eaa138c into feat/sublevel-llms-txt-resources Apr 14, 2026
1 check passed
@mattpodwysocki mattpodwysocki deleted the feat/docs-index-tool branch April 14, 2026 18:23
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