Skip to main content
Glama

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
NameRequiredDescriptionDefault
dataYesJSON string to parse

Implementation Reference

  • 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)}`); } }
  • 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'], }, },
  • 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'], },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/code-alchemist01/development-tools-mcp-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server