Skip to content

fix: steer map display to render_map_tool via server instructions - #269

Merged
mattpodwysocki merged 4 commits into
mainfrom
fix/prefer-render-map-tool
Oct 8, 2026
Merged

mattpodwysocki merged 4 commits into
mainfrom
fix/prefer-render-map-tool

Conversation

@mattpodwysocki

Copy link
Copy Markdown
Contributor

Problem

In Claude Desktop, after a successful isochrone_tool call, the model loaded static_map_image_tool to show the result and never loaded render_map_tool. When asked why, the model said it had loaded static_map_image_tool "because the name looked like the right fit for 'show a map'" and never saw render_map_tool's description.

Cause

Claude Desktop lists only tool names until the model loads a tool. render_map_tool's description says "ALWAYS use this tool to display maps", but nothing the model could see before choosing said so.

Fix

  • Server instructions: the server now returns MCP instructions from initialize, which hosts show up front:

    The instructions name only enabled tools, and are omitted when render_map_tool is disabled.

  • static_map_image_tool description: now says to use render_map_tool to show a map.

  • Hint on tool results: the hint appended to results that carry a mapboxRender.ref now names render_map_tool over static_map_image_tool and says to pass the ref unchanged.

Testing

  • New tests cover the instruction text with all tools enabled, without static_map_image_tool, and without render_map_tool.
  • Full suite passes (961 tests), plus lint.
  • Against the built server over stdio: initialize returns the instructions, and tools/list shows the updated static_map_image_tool description.
  • I haven't yet confirmed that the model follows the instructions in Claude Desktop.

🤖 Generated with Claude Code

mattpodwysocki and others added 2 commits October 7, 2026 13:32
Hosts that load tools lazily (Claude Desktop) list only tool names, so a
model asked to show a map picked static_map_image_tool by name and never
saw render_map_tool's description. Add server instructions routing map
display to render_map_tool (refs passed unchanged), and point
static_map_image_tool's description and the mapboxRender hint at
render_map_tool too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattpodwysocki
mattpodwysocki requested a review from a team as a code owner October 7, 2026 17:35
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jussi-sa
jussi-sa previously approved these changes Oct 7, 2026
…-tool

# Conflicts:
#	CHANGELOG.md
#	src/index.ts
@mattpodwysocki
mattpodwysocki merged commit 5bce6f7 into main Oct 8, 2026
4 of 5 checks passed
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.

2 participants