SIGIL

Skill · ai-sdk/tools-and-structured-output · v1.0.0 · MIT

AI SDK 7 Tools and Structured Output

Correct Vercel AI SDK 7 tool calling, multi-step loops, agents and structured output, with the v4-v6 habits that silently break and mock-model tests.

Teaches an agent the current Vercel AI SDK (the `ai` package, version 7) for tools, tool loops, ToolLoopAgent, conversation persistence and structured output. It centres on the old forms that no longer fail loudly in 7.x: `parameters` sends the model an empty schema, `maxSteps` and a missing `stopWhen` stop after one step, `maxTokens` is ignored, `experimental_context` is gone, system messages inside `messages` now throw, and `result.response.messages` holds only the final step. Each rule was checked by running it against ai@7.0.159. It also covers testing with `MockLanguageModelV4` from `ai/test`, so the agent proves the behaviour without a provider.

  • AI engineering
  • Backend
  • Testing
  • build
  • test
  • maintain
  • ai-sdk
  • typescript
  • zod
  • nodejs

uplift

Untested

No runs exist for this digest.

Not measured for this digest.

Untested is not the same as useless: nobody has measured it yet. Proof comes from A/B runs on hidden tests:

npx sigil prove catalog/skills/ai-sdk/tools-and-structured-output --suite <suite> --runs 6

trust level · submitted

Submitted
  • in the catalog: met
Validated
  • structure check: not met
  • static scan, no high findings: not met
Verified
  • canary sandbox passed: not met
  • maintainer approved: not met

canary sandbox

Not run for this digest.

static scan

Not run for this digest.

compatibility · targeted, compiled and evaluated are separate claims

agenttargeted by authorcompiledevaluated in the labnotes
Claude Codetargeted: yesno record for compiledno record for evaluated
Codextargeted: yesno record for compiledno record for evaluated
Cursortargeted: yesno record for compiledno record for evaluated
GitHub Copilottargeted: yesno record for compiledno record for evaluated
Gemini CLItargeted: yesno record for compiledno record for evaluated
OpenCodetargeted: yesno record for compiledno record for evaluated

declared permissions

network
none
shell
npx tsc, node --test, npm test, grep
filesystem
write
env
none

Undeclared access is a finding in the scan and a tripwire in the canary.

source

path
catalog/skills/ai-sdk/tools-and-structured-output
authors
dgesteves
entry
SKILL.md (agent-skill)
registry
2026-11-02 · 5cb851d

install

$ npx sigil add ai-sdk/tools-and-structured-output --agent claude-code

No compile record for Claude Code on this digest. Install never runs capability scripts, and refuses on any digest mismatch.

known limitations

  • Written for ai 7.x (checked against 7.0.159). Projects on AI SDK 5 or 6 should use the migration table to tell which names apply; v3 and older are not covered.
  • Covers AI SDK Core (generateText, streamText, ToolLoopAgent, Output). AI SDK UI hooks (useChat), RSC, WorkflowAgent, MCP clients and provider-specific options are out of scope.
  • Provider behaviour (which models support strict schemas, parallel tool calls or approvals) varies; the skill states SDK behaviour only, verified with the SDK mock model, not with live providers.
  • The proof suite exercises Node with node:test and the SDK's mock model; it does not test streaming UIs or real network providers.