Support: support@tinplate.dev · Zero-Retention Edge Security Support Trust Center DPA GitHub Issues
AI Safety & Agents Tier 2 All-Access

LLM Tool-Call Validator API — Validate & Auto-Repair Function Calling JSON

Validate and auto-repair broken LLM tool-call arguments against your JSON Schema. Validate and auto-repair LLM tool calls and function arguments against JSON Schema for OpenAI, Anthropic, Gemini, and MCP agent workflows.

Interactive Sandbox · No API Key Required 200 OK · Ready
POST /v1/tool-call-validatorinput
200 OK sample / live responsejson
{
  "ok": true,
  "data": {
    "valid": true,
    "verdict": "repaired",
    "provider_format": "flat",
    "tool_name": "search_orders",
    "call_id": null,
    "normalized_arguments": {
      "limit": 10,
      "include_archived": true
    },
    "mcp_call": {
      "method": "tools/call",
      "params": {
        "name": "search_orders",
        "arguments": {
          "limit": 10,
          "include_archived": true
        }
      }
    },
    "repairs": [
      "normalized_single_quotes",
      "removed_trailing_commas",
      "coerced_number:$.limit",
      "coerced_boolean:$.include_archived"
    ],
    "schema_errors": [],
    "llm_retry_feedback": null
  },
  "meta": {
    "request_id": "req_tcv_01",
    "ms": 1
  }
}
OpenAPI 3.0.3 Get All-Access Key ($29/mo) No signup. No payload storage.
Quickstart Code Examples
curl -X POST "https://api.tinplate.dev/v1/tool-call-validator" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TINPLATE_KEY" \
  -d '{"tool_call":{"name":"search_orders","arguments":"{'\''limit'\'': '\''10'\'', '\''include_archived'\'': '\''true'\'',}"},"tools":[{"name":"search_orders","parameters":{"type":"object","required":["limit","include_archived"],"properties":{"limit":{"type":"number","maximum":100},"include_archived":{"type":"boolean"}},"additionalProperties":false}}],"coerce_types":true}'
import { TinplateClient } from "@tinplate/sdk";

const tinplate = new TinplateClient({
  apiKey: process.env.TINPLATE_API_KEY!,
});

