Repository navigation
feat!: render style comparison locally and drop share from preview tools - #152
Open
mattpodwysocki wants to merge 3 commits into
Open
mattpodwysocki wants to merge 3 commits into
mattpodwysocki wants to merge 3 commits into
Conversation
style_comparison_tool no longer links to or frames agent.mapbox.com/tools/style-compare, as part of retiring the old Mapbox Location Agent. It returns structuredContent (before, after, accessToken, center/zoom) that the ui:// comparison panel reads directly, and auto-mints a 1-hour tk.* token instead of a permanent pk.* one. The panel picks up the hosted page's fresh=true loading and per-side style error messages. Both style_comparison_tool and preview_style_tool drop the share input; passing your own pk.* accessToken does the same thing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the hosted comparison link for sharing: each side gets a Styles API preview page URL (with the map position, if given) in both the result text and structuredContent. The text notes when the links use the 1-hour auto-generated token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
We're retiring the old Mapbox Location Agent.
style_comparison_toolwas the only part of this server that used it: it linked to and framedagent.mapbox.com/tools/style-compare. Searching the repo turns up no other uses.What changed
style_comparison_toolstructuredContent(before,after,accessToken,beforePreviewUrl,afterPreviewUrl, and optionalcenter/zoom) with a new output schema. Theui://mapbox/style-comparison/index.htmlpanel reads that payload directly instead of parsing a hosted URL.externalUrlresource,frameDomains, and the panel's "Open in browser" button.api.mapbox.com/styles/v1/{user}/{id}.html) for each style, with the map position if one was given. You can open or share them on their own, and clients without MCP Apps support get these links in the text. They work with the token you pass asaccessToken. With the auto-generated token they stop after an hour, and the result text says so.accessTokenis passed, the tool creates a 1-hourtk.*token. Before, it created a permanentpk.*token on every call, because the hosted page rejectedtk.*.?fresh=true, and a style that fails to load shows which side failed and why (404, 401 or 403). It also checks style IDs before using them and says so if GL JS fails to load. Errors after a style has loaded, such as a missing tile, no longer replace the map.StyleComparisonTool.schema.tstoStyleComparisonTool.input.schema.tsto match the repo's naming rule.preview_style_toolshare. It only checked thataccessTokenwas set, so passing your ownpk.*token does the same thing. A call that still sendssharewon't fail; the option is ignored.Breaking changes
shareis removed from both tools.style_comparison_toolno longer returns a comparison URL or an MCP-UI resource. It returns a preview link per style instead.Both are in the CHANGELOG under Unreleased.
Testing
mapboxgl. They cover map setup, waiting for both styles to load before adding the slider, which side failed, errors after a style has loaded, rejecting a bad style ID, and GL JS failing to load.npm test: 53 files, 660 tests pass.npm run build, lint and Prettier are clean. In the naming snapshot, only the two tool descriptions changed.🤖 Generated with Claude Code