Skip to main content
Glama
mgraczyk

JSON Query MCP

by mgraczyk

JSON Query MCP

A Model Context Protocol (MCP) server for querying large JSON files. This server provides tools for working with large JSON data that can be used by LLM models implementing the Model Context Protocol.

Features

  • Query JSON files using JSONPath expressions

  • Search for keys similar to a query string

  • Search for values similar to a query string

Related MCP server: JSON MCP Server

Example

Here is an example of the Cursor Agent using the tool to read a a very large (>1M character) JSON Swagger definition, and extracting a small portion to write a typescript interface.

Example

Usage

npx json-query-mcp

Installation in Cursor

Add the following to your cursor mcp json (on macOS this is /Users/$USER/.cursor/mcp.json)

{
  "mcpServers": {
    ... other mcp servers
    "json-query": {
      "command": "npx",
      "args": [<local path to this repo>],
    },
  }
}

Development

# Run in development mode
npm run dev

# Run tests
npm test

# Format code
npm run format

# Lint code
npm run lint

# Fix lints
npm run fix

License

MIT

Available Tools

3 tools
json_query_jsonpathB

Query a JSON file using JSONPath. Use to get values precisely from large JSON files.

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the JSON file.
jsonpathYesJSONPath expression to evaluate

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions the tool 'gets values' (read operation) and works on 'large JSON files,' but lacks details on error handling (e.g., invalid paths, file not found), performance considerations, or output format. For a tool with no annotations, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences with zero waste. It's front-loaded with the core purpose and follows with a usage hint. Every word earns its place, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., matched values, errors), how results are structured, or any limitations (e.g., JSONPath support level). For a query tool with two parameters, this leaves too much unspecified for reliable use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters (file_path, jsonpath) adequately. The description adds no additional parameter semantics beyond what's in the schema (e.g., no examples of JSONPath expressions or file path constraints). Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Query a JSON file using JSONPath' specifies the verb (query) and resource (JSON file). It distinguishes from siblings by mentioning 'JSONPath' (vs. search_keys/search_values) but doesn't explicitly contrast them. The purpose is specific and actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage context: 'Use to get values precisely from large JSON files' implies when to use it (for precise extraction from large files). However, it doesn't explicitly state when to choose this tool over siblings (json_query_search_keys, json_query_search_values) or any exclusions. The guidance is implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

json_query_search_keysA

Search for keys in a JSON file. Use when you do not know the path to a key in a large JSON file, but have some idea what the key is.

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the JSON file.
limitNoMaximum number of results to return (default: 5)
queryYesSearch term for finding matching keys

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool searches for keys in large JSON files, which implies read-only behavior, but doesn't specify whether it's safe (e.g., non-destructive), what permissions are needed, or how results are returned (e.g., format, pagination). For a tool with zero annotation coverage, this leaves significant gaps in understanding its operational traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: it states the core purpose in the first sentence and adds usage context in the second. Every sentence earns its place by clarifying when to use the tool, with no wasted words or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers purpose and usage well, but lacks details on behavioral aspects (e.g., safety, permissions) and output format. Without annotations or output schema, more context would help agents understand the full operational scope.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the input schema already documents all parameters (file_path, limit, query) with descriptions. The description adds minimal value beyond the schema by implying the search is for keys in large files, but doesn't provide additional syntax, format details, or constraints. This meets the baseline of 3 when schema coverage is high.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Search for keys in a JSON file.' It specifies the verb ('search'), resource ('keys in a JSON file'), and context ('when you do not know the path'). However, it doesn't explicitly distinguish this from sibling tools like 'json_query_search_values' (which searches values rather than keys), leaving some ambiguity about sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool: 'Use when you do not know the path to a key in a large JSON file, but have some idea what the key is.' This gives practical guidance on the scenario it addresses. However, it doesn't mention when not to use it or explicitly name alternatives (e.g., 'json_query_jsonpath' for known paths), so it lacks full exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

json_query_search_valuesA

Search for values in a JSON file. Use when you do not know the path to a value in a large JSON file, but have some idea what the value is.

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the JSON file.
limitNoMaximum number of results to return (default: 5)
queryYesSearch term for finding matching values

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions searching in 'a large JSON file' and returning results based on a query, but it lacks details on how the search works (e.g., case-sensitivity, partial matches), what the output format is, or any performance considerations like rate limits. This leaves significant gaps for an agent to understand the tool's behavior fully.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences that are front-loaded and efficient. The first sentence states the purpose, and the second provides usage guidelines, with no wasted words. It's appropriately sized for the tool's complexity and easy for an agent to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no annotations and no output schema, the description is incomplete. It covers the basic purpose and usage but lacks details on behavioral traits, output format, and error handling. For a search tool with three parameters, this leaves the agent with insufficient context to use it effectively beyond the basics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so the schema already documents all parameters (file_path, limit, query) well. The description adds minimal value by implying the query is for 'matching values' and the file is 'large,' but it doesn't provide additional syntax or format details beyond what the schema offers. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Search for values in a JSON file.' It specifies the verb 'search' and resource 'values in a JSON file,' and distinguishes it from siblings by noting it's for when 'you do not know the path to a value.' However, it doesn't explicitly name the sibling tools or detail how they differ in functionality, keeping it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on when to use this tool: 'Use when you do not know the path to a value in a large JSON file, but have some idea what the value is.' This gives a specific scenario and implies alternatives (like path-based queries), but it doesn't explicitly name the sibling tools or state when not to use it, which prevents a score of 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv1.0.0
    • First observedjson_query_jsonpath
    • First observedjson_query_search_keys
    • First observedjson_query_search_values

TDQS

A3.7/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: json_query_jsonpath targets precise path-based queries, json_query_search_keys focuses on key discovery, and json_query_search_values handles value discovery. There is no overlap in functionality, making it easy for an agent to select the correct tool based on the query need.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with 'json_query_' as a prefix, followed by specific descriptors (jsonpath, search_keys, search_values). This uniformity enhances readability and predictability across the tool set.

Tool Count4/5

With 3 tools, the server is well-scoped for JSON querying, covering path-based queries, key searches, and value searches. However, it might be slightly thin if more advanced operations like filtering or transformation are expected, but it reasonably covers core query needs.

Completeness4/5

The tools provide comprehensive coverage for querying JSON files, including precise path queries and exploratory searches for keys and values. A minor gap exists in lacking tools for JSON manipulation (e.g., update or delete), but this is acceptable given the server's focus on querying rather than editing.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

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

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