Tool Call Validation
Check supported schema rules for a tool call and repair common type mismatches. Returns validation errors and corrected input.
Pay by wallet (x402)
tool-call-validate Example
Example answer
{
"valid": true,
"errors": [],
"tool_name": "test",
"error_count": 0,
"corrected_input": null,
"corrections_applied": null
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
tool_name | string | Yes | — |
tool_input | object | Yes | — |
expected_schema | object | Yes | — |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
valid | boolean | Always (present in every successful answer) |
errors | array | Always (present in every successful answer) |
corrected_input | object | Usually (present for most inputs) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "tool-call-validate",
"inputs": {
"tool_name": "search",
"tool_input": {
"limit": "10",
"query": "test"
},
"expected_schema": {
"type": "object",
"properties": {
"limit": {
"type": "number"
},
"query": {
"type": "string"
}
}
}
},
"max_price_cents": 5
}' {
"tool": "strale_execute",
"arguments": {
"slug": "tool-call-validate",
"inputs": {
"tool_name": "search",
"tool_input": {
"limit": "10",
"query": "test"
},
"expected_schema": {
"type": "object",
"properties": {
"limit": {
"type": "number"
},
"query": {
"type": "string"
}
}
}
},
"max_price_cents": 5
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "tool-call-validate",
inputs: {
"tool_name": "search",
"tool_input": {
"limit": "10",
"query": "test"
},
"expected_schema": {
"type": "object",
"properties": {
"limit": {
"type": "number"
},
"query": {
"type": "string"
}
}
}
},
max_price_cents: 5,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="tool-call-validate",
inputs={
"tool_name": "search",
"tool_input": {
"limit": "10",
"query": "test",
},
"expected_schema": {
"type": "object",
"properties": {
"limit": {
"type": "number",
},
"query": {
"type": "string",
},
},
},
},
max_price_cents=5,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i -X POST https://api.strale.io/x402/v2/tool-call-validate \
-H 'Content-Type: application/json' \
-d '{
"tool_name": "search",
"tool_input": {
"limit": "10",
"query": "test"
},
"expected_schema": {
"type": "object",
"properties": {
"limit": {
"type": "number"
},
"query": {
"type": "string"
}
}
}
}' Limitations
Parameter meaning and correctness are not checked
Validates tool call structure and parameter types — cannot verify whether parameter values are semantically correct
What to do instead: Combine with runtime testing against the actual tool to verify that parameter values produce expected results
Related tools
- Agent Trace Analysis €0.20
- API Docs Generator €0.20
- API Mock Responses €0.05
- Changelog Generator €0.03
- Code Converter €0.05
- Commit Message Generator €0.05