Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    LLM Output JSON Validator

    1

    Instantly detects, cleans, and repairs malformed LLM JSON outputs including markdown noise and syntax errors.

    Free

    3 usesSecurity scanned
    LLM Output JSON Validator

    LLM Output JSON Validator

    Example session with this skill installed

    Fix this broken JSON from my LLM: json { 'user_id': 101, 'actions': ['login', 'update',], 'meta': 'Needs "high" priority' }

    • Read your context and instructions
    • Compiled the llm output json

    [LLM JSON Validation Report]

    🔍 Issues Detected:

    • Markdown wrappers detected and removed.
    • Single quotes replaced with double quotes for keys and values.
    • Trailing comma fixed in 'actions' array.
    • Internal double quotes in 'meta' value escaped for valid JSON syntax.

    ✅ Repaired JSON Output:

    {
      "user_id": 101,
      "actions": [
        "login",
        "update"
      ],
      "meta": "Needs \"high\" priority"
    }
    

    💡 Pro-Tip for Prevention:

    • Use a Pydantic model or Zod schema in your prompt and explicitly instruct the model to "Output raw JSON without markdown code blocks" to reduce parsing overhead.

    [Self-Check]

    • Markdown and conversational noise stripped
    • Common syntax errors (commas, quotes) repaired
    • Final output is strictly valid, parseable JSON
    • Actionable prevention tip provided

    Next steps

    1. Copy the repaired JSON into your test suite or API client.
    2. Update your agent's system instructions to include the provided prevention tip.
    3. Verify if the user_id type (integer) matches your database schema requirements.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem

    LLMs frequently break production pipelines by returning JSON wrapped in markdown, using trailing commas, or failing to escape special characters. Manually cleaning these outputs for testing or debugging is slow and error-prone.

    What it does

    • Detects and strips markdown code blocks and conversational text surrounding JSON objects.
    • Automatically repairs trailing commas and replaces single quotes with valid double quotes.
    • Identifies unescaped special characters and restores missing closing brackets or braces.
    • Generates a diagnostic report detailing exactly what failed in the original LLM response.

    Why this beats prompting it yourself

    General-purpose agents often hallucinate or repeat the same formatting errors when asked to fix them. This skill uses a strict validation logic to ensure the final output is parseable by standard JSON libraries without additional manual sanitization.

    Use cases

    • Cleaning logs from failed agent function calls.
    • Sanitizing raw LLM responses before piping them into a downstream database.
    • Debugging structured output prompts during the prototyping phase.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    Cannot fix logical data inconsistencies or recover data from severely truncated responses where the majority of the object is missing.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    3 uses

    Times used to date

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 2 months ago

    • Free with an Agensi account

    Permissions

    No special permissions declared or detected

    Listed2 months ago

    What's inside

    Frequently Asked Questions

    This skill automatically strips away markdown code blocks and conversational text, while repairing common LLM errors like trailing commas, single quotes, and missing brackets to ensure your JSON is production-ready.

    The validator works with any AI agent or platform that generates text-based JSON, making it a universal middleware for pipelines involving OpenAI, Anthropic, or open-source models.

    You will receive the full logic for the validation skill, documentation on how to integrate it into your existing workflow, and a diagnostic reporting tool to help identify prompt weaknesses.

    No, this skill uses specific validation logic to fix formatting rather than asking another LLM to do it, which prevents the recursive hallucination errors common in prompting-based fixes.

    Integration is straightforward; you simply route your raw LLM response through the validator before passing it to your standard JSON.parse() or downstream database functions.

    Yes, buyers receive lifetime access to any future logic improvements and updates to the repair algorithms as LLM formatting quirks evolve.

    New in LLM Ops

    Free