Skip to content

Conversation

@zmofei
Copy link
Member

@zmofei zmofei commented Sep 25, 2025

This pull request introduces a new standardized annotations property to all tool classes in the codebase, providing structured metadata about each tool's behavior (such as whether it is read-only, destructive, idempotent, etc.). Additionally, the BaseTool and related registration logic are updated to require and propagate these annotations. There are also minor updates to the development workflow in package.json.

Tool metadata standardization:

  • Added a required annotations property (of type ToolAnnotations) to the BaseTool class and all tool implementations, describing each tool's characteristics (e.g., read-only, destructive, idempotent, open-world, and a human-friendly title). (src/tools/BaseTool.ts, src/tools/bounding-box-tool/BoundingBoxTool.ts, src/tools/bounding-box-tool/CountryBoundingBoxTool.ts, src/tools/coordinate-conversion-tool/CoordinateConversionTool.ts, src/tools/create-style-tool/CreateStyleTool.ts, src/tools/create-token-tool/CreateTokenTool.ts, src/tools/delete-style-tool/DeleteStyleTool.ts, src/tools/geojson-preview-tool/GeojsonPreviewTool.ts, src/tools/get-mapbox-doc-source-tool/GetMapboxDocSourceTool.ts, src/tools/list-styles-tool/ListStylesTool.ts, src/tools/list-tokens-tool/ListTokensTool.ts, src/tools/preview-style-tool/PreviewStyleTool.ts, src/tools/retrieve-style-tool/RetrieveStyleTool.ts, src/tools/style-builder-tool/StyleBuilderTool.ts, src/tools/style-comparison-tool/StyleComparisonTool.ts, src/tools/tilequery-tool/TilequeryTool.ts, src/tools/update-style-tool/UpdateStyleTool.ts) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]

  • Updated the BaseTool.installTo method to use server.registerTool and pass the new annotations property as part of tool registration, ensuring this metadata is available at runtime.

Development workflow improvements:

  • Added a new dev:inspect script to package.json for easier debugging with the inspector, and bumped the package version to 0.4.1. [1] [2]

Dependency and import updates:

  • Imported ToolAnnotations type from the SDK in BaseTool.ts to support the new annotations property.

@zmofei zmofei marked this pull request as ready for review September 25, 2025 13:59
@zmofei zmofei requested a review from a team as a code owner September 25, 2025 13:59
@zmofei zmofei merged commit fd6a14e into main Sep 30, 2025
1 check 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