Skip to content

Commit e904873

Browse files
committed
fix: geojson_preview_tool uses geojson.io root URL instead of dead /next/ path
1 parent c118e6d commit e904873

4 files changed

Lines changed: 21 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
- **GeoJSON Preview UI resource** now mints its short-lived Mapbox GL token per request instead of reusing a process-wide cached one, and verifies the minted token belongs to the requesting account before embedding it.
66

7+
### Fixed
8+
9+
- **geojson_preview_tool**: Generate `https://geojson.io/?data=...` instead of `https://geojson.io/next/?data=...`. The `/next/` path now returns 404, so the previewed link no longer opened a broken page. The `?data=` query-param format is unchanged.
10+
711
## 0.8.0 - 2026-05-05
812

913
## 0.7.5 - 2026-05-05

src/tools/geojson-preview-tool/GeojsonPreviewTool.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
export class GeojsonPreviewTool extends BaseTool<typeof GeojsonPreviewSchema> {
1515
name = 'geojson_preview_tool';
1616
description =
17-
'Generate a geojson.io/next URL to visualize GeoJSON data. Returns only the URL link.';
17+
'Generate a geojson.io URL to visualize GeoJSON data. Returns only the URL link.';
1818
readonly annotations = {
1919
readOnlyHint: true,
2020
destructiveHint: false,
@@ -78,13 +78,13 @@ export class GeojsonPreviewTool extends BaseTool<typeof GeojsonPreviewSchema> {
7878
};
7979
}
8080

81-
// Generate geojson.io/next URL
82-
// Note: geojson.io/next uses query params (?data=) not hash params (#data=)
81+
// Generate geojson.io URL
82+
// Note: geojson.io uses query params (?data=) not hash params (#data=)
8383
const geojsonString = JSON.stringify(geojsonData);
8484
const encodedGeoJSON = encodeURIComponent(geojsonString);
85-
const geojsonIOUrl = `https://geojson.io/next/?data=data:application/json,${encodedGeoJSON}`;
85+
const geojsonIOUrl = `https://geojson.io/?data=data:application/json,${encodedGeoJSON}`;
8686

87-
// Use geojson.io/next as the display URL
87+
// Use geojson.io as the display URL
8888
const displayUrl = geojsonIOUrl;
8989

9090
// Build content array with URL

test/tools/__snapshots__/tool-naming-convention.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ exports[`Tool Naming Convention > should maintain consistent tool list (snapshot
4444
},
4545
{
4646
"className": "GeojsonPreviewTool",
47-
"description": "Generate a geojson.io/next URL to visualize GeoJSON data. Returns only the URL link.",
47+
"description": "Generate a geojson.io URL to visualize GeoJSON data. Returns only the URL link.",
4848
"toolName": "geojson_preview_tool",
4949
},
5050
{

test/tools/geojson-preview-tool/GeojsonPreviewTool.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('GeojsonPreviewTool', () => {
1414
const tool = new GeojsonPreviewTool();
1515
expect(tool.name).toBe('geojson_preview_tool');
1616
expect(tool.description).toBe(
17-
'Generate a geojson.io/next URL to visualize GeoJSON data. Returns only the URL link.'
17+
'Generate a geojson.io URL to visualize GeoJSON data. Returns only the URL link.'
1818
);
1919
});
2020

@@ -39,8 +39,8 @@ describe('GeojsonPreviewTool', () => {
3939
expect(result.content[0].type).toBe('text');
4040
const content = result.content[0];
4141
if (content.type === 'text') {
42-
// Should return geojson.io/next URL with query param format
43-
expect(content.text).toMatch(/^https:\/\/geojson\.io\/next\/\?data=/);
42+
// Should return geojson.io URL with query param format
43+
expect(content.text).toMatch(/^https:\/\/geojson\.io\/\?data=/);
4444
}
4545

4646
// Verify MCP-UI resource is included by default
@@ -53,9 +53,9 @@ describe('GeojsonPreviewTool', () => {
5353
}
5454
});
5555

56-
// Verify the iframe URL is geojson.io/next with query param
56+
// Verify the iframe URL is geojson.io with query param
5757
const iframeUrl = (result.content[1] as any).resource.text;
58-
expect(iframeUrl).toMatch(/^https:\/\/geojson\.io\/next\/\?data=/);
58+
expect(iframeUrl).toMatch(/^https:\/\/geojson\.io\/\?data=/);
5959
});
6060

6161
it('returns URL and MCP-UI resource for backward compatibility', async () => {
@@ -94,8 +94,8 @@ describe('GeojsonPreviewTool', () => {
9494
expect(result.content).toHaveLength(2);
9595
const content = result.content[0];
9696
if (content.type === 'text') {
97-
// Should return geojson.io/next URL with query param
98-
expect(content.text).toMatch(/^https:\/\/geojson\.io\/next\/\?data=/);
97+
// Should return geojson.io URL with query param
98+
expect(content.text).toMatch(/^https:\/\/geojson\.io\/\?data=/);
9999
}
100100
});
101101

@@ -132,8 +132,8 @@ describe('GeojsonPreviewTool', () => {
132132
expect(result.content).toHaveLength(2);
133133
const content = result.content[0];
134134
if (content.type === 'text') {
135-
// Should return geojson.io/next URL with query param
136-
expect(content.text).toMatch(/^https:\/\/geojson\.io\/next\/\?data=/);
135+
// Should return geojson.io URL with query param
136+
expect(content.text).toMatch(/^https:\/\/geojson\.io\/\?data=/);
137137
}
138138
});
139139

@@ -185,8 +185,8 @@ describe('GeojsonPreviewTool', () => {
185185
expect(result.content).toHaveLength(2);
186186
const content = result.content[0];
187187
if (content.type === 'text') {
188-
// Should return geojson.io/next URL with query param
189-
expect(content.text).toMatch(/^https:\/\/geojson\.io\/next\/\?data=/);
188+
// Should return geojson.io URL with query param
189+
expect(content.text).toMatch(/^https:\/\/geojson\.io\/\?data=/);
190190
}
191191
});
192192
});

0 commit comments

Comments
 (0)