const { data, meta } = await tinplate.call("/v1/tool-call-validator", {
  "tool_call": {
    "name": "search_orders",
    "arguments": "{'limit': '10', 'include_archived': 'true',}"
  },
  "tools": [
    {
      "name": "search_orders",
      "parameters": {
        "type": "object",
        "required": [
          "limit",
          "include_archived"
        ],
        "properties": {
          "limit": {
            "type": "number",
            "maximum": 100
          },
          "include_archived": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    }
  ],
  "coerce_types": true
});
console.log(`[${meta.ms} ms]`, data);
import requests

response = requests.post(
    "https://api.tinplate.dev/v1/tool-call-validator",
    headers={
        "Content-Type": "application/json",
        "Authorization": "Bearer YOUR_TINPLATE_KEY",
    },
    json={
  "tool_call": {
    "name": "search_orders",
    "arguments": "{'limit': '10', 'include_archived': 'true',}"
  },
  "tools": [
    {
      "name": "search_orders",
      "parameters": {
        "type": "object",
        "required": [
          "limit",
          "include_archived"
        ],
        "properties": {
          "limit": {
            "type": "number",
            "maximum": 100
          },
          "include_archived": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    }
  ],
  "coerce_types": true
}
)
print(response.json())
const response = await fetch("https://api.tinplate.dev/v1/tool-call-validator", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_TINPLATE_KEY",
  },
  body: JSON.stringify({
  "tool_call": {
    "name": "search_orders",
    "arguments": "{'limit': '10', 'include_archived': 'true',}"
  },
  "tools": [
    {
      "name": "search_orders",
      "parameters": {
        "type": "object",
        "required": [
          "limit",
          "include_archived"
        ],
        "properties": {
          "limit": {
            "type": "number",
            "maximum": 100
          },
          "include_archived": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    }
  ],
  "coerce_types": true
}),
});
const result = await response.json();
console.log(result);
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "tinplate_tool_call_validator",
    "arguments": {
      "tool_call": {
        "name": "search_orders",
        "arguments": "{'limit': '10', 'include_archived': 'true',}"
      },
      "tools": [
        {
          "name": "search_orders",
          "parameters": {
            "type": "object",
            "required": [
              "limit",
              "include_archived"
            ],
            "properties": {
              "limit": {
                "type": "number",
                "maximum": 100
              },
              "include_archived": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        }
      ],
      "coerce_types": true
    }
  }
}
OpenAPI 3.0.3 Schema Contract

Request Parameters & Response Schema Reference

Request Body Parameters (POST /v1/tool-call-validator)

ParameterType & ConstraintsDescription
tool_call required string | object Raw LLM tool call (OpenAI function/tool_call, Anthropic tool_use, Gemini functionCall, MCP tools/call, or raw string).
tools required object[] List of allowed tool definitions with their JSON Schemas.
coerce_types optional boolean
default: true
Coerce safe LLM type mismatches ('10' -> 10, 'true' -> true, stringified JSON arrays/objects, enum casing).
strip_unknown_properties optional boolean
default: true
Remove hallucinated keys not declared in `properties` when `additionalProperties: false`.
apply_defaults optional boolean
default: true
Populate missing properties that declare a `default` value in the JSON Schema.
fuzzy_match_tool_name optional boolean
default: true
Match tool names across snake_case, camelCase, and kebab-case differences.

Response data Object Fields (200 OK)

FieldTypeDescription
valid boolean Field 'valid'
verdict "allow" | "repaired" | "reject" 'allow' if valid with zero repairs, 'repaired' if valid after healing/coercion, 'reject' if invalid.
provider_format "openai" | "anthropic" | "gemini" | "mcp" | "flat" | "raw_string" | "unknown" Field 'provider_format'
tool_name string | null Field 'tool_name'
call_id string | null Field 'call_id'
normalized_arguments object | null Field 'normalized_arguments'
mcp_call object | null Field 'mcp_call'
repairs string[] Field 'repairs'
schema_errors string[] Field 'schema_errors'
llm_retry_feedback string | null Deterministic correction message to feed back to the LLM when `valid` is false.

What Agent Tool-Call Validator & Repairer API Detects & Validates

  • Heals broken JSON arguments (single quotes, trailing commas, unclosed braces, markdown code fences)
  • Safe type coercion: converts stringified numbers ('10' -> 10), booleans ('true' -> true), singleton arrays, and enum casing
  • JSON Schema Draft-07 / 2020-12 validation: required fields, types, enums, min/max bounds, pattern regexes, and additionalProperties
  • Native envelope support: OpenAI Chat Completions (tool_calls) & Responses API (function_call), Anthropic Messages (tool_use + input_schema), Google Gemini (functionCall), and MCP (tools/call + inputSchema)
  • Structured LLM retry feedback prompt generation when arguments cannot be safely coerced
Honest Engineering Boundaries

Known Limitations & Test Verification

Release: v1.0.39 · Verified: 16 November 2026 · Portfolio Median: 0.318 ms in-Worker V8 compute (add 15–65 ms HTTPS RTT) · See Full Portfolio Benchmarks →

  • Validates JSON Schema Draft-07 / 2020-12 core keywords; external $ref URLs are not fetched over the network.
  • Supported provider spec versions: OpenAI Chat Completions (2024-10-01+) & Responses API (2025-03-01+), Anthropic Messages API (2023-06-01 tool_use / input_schema), Google Gemini (v1beta / v1 functionCall), and Model Context Protocol (2024-11-05 & 2025-03-26 tools/call). All provider fixtures pass (verified 14 November 2026).

Direct All-Access & Marketplace Plans

Direct Polar All-Access Keys unlock all 42 APIs (49 endpoints), /v1/pipeline, and /mcp on api.tinplate.dev: Pro ($29/mo · 120 req/min · 100k/mo · 128 KB) or Team ($79/mo · 300 req/min · 500k/mo · 256 KB).

PlanMonthly PriceIncluded RequestsRate LimitMax PayloadBest For
BASIC$0.00 / mo500 / month10 req / min64 KBEvaluation & CI smoke tests
PRO$9.99 / mo15,000 / month60 req / min128 KBSolo devs & production apps
ULTRA$29.99 / mo100,000 / month300 req / min256 KBGrowing SaaS & multi-agent pipelines
MEGA$79.99 / mo500,000 / month1,000 req / min256 KBHigh-volume enterprise workloads

Frequently Asked Questions

How does this differ from the Broken JSON Healer API?

JSON Healer repairs syntax errors in raw JSON strings. Tool-Call Validator repairs syntax AND validates/coerces the resulting object against your target tool's JSON Schema across OpenAI, Anthropic, Gemini, and MCP envelopes.

What happens if a required field is completely missing?

If a default is defined in the schema, it is filled; otherwise valid is false and llm_retry_feedback provides an exact correction message to feed back to the LLM.

Which provider tool-call formats are supported?

OpenAI Chat Completions & Responses API, Anthropic tool_use (with snake_case input_schema), Google Gemini functionCall, and MCP JSON-RPC 2.0 tools/call (with camelCase inputSchema).

Zero Payload Logging

Data Handling, Privacy & Proxy Disclosure

Processed strictly in volatile Worker memory; tool arguments and schemas are never logged.

Worker Zero-Logging Guarantee: Cloudflare Workers Observability and invocation logging are disabled (observability.enabled = false, head_sampling_rate = 0, invocation_logs = false). Requests via RapidAPI or Zyla traverse marketplace proxies; use a Direct Bearer Key for zero-intermediary routing.

Related Tinplate APIs

POST /v1/json-heal Live

Broken JSON & LLM Output Healer API

Repair malformed or truncated LLM JSON outputs into valid, schema-checked JSON in 1 ms.

POST /v1/mcp-manifest-linter Tier 1

MCP Server Manifest & Tool Security Linter API

Audit MCP server manifests for hidden tool poisoning, shell risks, and excessive permissions.

POST /v1/prompt-guard Live

Prompt Injection Detection API

Catch prompt injections, role hijacks, and encoded jailbreaks in user inputs and RAG chunks.