Skip to main content
Glama

JSON MCP Server

json_filter

Extract and filter specific fields from JSON data using a shape object. Define desired fields for extraction, including nested structures, to reduce file size and streamline data processing. Supports local files or HTTP/HTTPS URLs.

Instructions

Filter JSON data using a shape object to extract only the fields you want. Provide filePath (local file or HTTP/HTTPS URL) and shape parameters.

Input Schema

NameRequiredDescriptionDefault
chunkIndexNoIndex of chunk to retrieve (0-based). If filtered data exceeds 400KB, it will be automatically chunked. Defaults to 0 if not specified.
filePathYesPath to the JSON file (local) or HTTP/HTTPS URL to filter
shapeNoShape object (formatted as valid JSON) defining what fields to extract. Use 'true' to include a field, or nested objects for deep extraction. Examples: 1. Extract single field: {"type": true} 2. Extract multiple fields: {"type": true, "version": true, "source": true} 3. Extract nested fields: {"appState": {"gridSize": true, "viewBackgroundColor": true}} 4. Extract from arrays: {"elements": {"type": true, "x": true, "y": true}} - applies to each array item 5. Complex nested extraction: { "type": true, "version": true, "appState": { "gridSize": true, "viewBackgroundColor": true }, "elements": { "type": true, "text": true, "x": true, "y": true, "boundElements": { "type": true, "id": true } } } Note: - Arrays are automatically handled - the shape is applied to each item in the array. - Use json_schema tool to analyse the JSON file schema before using this tool. - Use json_dry_run tool to get a size breakdown of your desired json shape before using this tool.

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "chunkIndex": { "description": "Index of chunk to retrieve (0-based). If filtered data exceeds 400KB, it will be automatically chunked. Defaults to 0 if not specified.", "type": "number" }, "filePath": { "description": "Path to the JSON file (local) or HTTP/HTTPS URL to filter", "type": "string" }, "shape": { "description": "Shape object (formatted as valid JSON) defining what fields to extract. Use 'true' to include a field, or nested objects for deep extraction.\n\nExamples:\n1. Extract single field: {\"type\": true}\n2. Extract multiple fields: {\"type\": true, \"version\": true, \"source\": true}\n3. Extract nested fields: {\"appState\": {\"gridSize\": true, \"viewBackgroundColor\": true}}\n4. Extract from arrays: {\"elements\": {\"type\": true, \"x\": true, \"y\": true}} - applies to each array item\n5. Complex nested extraction: {\n \"type\": true,\n \"version\": true,\n \"appState\": {\n \"gridSize\": true,\n \"viewBackgroundColor\": true\n },\n \"elements\": {\n \"type\": true,\n \"text\": true,\n \"x\": true,\n \"y\": true,\n \"boundElements\": {\n \"type\": true,\n \"id\": true\n }\n }\n}\n\nNote: \n- Arrays are automatically handled - the shape is applied to each item in the array.\n- Use json_schema tool to analyse the JSON file schema before using this tool.\n- Use json_dry_run tool to get a size breakdown of your desired json shape before using this tool.\n" } }, "required": [ "filePath" ], "type": "object" }
Install Server

Other Tools from JSON MCP Server

Related Tools

    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/kehvinbehvin/json-mcp'

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