Skip to main content
Glama

validate_json

Read-onlyIdempotent

utilpeek: Validate JSON against a JSON Schema. To pull JSON out of prose use extract_json_with_schema; to convert formats use convert_data. Returns whether a JSON value is valid against a JSON Schema (draft from $schema, default 2020-12; 2019-09, 7, 6, 4 and 3 recognised), with up to 100 errors (instance path, schema path, message, validator) and the formats checked. Remote $ref documents are refused (422 remote_ref_forbidden), never fetched. Input: instance and schema; together at most 1 MB. An invalid schema is a 422 invalid_schema. Parsed in an isolated, resource-limited child process without network; input over its limits is a 422 (not charged). Typically under 0.5 s. Price: USD 0.001. Free: 10 utilpeek calls per IP per UTC day. The submitted text is never logged or stored. Docs: https://tanod.dev/learn/json-schema-validation-api.html

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "instance": "<instance>",
      "schema": "<schema>"
    },
    "name": "validate_json"
  }
}

Input Schema

NameRequiredDescriptionDefault
schemaYesJSON Schema (draft from $schema; default 2020-12). Remote $ref documents are refused, never fetched.
instanceYesAny JSON value to validate.

Output Schema

NameRequiredDescriptionDefault
noteNo
draftNo
errorNoOnly on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object.
validNo
errorsNo
sourceNo
truncatedNo
error_countNo
formats_checkedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • removedInput schema / properties / instance / title
      Removed value: -"Instance"
    • removedInput schema / properties / schema / title
      Removed value: -"Schema"
    • removedInput schema / title
      Removed value: -"validate_jsonArguments"
    • removedOutput schema / properties / errors / items
      Removed value: -{
      -  "properties": {
      -    "message": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "path": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "schema_path": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "validator": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    }
      -  },
      -  "type": [
      -    "object",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / formats_checked / items
      Removed value: -{
      -  "type": [
      -    "string",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / source / properties
      Removed value: -{
      -  "library": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "license": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  }
      -}
  2. Changed1 schema field changed
    • addedInput schema / properties / instance / type
      Added value: +[
      +  "object",
      +  "array",
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "draft": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "error": {
      +      "description": "Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object."
      +    },
      +    "error_count": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "errors": {
      +      "items": {
      +        "properties": {
      +          "message": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "path": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "schema_path": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "validator": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "type": [
      +          "object",
      +          "null"
      +        ]
      +      },
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "formats_checked": {
      +      "items": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "note": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "source": {
      +      "properties": {
      +        "library": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "license": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "truncated": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "valid": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  4. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources