Skip to content

Commit cd11b50

Browse files
committed
add feedback tools
1 parent 4fcdee6 commit cd11b50

10 files changed

Lines changed: 66 additions & 66 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ List Mapbox access tokens for the authenticated user with optional filtering and
278278

279279
Access user feedback items from the Mapbox Feedback API. These tools allow you to retrieve and view user-reported issues, suggestions, and feedback about map data, routing, and POI details.
280280

281-
**feedback_list_tool** - List user feedback items with comprehensive filtering, sorting, and pagination options.
281+
**list_feedback_tool** - List user feedback items with comprehensive filtering, sorting, and pagination options.
282282

283283
**Parameters:**
284284

@@ -298,7 +298,7 @@ Access user feedback items from the Mapbox Feedback API. These tools allow you t
298298

299299
**Returns:** Paginated list of feedback items with pagination cursors.
300300

301-
**feedback_get_tool** - Get a single user feedback item by its unique ID.
301+
**get_feedback_tool** - Get a single user feedback item by its unique ID.
302302

303303
**Parameters:**
304304

TOOL_CONFIGURATION.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ The following tools are available in the Mapbox MCP Devkit Server:
4444

4545
### Feedback Tools
4646

47-
- `feedback_list_tool` - List user feedback items with filtering and pagination
48-
- `feedback_get_tool` - Get a single user feedback item by ID
47+
- `list_feedback_tool` - List user feedback items with filtering and pagination
48+
- `get_feedback_tool` - Get a single user feedback item by ID
4949

5050
### Geographic Tools
5151

src/tools/feedback-get-tool/FeedbackGetTool.input.schema.ts renamed to src/tools/get-feedback-tool/GetFeedbackTool.input.schema.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import { z } from 'zod';
55

