parse_json
Parse JSON strings into structured data for development workflows, enabling code analysis and web scraping tasks.
Instructions
Parse JSON data
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | JSON string to parse |
Implementation Reference
- src/tools/api-discovery.ts:204-211 (handler)The handler logic for the 'parse_json' tool. It extracts the 'data' parameter, attempts to parse it as JSON using JSON.parse, and throws a descriptive error if parsing fails.case 'parse_json': { const data = params.data as string; try { return JSON.parse(data); } catch (error) { throw new Error(`Invalid JSON: ${error instanceof Error ? error.message : String(error)}`); } }
- src/tools/api-discovery.ts:90-103 (registration)Registration of the 'parse_json' tool in the apiDiscoveryTools array, including its name, description, and input schema definition.{ name: 'parse_json', description: 'Parse JSON data', inputSchema: { type: 'object', properties: { data: { type: 'string', description: 'JSON string to parse', }, }, required: ['data'], }, },
- src/tools/api-discovery.ts:93-102 (schema)Input schema for the 'parse_json' tool, specifying that it requires a 'data' string parameter.inputSchema: { type: 'object', properties: { data: { type: 'string', description: 'JSON string to parse', }, }, required: ['data'], },