Skip to main content
Glama

validator_validate_json

Validate JSON strings and verify required keys exist. Returns validity status, parsed data, type, and error reason.

Instructions

[validator] Validate a JSON string. Returns {valid: bool, parsed: any, type: str, reason: str}. Optionally check that specific keys exist.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYes
required_keysNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Discloses return object structure (valid, parsed, type, reason) and optional key checking, providing useful behavioral context beyond the schema, though no side-effects or authorization needs are mentioned (which is acceptable for a read-only validator).

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?

Single sentence front-loads the purpose, with no wasted words; includes return type and optional feature efficiently.

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 simplicity of the tool and the presence of an output schema (implied by return description), the description covers the essential behavior, parameter intent, and return format, leaving minor gaps like error handling or performance notes.

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?

With 0% schema description coverage, the description partially compensates by mentioning 'validate a JSON string' (value) and 'check specific keys' (required_keys), but does not explicitly name parameters or describe their formats, so it adds some but not full meaning.

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?

Clearly states the tool validates a JSON string and optionally checks required keys, with a distinct verb and resource that differentiates it from sibling validators (e.g., validate_email, validate_ip).

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?

Implicitly suggests use when needing JSON validation or key existence checks, but lacks explicit when-to-use/when-not-to-use or comparisons with other validators like validate_type.

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/0-co/agent-friend'

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