66
/**
7-
* Input schema for Feedback Get Tool
7+
* Input schema for Get Feedback Tool
88
*/
9-
export const FeedbackGetInputSchema = z.object({
9+
export const GetFeedbackInputSchema = z.object({
1010
feedback_id: z
1111
.string()
1212
.uuid()
@@ -20,4 +20,4 @@ export const FeedbackGetInputSchema = z.object({
2020
)
2121
});
2222

23-
export type FeedbackGetInput = z.infer<typeof FeedbackGetInputSchema>;
23+
export type GetFeedbackInput = z.infer<typeof GetFeedbackInputSchema>;

src/tools/feedback-get-tool/FeedbackGetTool.ts renamed to src/tools/get-feedback-tool/GetFeedbackTool.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ import type { z } from 'zod';
55
import { MapboxApiBasedTool } from '../MapboxApiBasedTool.js';
66
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
77
import type { HttpRequest } from '../../utils/types.js';
8-
import { FeedbackGetInputSchema } from './FeedbackGetTool.input.schema.js';
8+
import { GetFeedbackInputSchema } from './GetFeedbackTool.input.schema.js';
99
import { FeedbackGetResponseSchema } from '../feedback.schema.js';
1010
import type { FeedbackItem } from '../feedback.schema.js';
1111

1212
// API Documentation: https://docs.mapbox.com/api/feedback/
1313

14-
export class FeedbackGetTool extends MapboxApiBasedTool<
15-
typeof FeedbackGetInputSchema
14+
export class GetFeedbackTool extends MapboxApiBasedTool<
15+
typeof GetFeedbackInputSchema
1616
> {
17-
name = 'feedback_get_tool';
17+
name = 'get_feedback_tool';
1818
description =
1919
'Get a single user feedback item from the Mapbox Feedback API by its unique ID. Use this tool to retrieve detailed information about a specific user-reported issue, suggestion, or feedback about map data, routing, or POI details. Requires user-feedback:read scope on the access token.';
2020
annotations = {
21-
title: 'Feedback Get Tool',
21+
title: 'Get Feedback Tool',
2222
readOnlyHint: true,
2323
destructiveHint: false,
2424
idempotentHint: true,
@@ -27,7 +27,7 @@ export class FeedbackGetTool extends MapboxApiBasedTool<
2727

2828
constructor(params: { httpRequest: HttpRequest }) {
2929
super({
30-
inputSchema: FeedbackGetInputSchema,
30+
inputSchema: GetFeedbackInputSchema,
3131
httpRequest: params.httpRequest
3232
});
3333
}
@@ -55,7 +55,7 @@ export class FeedbackGetTool extends MapboxApiBasedTool<
5555
}
5656

5757
protected async execute(
58-
input: z.infer<typeof FeedbackGetInputSchema>,
58+
input: z.infer<typeof GetFeedbackInputSchema>,
5959
accessToken: string
6060
): Promise<CallToolResult> {
6161
const url = new URL(

src/tools/feedback-list-tool/FeedbackListTool.input.schema.ts renamed to src/tools/list-feedback-tool/ListFeedbackTool.input.schema.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export const feedbackStatusSchema = z.enum([
2525
]);
2626

2727
/**
28-
* Input schema for Feedback List Tool
28+
* Input schema for List Feedback Tool
2929
*/
30-
export const FeedbackListInputSchema = z.object({
30+
export const ListFeedbackInputSchema = z.object({
3131
feedback_ids: z
3232
.array(z.string().uuid())
3333
.optional()
@@ -121,4 +121,4 @@ export const FeedbackListInputSchema = z.object({
121121
)
122122
});
123123

124-
export type FeedbackListInput = z.infer<typeof FeedbackListInputSchema>;
124+
export type ListFeedbackInput = z.infer<typeof ListFeedbackInputSchema>;

src/tools/feedback-list-tool/FeedbackListTool.ts renamed to src/tools/list-feedback-tool/ListFeedbackTool.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ import type { z } from 'zod';
55
import { MapboxApiBasedTool } from '../MapboxApiBasedTool.js';
66
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
77
import type { HttpRequest } from '../../utils/types.js';
8-
import { FeedbackListInputSchema } from './FeedbackListTool.input.schema.js';
8+
import { ListFeedbackInputSchema } from './ListFeedbackTool.input.schema.js';
99
import { FeedbackListResponseSchema } from '../feedback.schema.js';
1010
import type { FeedbackItem, FeedbackListResponse } from '../feedback.schema.js';
1111

1212
// API Documentation: https://docs.mapbox.com/api/feedback/
1313

14-
export class FeedbackListTool extends MapboxApiBasedTool<
15-
typeof FeedbackListInputSchema
14+
export class ListFeedbackTool extends MapboxApiBasedTool<
15+
typeof ListFeedbackInputSchema
1616
> {
17-
name = 'feedback_list_tool';
17+
name = 'list_feedback_tool';
1818
description =
1919
'List user feedback items from the Mapbox Feedback API with filtering, sorting, and pagination. Use this tool to access user-reported issues, suggestions, and feedback about map data, routing, and POI details. Supports comprehensive filtering by status, category, date ranges, trace IDs, and search text. Requires user-feedback:read scope on the access token.';
2020
annotations = {
21-
title: 'Feedback List Tool',
21+
title: 'List Feedback Tool',
2222
readOnlyHint: true,
2323
destructiveHint: false,
2424
idempotentHint: true,
@@ -27,7 +27,7 @@ export class FeedbackListTool extends MapboxApiBasedTool<
2727

2828
constructor(params: { httpRequest: HttpRequest }) {
2929
super({
30-
inputSchema: FeedbackListInputSchema,
30+
inputSchema: ListFeedbackInputSchema,
3131
httpRequest: params.httpRequest
3232
});
3333
}
@@ -90,7 +90,7 @@ export class FeedbackListTool extends MapboxApiBasedTool<
9090
* Builds URL parameters for list operation
9191
*/
9292
private buildListParams(
93-
input: z.infer<typeof FeedbackListInputSchema>,
93+
input: z.infer<typeof ListFeedbackInputSchema>,
9494
url: URL
9595
): void {
9696
// Add optional parameters
@@ -164,7 +164,7 @@ export class FeedbackListTool extends MapboxApiBasedTool<
164164
}
165165

166166
protected async execute(
167-
input: z.infer<typeof FeedbackListInputSchema>,
167+
input: z.infer<typeof ListFeedbackInputSchema>,
168168
accessToken: string
169169
): Promise<CallToolResult> {
170170
const url = new URL(

src/tools/toolRegistry.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { CoordinateConversionTool } from './coordinate-conversion-tool/Coordinat
77
import { CreateStyleTool } from './create-style-tool/CreateStyleTool.js';
88
import { CreateTokenTool } from './create-token-tool/CreateTokenTool.js';
99
import { DeleteStyleTool } from './delete-style-tool/DeleteStyleTool.js';
10-
import { FeedbackGetTool } from './feedback-get-tool/FeedbackGetTool.js';
11-
import { FeedbackListTool } from './feedback-list-tool/FeedbackListTool.js';
10+
import { GetFeedbackTool } from './get-feedback-tool/GetFeedbackTool.js';
11+
import { ListFeedbackTool } from './list-feedback-tool/ListFeedbackTool.js';
1212
import { GeojsonPreviewTool } from './geojson-preview-tool/GeojsonPreviewTool.js';
1313
import { GetMapboxDocSourceTool } from './get-mapbox-doc-source-tool/GetMapboxDocSourceTool.js';
1414
import { GetReferenceTool } from './get-reference-tool/GetReferenceTool.js';
@@ -37,8 +37,8 @@ export const ALL_TOOLS = [
3737
new BoundingBoxTool(),
3838
new CountryBoundingBoxTool(),
3939
new CoordinateConversionTool(),
40-
new FeedbackGetTool({ httpRequest }),
41-
new FeedbackListTool({ httpRequest }),
40+
new GetFeedbackTool({ httpRequest }),
41+
new ListFeedbackTool({ httpRequest }),
4242
new GetMapboxDocSourceTool({ httpRequest }),
4343
new GetReferenceTool(),
4444
new StyleComparisonTool(),

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,16 @@ exports[`Tool Naming Convention > should maintain consistent tool list (snapshot
3232
"description": "Delete a Mapbox style by ID",
3333
"toolName": "delete_style_tool",
3434
},
35-
{
36-
"className": "FeedbackGetTool",
37-
"description": "Get a single user feedback item from the Mapbox Feedback API by its unique ID. Use this tool to retrieve detailed information about a specific user-reported issue, suggestion, or feedback about map data, routing, or POI details. Requires user-feedback:read scope on the access token.",
38-
"toolName": "feedback_get_tool",
39-
},
40-
{
41-
"className": "FeedbackListTool",
42-
"description": "List user feedback items from the Mapbox Feedback API with filtering, sorting, and pagination. Use this tool to access user-reported issues, suggestions, and feedback about map data, routing, and POI details. Supports comprehensive filtering by status, category, date ranges, trace IDs, and search text. Requires user-feedback:read scope on the access token.",
43-
"toolName": "feedback_list_tool",
44-
},
4535
{
4636
"className": "GeojsonPreviewTool",
4737
"description": "Generate a geojson.io URL to visualize GeoJSON data. Returns only the URL link.",
4838
"toolName": "geojson_preview_tool",
4939
},
40+
{
41+
"className": "GetFeedbackTool",
42+
"description": "Get a single user feedback item from the Mapbox Feedback API by its unique ID. Use this tool to retrieve detailed information about a specific user-reported issue, suggestion, or feedback about map data, routing, or POI details. Requires user-feedback:read scope on the access token.",
43+
"toolName": "get_feedback_tool",
44+
},
5045
{
5146
"className": "GetMapboxDocSourceTool",
5247
"description": "Get the latest official Mapbox documentation, APIs, SDKs, and developer resources directly from Mapbox. Always up-to-date, comprehensive coverage of all current Mapbox services including mapping, navigation, search, geocoding, and mobile SDKs. Use this for accurate, official Mapbox information instead of web search.",
@@ -57,6 +52,11 @@ exports[`Tool Naming Convention > should maintain consistent tool list (snapshot
5752
"description": "Get Mapbox reference documentation including Streets v8 field definitions, token scopes, layer type mappings, and style specifications. Use this tool to understand what fields, scopes, or layer types are available before creating styles or tokens.",
5853
"toolName": "get_reference_tool",
5954
},
55+
{
56+
"className": "ListFeedbackTool",
57+
"description": "List user feedback items from the Mapbox Feedback API with filtering, sorting, and pagination. Use this tool to access user-reported issues, suggestions, and feedback about map data, routing, and POI details. Supports comprehensive filtering by status, category, date ranges, trace IDs, and search text. Requires user-feedback:read scope on the access token.",
58+
"toolName": "list_feedback_tool",
59+
},
6060
{
6161
"className": "ListStylesTool",
6262
"description": "List styles for a Mapbox account. Use limit parameter to avoid large responses (recommended: limit=5-10). Use start parameter for pagination.",

test/tools/feedback-get-tool/FeedbackGetTool.test.ts renamed to test/tools/get-feedback-tool/GetFeedbackTool.test.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import {
66
setupHttpRequest,
77
assertHeadersSent
88
} from '../../utils/httpPipelineUtils.js';
9-
import { FeedbackGetTool } from '../../../src/tools/feedback-get-tool/FeedbackGetTool.js';
9+
import { GetFeedbackTool } from '../../../src/tools/get-feedback-tool/GetFeedbackTool.js';
1010

1111
const mockToken = 'sk.eyJ1IjoidGVzdC11c2VyIiwiYSI6InRlc3QtYXBpIn0.signature';
1212

1313
beforeAll(() => {
1414
process.env.MAPBOX_ACCESS_TOKEN = mockToken;
1515
});
1616

17-
describe('FeedbackGetTool', () => {
17+
describe('GetFeedbackTool', () => {
1818
afterEach(() => {
1919
vi.restoreAllMocks();
2020
});
@@ -37,8 +37,8 @@ describe('FeedbackGetTool', () => {
3737
updated_at: '2025-07-28T14:10:30.123Z'
3838
})
3939
});
40-
const tool = new FeedbackGetTool({ httpRequest });
41-
expect(tool.name).toBe('feedback_get_tool');
40+
const tool = new GetFeedbackTool({ httpRequest });
41+
expect(tool.name).toBe('get_feedback_tool');
4242
expect(tool.description).toContain('Get a single user feedback item');
4343
});
4444
});
@@ -62,7 +62,7 @@ describe('FeedbackGetTool', () => {
6262
})
6363
});
6464

65-
await new FeedbackGetTool({ httpRequest }).run({
65+
await new GetFeedbackTool({ httpRequest }).run({
6666
feedback_id: feedbackId
6767
});
6868

@@ -88,7 +88,7 @@ describe('FeedbackGetTool', () => {
8888
})
8989
});
9090

91-
await new FeedbackGetTool({ httpRequest }).run({
91+
await new GetFeedbackTool({ httpRequest }).run({
9292
feedback_id: feedbackId
9393
});
9494

@@ -119,7 +119,7 @@ describe('FeedbackGetTool', () => {
119119
json: async () => mockItem
120120
});
121121

122-
const result = await new FeedbackGetTool({ httpRequest }).run({
122+
const result = await new GetFeedbackTool({ httpRequest }).run({
123123
feedback_id: mockItem.id
124124
});
125125

@@ -152,7 +152,7 @@ describe('FeedbackGetTool', () => {
152152
json: async () => mockItem
153153
});
154154

155-
const result = await new FeedbackGetTool({ httpRequest }).run({
155+
const result = await new GetFeedbackTool({ httpRequest }).run({
156156
feedback_id: mockItem.id,
157157
format: 'json_string'
158158
});
@@ -170,7 +170,7 @@ describe('FeedbackGetTool', () => {
170170
statusText: 'Not Found'
171171
});
172172

173-
const result = await new FeedbackGetTool({ httpRequest }).run({
173+
const result = await new GetFeedbackTool({ httpRequest }).run({
174174
feedback_id: '40eae4c7-b157-4b49-a091-7e1099bba77e'
175175
});
176176

@@ -195,7 +195,7 @@ describe('FeedbackGetTool', () => {
195195
})
196196
});
197197

198-
const result = await new FeedbackGetTool({ httpRequest }).run({
198+
const result = await new GetFeedbackTool({ httpRequest }).run({
199199
feedback_id: '40eae4c7-b157-4b49-a091-7e1099bba77e'
200200
});
201201

@@ -216,7 +216,7 @@ describe('FeedbackGetTool', () => {
216216
})
217217
});
218218

219-
const result = await new FeedbackGetTool({ httpRequest }).run({
219+
const result = await new GetFeedbackTool({ httpRequest }).run({
220220
feedback_id: '40eae4c7-b157-4b49-a091-7e1099bba77e'
221221
});
222222

@@ -235,7 +235,7 @@ describe('FeedbackGetTool', () => {
235235
it('validates feedback_id format', async () => {
236236
const { httpRequest } = setupHttpRequest();
237237

238-
const tool = new FeedbackGetTool({ httpRequest });
238+
const tool = new GetFeedbackTool({ httpRequest });
239239

240240
// Invalid UUID format
241241
const result = await tool.run({
@@ -249,7 +249,7 @@ describe('FeedbackGetTool', () => {
249249
it('requires feedback_id', async () => {
250250
const { httpRequest } = setupHttpRequest();
251251

252-
const tool = new FeedbackGetTool({ httpRequest });
252+
const tool = new GetFeedbackTool({ httpRequest });
253253

254254
// Missing feedback_id
255255
const result = await tool.run({});

0 commit comments

Comments
 (0)