-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathTestApiRequestTool.input.schema.ts
More file actions
61 lines (55 loc) · 1.58 KB
/
TestApiRequestTool.input.schema.ts
File metadata and controls
61 lines (55 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { z } from 'zod';
/**
* Input schema for TestApiRequestTool
*
* This tool makes actual HTTP requests to Mapbox APIs and optionally generates
* code snippets showing how to replicate the call in various languages.
*/
export const TestApiRequestInputSchema = z.object({
api: z
.string()
.min(1)
.describe('API name to test (e.g., "geocoding", "styles", "tokens")'),
operation: z
.string()
.min(1)
.describe(
'Operation ID to execute (e.g., "forward-geocode", "list-styles")'
),
parameters: z
.object({
path: z
.record(z.any())
.optional()
.describe(
'Path parameters (e.g., { username: "mapbox", style_id: "streets-v12" })'
),
query: z
.record(z.any())
.optional()
.describe(
'Query parameters (e.g., { limit: 10, access_token: "pk.xxx" })'
),
body: z
.record(z.any())
.optional()
.describe('Request body parameters for POST/PUT/PATCH requests')
})
.describe('API request parameters organized by type'),
generateCode: z
.boolean()
.optional()
.default(true)
.describe(
'Whether to generate code snippets showing how to replicate this API call'
),
codeLanguages: z
.array(z.enum(['curl', 'javascript', 'python']))
.optional()
.default(['curl', 'javascript', 'python'])
.describe('Programming languages to generate code examples for')
});
/**
* Inferred TypeScript type for TestApiRequestTool input
*/
export type TestApiRequestInput = z.infer<typeof TestApiRequestInputSchema>;