Skip to content

Improve style preview#11

Merged
zmofei merged 7 commits into
mainfrom
improve_style_preview
Sep 3, 2025
Merged

Improve style preview#11
zmofei merged 7 commits into
mainfrom
improve_style_preview

Conversation

@zmofei
Copy link
Copy Markdown
Member

@zmofei zmofei commented Sep 3, 2025

This pull request updates the ListStylesTool and PreviewStyleTool to improve clarity and security around token usage, especially for previewing Mapbox styles. The main changes clarify input requirements, enforce public token usage, and update related tests and documentation.

Tool input and schema improvements

  • Updated the description for ListStylesTool and its schema to recommend using the limit parameter (5-10) and clarify the use of the start parameter for pagination, improving guidance for API consumers. [1] [2] [3] [4]
  • Enhanced the PreviewStyleTool schema to require a public access token (pk.*) and provide clear instructions about token requirements and permissions.

PreviewStyleTool logic and security

  • Refactored PreviewStyleTool to accept a user-provided public token directly, removing the dependency on listing tokens internally. The tool now rejects secret (sk.*) and temporary (tk.*) tokens, ensuring only public tokens are used for preview URLs. [1] [2]

Test updates

  • Updated tests for both tools to use appropriate token formats and verify correct handling of public, secret, and temporary tokens, including error cases and parameter propagation. [1] [2] [3] [4] [5] [6] [7] [8]

Package metadata

  • Bumped the package version from 0.3.0 to 0.3.1 in both manifest.json and package.json to reflect these changes. [1] [2]

@zmofei zmofei requested a review from a team as a code owner September 3, 2025 10:12
@zmofei zmofei merged commit c938b8d into main Sep 3, 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