Bad tool calls fix themselves before your code sees them.

callcheck validates AI tool call responses against a schema, and auto repairs the ones that fail. No hand rolled retry logic, no model lock in, no subscription required.

$npm install -g callcheck
command callcheck check --repair ready

$ callcheck check --schema user.json --response bad.json --repair

attempt 1 failed

- email: invalid email format

- plan: invalid enum value

✔ repaired response now matches schema

Define the shape once.

Nested objects, enums, constraints. callcheck checks the full response against your real schema, not a simplified version of it.

  • built on Zod, no new schema language to learn
  • works with any AI provider, not tied to one model
  • readable errors, not a stack trace

const schema = z.object({

userId: z.string(),

plan: z.enum(["free", "pro", "enterprise"]),

usage: z.object({ requests: z.number() }),

});

wrap a tool once, repair every call automatically

const tool = validated(

queryUserTool,

{ repair: true, retry: gatewayRetry(key) }

);

Not just a CLI.

Import callcheck in TypeScript, wrap any tool definition, and every call through it gets validated and repaired without extra code downstream.

  • npm package or standalone CLI, same core
  • works outside AI SDK too, framework agnostic by design
  • free repair calls through Vercel AI Gateway, no subscription

Built for agent workflows.

Not a logging tool. A repair layer between what your agent gets back and what your code trusts.

001

Validate

Zod based checks on every field, including nested objects.

002

Repair

Failing responses get a fix prompt and a retry, automatically.

003

Wrap once

validated() wraps a tool, every call after that is protected.

004

Track failures

Every attempt logs which field and which model broke.