Check tool-call / tool-result pairing and ordering in an LLM transcript (Anthropic, OpenAI Chat, OpenAI Responses)
Validates a message list before it is sent to Anthropic Messages, OpenAI Chat Completions or OpenAI Responses: every tool call paired with its result, results in the right place and role, ids present and unique. Built for an agent that edits, truncates or replays its own history and would otherwise get a 400. Only rules stated in the providers' documentation fail the check; anything else suspicious (for example an unanswered Chat Completions tool call, whose requirement the docs do not state) returns unknown with the reason. Does not validate message content, tool schemas, role alternation or thinking/reasoning blocks, and does not call any provider.
What you get
Finds the orphaned tool_use or dropped function_call_output before the provider rejects the request.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/transcript-validator. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/transcript-validator \
-H 'content-type: application/json' \
-d '{"provider":"anthropic","messages":[{"role":"user","content":"Weather in Paris?"},{"role":"assistant","content":[{"type":"tool_use","id":"toolu_1","name":"get_weather","input":{"city":"Paris"}}]},{"role":"user","content":[{"type":"tool_result","tool_use_id":"toolu_1","content":"18C"},{"type":"text","text":"Thanks"}]}]}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
provider | string; one of "anthropic", "openai-chat", "openai-responses" | yes | |
messages | array<any>; max 500 items | yes | |
expectComplete | boolean | no | Default true: a trailing tool call without a result is a defect. Set false when the transcript is mid-loop and results are still pending. |
Example request body
{
"provider": "anthropic",
"messages": [
{
"role": "user",
"content": "Weather in Paris?"
},
{
"role": "assistant",
"content": [
{
"type": "tool_use",
"id": "toolu_1",
"name": "get_weather",
"input": {
"city": "Paris"
}
}
]
},
{
"role": "user",
"content": [
{
"type": "tool_result",
"tool_use_id": "toolu_1",
"content": "18C"
},
{
"type": "text",
"text": "Thanks"
}
]
}
]
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
pairs | array<object> | no | |
pendingIds | array<string> | no | Tool call ids without a result. |
ruleBasis | string | no | Documentation the rules come from. |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the execution-safety-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent