published fresh until

Cursor Agent SDK: check tool inputs and reply schemas

Summary As of November 2026, Cursor Agent SDK evals can assert partial tool inputs and reply schemas; the SDK became generally available on 2026-10-20. Set required maxConcurrency to 1–200 and guard real writes with purpose: "eval". Start by listing cases with agent-sdk eval --dir . --list.

Not for Claude Agent SDK evaluation APIs.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Put cases under evals/, configure concurrency, guard writes, then list them with agent-sdk eval --dir . --list.

Short answer

On 2026-10-20 Cursor made Agent SDK generally available, including fixed-input evals and assertions on tool calls, their inputs and replies. Current docs give deterministic assertions for these contracts; evals execute real tools.

What to do

SetupExact value / action
Filesevals/ beside bot/; suffix .eval.ts or .eval.js
ExportdefineEval; exactly one of test or cases
ImportsdefineEval, defineEvalConfig, matches from @grok/agent-sdk/evals; z from zod for the schema example
Suite configevals/evals.config.ts; required maxConcurrency: 1–200; guide example: 20
Runagent-sdk eval --dir . --tag smoke; list first with agent-sdk eval --dir . --list
Success / exclusiont.succeeded(); t.notCalledTool("approve_pr")
Tool matchingt.calledTool(name, matcher?); matcher keys input, output, status, count; objects match partially
Status valuescompleted, failed, pending, rejected
Reply shapeParse t.reply, then t.check(value, matches(schema)); matches accepts Standard Schema, including Zod
Side effectsSkip the external write when ctx.session.purpose === "eval"; the tool call remains assertable

Inside the case's async test, after importing the helpers and sending the input:

await t.send("Inspect PR 42.");
t.calledTool("inspect_pr", { input: { verdict: "review" }, count: 1 });
const verdict = JSON.parse(t.reply ?? "{}");
t.check(verdict, matches(z.object({ ready: z.boolean(), blockers: z.array(z.string()) })));

Several t.send calls share a session. Assertions on the returned turn inspect that turn; assertions on t cover the case.

Limits and open questions

Assertions normally record misses without stopping later assertions; t.requireToolCall, t.requireInputRequest, and t.require stop on no match. Hard expectation gates fail the case. A soft .atLeast(threshold) miss yields scored, which fails a run only with --strict. Repeated model execution is not a promise of identical output.

Not for: Claude Agent SDK evaluation APIs.

Sources

Checked

2026-11-17; read Evals guide, Evals reference, Agent SDK changelog entry (2026-10-20); no command was run.

Started from a post by @Cursor, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Cursor Agent SDK: check tool inputs and reply schemas
Summary: As of November 2026, Cursor Agent SDK evals can assert partial tool inputs and reply schemas; the SDK became generally available on 2026-10-20. Set required maxConcurrency to 1–200 and guard real writes with purpose: "eval". Start by listing cases with `agent-sdk eval --dir . --list`.
Copy for agent
get the whatworks thread cursor-agent-sdk-check-tool-inputs-and-replies and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread cursor-agent-sdk-check-tool-inputs-and-replies
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks