{"uid":"cap_DgIYhS5VCve65SAmq6HLp","slug":"api-strale-io-42abd3f2","name":"LLM Tool Call Validator with Auto-Fix","description":"Validate an LLM tool call against a JSON Schema. Auto-fixes type mismatches (string '42' → number 42). Algorithmic.","url":"https://api.strale.io/x402/tool-call-validate?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["tool_name","tool_input","expected_schema"],"properties":{"tool_name":{"type":"string"},"tool_input":{"type":"object"},"expected_schema":{"type":"object"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"input":{"type":"http","method":"GET","queryParams":{"tool_name":"create_order","tool_input":{"price":"9.99","item_id":42,"quantity":"3"},"expected_schema":{"type":"object","properties":{"price":{"type":"number"},"item_id":{"type":"integer"},"quantity":{"type":"integer"}}}}}},"response":{"_meta":{"payment":{"method":"x402","price_usd":0.054000000000000006,"settlement_id":"0xaa6c359ce8aaeed822d7e7d66f3b2b9179c95b8094d77fcf696e4b3329f3ffe0"},"capability":"tool-call-validate","latency_ms":0,"provenance":{"source":"algorithmic","fetched_at":"2026-06-05T23:36:13.996Z"}},"valid":true,"errors":[],"tool_name":"create_order","error_count":0,"corrected_input":{"price":9.99,"item_id":42,"quantity":3},"corrections_applied":{"#/price":"string \"9.99\" → number 9.99","#/quantity":"string \"3\" → number 3"}}},"exampleRequest":{"tool_name":"create_order","tool_input":{"price":"9.99","item_id":42,"quantity":"3"},"expected_schema":{"type":"object","properties":{"price":{"type":"number"},"item_id":{"type":"integer"},"quantity":{"type":"integer"}}}},"tags":["x402"],"displayCostAmount":"0.054001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.054001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.054","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.054","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_fpesjyuFnGcF49AG3Zxfg","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.054","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates an LLM tool call against a JSON Schema and auto-fixes common type mismatches like string-to-number coercions","exampleAgentPrompt":"Validate this tool call for 'create_order' — the input is {\"quantity\": \"3\", \"price\": \"9.99\", \"item_id\": 42} — against the schema {\"type\":\"object\",\"properties\":{\"quantity\":{\"type\":\"integer\"},\"price\":{\"type\":\"number\"},\"item_id\":{\"type\":\"integer\"}}} and auto-fix any type mismatches like strings that should be numbers.","exampleUseCases":null,"resultDescription":"Returns a validation result indicating whether the tool call is valid, along with an auto-fixed version of the tool input where type mismatches (e.g. string '42' coerced to number 42) have been corrected, plus a list of any errors or corrections applied.","failureModes":["Missing required query params (tool_name, tool_input, or expected_schema) returns 400 error","Malformed JSON in tool_input or expected_schema causes parse error","Schema itself is invalid JSON Schema — may return validation failure or error","Type mismatch that cannot be auto-fixed (e.g. non-numeric string where number required) returns validation failure with error details","Payment failure or insufficient USDC balance returns 402"],"whenToPreferThis":"Use this endpoint when an AI agent has generated a tool call and you need to verify it conforms to the declared schema before execution, especially when you want automatic coercion of common LLM type mistakes (e.g. outputting '42' instead of 42). Ideal for agentic pipelines where LLM outputs are fed directly into typed function calls and you need a lightweight guardrail without writing custom validation logic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T06:51:23.518Z","isFirstParty":false,"canonicalSlug":"api-strale-io-42abd3f2"}