Skip to content

refactor: remove point_in_polygon_tool in favor of points_within_polygon_tool#181

Merged
mattpodwysocki merged 23 commits intomainfrom
refactor/remove-point-in-polygon-tool
Apr 14, 2026
Merged

refactor: remove point_in_polygon_tool in favor of points_within_polygon_tool#181
mattpodwysocki merged 23 commits intomainfrom
refactor/remove-point-in-polygon-tool

Conversation

@mattpodwysocki
Copy link
Copy Markdown
Contributor

@mattpodwysocki mattpodwysocki commented Apr 14, 2026

Summary

points_within_polygon_tool fully covers the single-point case — pass a one-element points array and the result is equivalent. Having two tools for the same concept creates unnecessary ambiguity for the model when choosing between them.

Why remove point_in_polygon_tool?

Pros of removing:

  • Eliminates model confusion — when two tools do the same thing, LLMs may pick the wrong one or hallucinate differences that don't exist
  • Reduces tool count, which directly shrinks the context window overhead on every request
  • Single responsibility: points_within_polygon_tool already handles both single and batch cases cleanly
  • Simpler API surface for consumers of @mapbox/mcp-server/tools

Cons / risks:

  • Breaking change for anyone calling point_in_polygon_tool by name or importing PointInPolygonTool — migration is mechanical but required
  • Single-point callers now pass a one-element array instead of a bare point object (minor ergonomic shift)

The trade-off strongly favors removal: the single-point case is already idiomatic in the batch API, the migration path is trivial, and the benefit of a cleaner, unambiguous tool surface is significant.

Changes:

  • Delete PointInPolygonTool and all associated files (input schema, output schema, tests)
  • Remove pointInPolygon pre-configured instance from the @mapbox/mcp-server/tools barrel
  • Update points_within_polygon_tool description to make clear it handles single points as well as batches
  • Remove stale point_in_polygon_tool and version_tool entries from annotations.test.ts (both no longer exist in the registry — dead code)

Migration: Replace any use of point_in_polygon_tool with points_within_polygon_tool using a single-element points array:

{ "points": [{ "longitude": -122.4, "latitude": 37.8 }], "polygon": [...] }

Test plan

  • npm test — 706 tests pass (719 − 13 removed point_in_polygon tests)
  • CI green

🤖 Generated with Claude Code

mattpodwysocki and others added 20 commits January 12, 2026 16:18
Implements MCP server icons at the correct architectural level (server
initialization) instead of at the tool level. Adds both light and dark
theme variants of the Mapbox logo using base64-encoded SVG data URIs.

- Add mapbox-logo-black.svg for light theme backgrounds
- Add mapbox-logo-white.svg for dark theme backgrounds
- Update server initialization to include icons array with theme property
- Use 800x180 SVG logos embedded as base64 data URIs

This replaces the previous incorrect approach of adding icons to
individual tools, which was not aligned with the MCP specification.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updates the MCP SDK from 1.25.1 to 1.25.2 and recreates the output
validation patch for the new version. The patch continues to convert
strict output schema validation errors to warnings, allowing tools
to gracefully handle schema mismatches.

Changes:
- Update @modelcontextprotocol/sdk from ^1.25.1 to ^1.25.2
- Recreate SDK patch for version 1.25.2
- Remove obsolete 1.25.1 patch file
- All 397 tests pass with new SDK version

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gon_tool

points_within_polygon_tool fully covers the single-point case by passing
a one-element points array. Having two tools for the same concept creates
unnecessary model confusion when choosing between them.

- Remove PointInPolygonTool and all associated files
- Remove pointInPolygon pre-configured instance from tools barrel
- Update points_within_polygon_tool description to make clear it handles
  single points as well as batches
- Remove point_in_polygon_tool references from annotations test

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 15:01
version_tool was removed in 0.11.0 in favor of the mapbox://version
resource. These entries in the offline tools arrays were dead code —
filtering nothing — since the tool no longer exists in the registry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Valiunia
Copy link
Copy Markdown
Contributor

point_in_polygon_tool is still referenced in mapbox/mcp-server/examples/search-along-route.md

mattpodwysocki and others added 2 commits April 14, 2026 13:36
Replaces stale point_in_polygon_tool reference flagged in PR review.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mattpodwysocki
Copy link
Copy Markdown
Contributor Author

Fixed in 7d05433 — replaced point_in_polygon_tool with points_within_polygon_tool in examples/search-along-route.md. Thanks for catching it!

@mattpodwysocki mattpodwysocki merged commit 85eb71d into main Apr 14, 2026
5 checks passed
@mattpodwysocki mattpodwysocki deleted the refactor/remove-point-in-polygon-tool branch April 14, 2026 18:40
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