json-sanity
Server Details
Deterministic JSON repair for LLM agents. Strips prose preambles, fixes malformed control characters, repairs truncated structures, and validates against JSON Schema — no LLM calls, no retries. Stops session poisoning in long-running agents.
- Status
- Healthy
- Last Tested
- Transport
- Streamable HTTP
- URL
Glama MCP Gateway
Connect through Glama MCP Gateway for full control over tool access and complete visibility into every call.
Full call logging
Every tool call is logged with complete inputs and outputs, so you can debug issues and audit what your agents are doing.
Tool access control
Enable or disable individual tools per connector, so you decide what your agents can and cannot do.
Managed credentials
Glama handles OAuth flows, token storage, and automatic rotation, so credentials never expire on your clients.
Usage analytics
See which tools your agents call, how often, and when, so you can understand usage patterns and catch anomalies.
Tool Definition Quality
Average 3.9/5 across 4 of 4 tools scored.
Tools have distinct purposes but repair_json and repair_string overlap somewhat. Descriptions clarify differences, but an agent might still hesitate between them.
All tools follow a consistent verb_noun pattern with underscore separators: repair_json, repair_string, sanitize_json_output, validate_json.
4 tools is well-scoped for a focused JSON sanity server, covering repair, sanitization, and validation without bloat.
Core operations are covered, but a pretty-print or formatting tool is missing, which would be useful for display purposes.
Available Tools
4 toolsrepair_jsonARead-onlyIdempotentInspect
Attempt to repair common JSON issues: trailing commas, single quotes, unquoted keys, Python/JS literals, truncated structures.
| Name | Required | Description | Default |
|---|---|---|---|
| api_key_id | No | Your Stripe Customer ID, used for metered billing ($1.00/mo base includes first 100 requests; $0.01 each after). | |
| json_string | Yes | The malformed JSON text to repair. |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already provide safety profile (read-only, idempotent, non-destructive). Description adds value by listing specific repairs attempted, but fails to disclose behavior on failure (e.g., returns original or error).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One sentence, 16 words, front-loaded, zero wasted words. Efficiently communicates tool's purpose and scope.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Missing crucial details about output format and failure handling. Agent cannot know if tool returns repaired JSON or original on failure, or if it provides error messages.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% for both parameters, so description adds no new meaning beyond what schema provides, meeting baseline expectation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool repairs common JSON issues, listing specific problems like trailing commas and single quotes. It distinguishes itself from siblings like validate_json by focusing on repair rather than validation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives like repair_string or validate_json. Does not specify prerequisites or conditions for use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
repair_stringARead-onlyIdempotentInspect
Deterministic repair engine. Given a raw LLM output that should contain JSON, this tool: (1) strips markdown code fences (```json), (2) regex-strips prose preambles/suffixes, (3) escapes unescaped control characters inside string values, (4) validates with json.loads — falling back to structural repairs and partial-recovery bracket closing when needed, and (5) optionally validates the repaired JSON against a JSON schema.
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | Optional JSON schema. When provided, the repaired JSON is validated against it. Validation errors are translated into a list of actionable 'Fix Action' strings. | |
| api_key_id | No | Your Stripe Customer ID, used for metered billing ($1.00/mo base includes first 100 requests; $0.01 each after). | |
| raw_string | Yes | Raw text that should contain JSON. |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate read-only, idempotent, non-destructive. Description adds detailed steps (stripping fences, escaping characters, schema validation) that augment the behavioral profile. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single paragraph with numbered steps, front-loaded with core purpose. Every sentence adds information; no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers all steps and the optional schema validation outcome. Missing explicit return format but is inferable. For a tool with no output schema, this is well-rounded.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%. Description adds helpful context for api_key_id (metered billing) and explains the optional schema validation role, adding value beyond schema definitions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly identifies it as a deterministic repair engine for LLM outputs containing JSON, listing five specific steps. It distinguishes from siblings like repair_json and validate_json by being more comprehensive (repair + validate).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the use case (raw LLM output with malformed JSON) but does not explicitly state when to use over sibling tools or when not to use. Lacks comparative guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanitize_json_outputARead-onlyIdempotentInspect
Use this tool before saving any JSON data to session history or state files to prevent JSONDecodeErrors and session poisoning. It removes prose preambles and repairs malformed control characters.
| Name | Required | Description | Default |
|---|---|---|---|
| api_key_id | No | Your API key identifier, used to attribute crash-prevention metrics to your account. | |
| raw_string | Yes | Raw string that should contain JSON, possibly with prose or control character issues. |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations (readOnlyHint=true, idempotentHint=true, destructiveHint=false) already convey safety; description adds specific behaviors: removal of prose and repair of control characters. No contradictions. Could elaborate on edge cases (e.g., non-JSON input), but sufficient for typical use.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with purpose and usage context, then specific behavior. Every word contributes value; no redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple input (raw string, no nested objects) and lack of output schema, description adequately covers purpose, timing, and behavior. Could mention output format (cleaned JSON string) for completeness, but annotations and sibling tools provide enough context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% with detailed parameter descriptions (api_key_id and raw_string). Description adds context for the transformation but doesn't significantly enhance parameter understanding beyond the schema. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool sanitizes JSON output to prevent errors, with specific actions: removing prose preambles and repairing control characters. Differentiates from sibling tools like repair_json and validate_json by context (saving to session history/state files).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use ('before saving any JSON data to session history or state files') and why (prevent JSONDecodeErrors and session poisoning). Lacks explicit when-not-to-use or alternative tools, but context is clear and actionable.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
validate_jsonARead-onlyIdempotentInspect
Check whether a JSON string is valid. Returns parsed object on success.
| Name | Required | Description | Default |
|---|---|---|---|
| api_key_id | No | Your Stripe Customer ID, used for metered billing ($1.00/mo base includes first 100 requests; $0.01 each after). | |
| json_string | Yes | The JSON text to validate. |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate read-only, idempotent, non-destructive behavior. The description adds return value info but does not specify error behavior (e.g., what happens on invalid JSON). This is acceptable but minimal.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that front-loads the core purpose and return value. No wasted words; every part is informative.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple validation tool, the description is mostly complete. It states purpose and return value. However, it does not explain the role of api_key_id (even if schema does) or handle failure cases, which are minor gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema has 100% coverage, so description adds no extra meaning. The schema already describes both parameters adequately. Baseline score of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool checks JSON string validity and returns a parsed object on success. This differentiates it from sibling tools like repair_json that fix invalid JSON.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool instead of sibling tools like repair_json or sanitize_json_output. The agent is left to infer usage context without explicit alternatives or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Claim this connector by publishing a /.well-known/glama.json file on your server's domain with the following structure:
{
"$schema": "https://glama.ai/mcp/schemas/connector.json",
"maintainers": [{ "email": "your-email@example.com" }]
}The email address must match the email associated with your Glama account. Once published, Glama will automatically detect and verify the file within a few minutes.
Control your server's listing on Glama, including description and metadata
Access analytics and receive server usage reports
Get monitoring and health status updates for your server
Feature your server to boost visibility and reach more users
For users:
Full audit trail – every tool call is logged with inputs and outputs for compliance and debugging
Granular tool control – enable or disable individual tools per connector to limit what your AI agents can do
Centralized credential management – store and rotate API keys and OAuth tokens in one place
Change alerts – get notified when a connector changes its schema, adds or removes tools, or updates tool definitions, so nothing breaks silently
For server owners:
Proven adoption – public usage metrics on your listing show real-world traction and build trust with prospective users
Tool-level analytics – see which tools are being used most, helping you prioritize development and documentation
Direct user feedback – users can report issues and suggest improvements through the listing, giving you a channel you would not have otherwise
The connector status is unhealthy when Glama is unable to successfully connect to the server. This can happen for several reasons:
The server is experiencing an outage
The URL of the server is wrong
Credentials required to access the server are missing or invalid
If you are the owner of this MCP connector and would like to make modifications to the listing, including providing test credentials for accessing the server, please contact support@glama.ai.
Discussions
No comments yet. Be the first to start the discussion!