Skip to main content
Glama

validate_json

Validate JSON string syntax and optionally check compliance with a provided JSON Schema.

Instructions

Validate JSON string syntax and optionally against a JSON Schema.

Parameters:
    json_str — JSON string to validate.
    schema — Optional JSON Schema to validate against.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
json_strYes
schemaNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/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 discloses the core behavior (validation) but does not mention side effects (none expected), return format (covered by output schema), or error handling (e.g., exception on invalid JSON). The output schema partially compensates, but the description could add more behavioral context.

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

Conciseness4/5

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

The description is short (two sentences plus parameter list) and front-loaded with the main purpose. It avoids unnecessary detail, but the parameter list could be integrated more smoothly. Overall, it's efficient but not maximally concise.

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

Completeness4/5

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

Given the presence of an output schema, the description need not explain return values. It covers the essential input semantics and purpose. However, for a validation tool, mentioning that it returns validation errors or success could aid understanding. Still, it is reasonably complete for its simplicity.

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

Parameters4/5

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

Schema description coverage is 0%, so the description is essential. It adds one-line explanations for both parameters: 'json_str — JSON string to validate' and 'schema — Optional JSON Schema to validate against.' This provides clarity beyond the bare schema, though it doesn't elaborate on acceptable formats or constraints.

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

Purpose5/5

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

The description clearly states the tool validates JSON syntax and optionally against a JSON Schema. It uses specific verbs ('validate') and resources ('JSON string'), and it distinguishes itself from sibling tools by being the only JSON validation tool in the list.

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 implies two use cases: syntax-only validation (without schema) and full validation (with schema). However, it lacks explicit guidance on when to prefer this tool over alternatives, though no direct sibling competes. The 'optionally' keyword gives a clue but no definitive when-to-use or when-not-to-use.

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

Install Server

Other Tools

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/scotia1973-bot/api-hub'

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