Structured Output And Tool Calling

Reference-grade guide to getting reliable structured output and tool/function calls out of LLMs — JSON mode vs constrained/grammar-guided decoding, response_format json_schema and tool-schema coercion, Zod/Pydantic validation at the boundary, the validate→repair→escalate→fallback loop, tool-argument validation, idempotency for safe retries, fallback chains, and evals. Use when an LLM must return parseable JSON, fill typed tool arguments, or drive deterministic downstream code.

jpoindexter Updated

File contents

jpoindexter/design-and-ai-skills/tree/main/ai-engineering-skills/structured-output-and-tool-calling commit e21e22e158

Frequently asked questions

npx skillmds@latest add jpoindexter/structured-output-and-tool-calling