К основному содержанию
скилл CX Codex

create-structured-output — скилл для Claude Code: JSON из звонков

Скилл create-structured-output для Vapi Structured Outputs: помогает описать схему извлечения данных из звонка, привязать её к ассистенту и прогнать по записям.

MIT 154 установок ★ 69 обновлён 2026-10-23

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add VapiAI/skills --skill create-structured-output -a claude-code
Открыть на GitHub

Что делает create-structured-output

Скилл ведёт по шагам создания Structured Output в Vapi: сначала фиксируется, что должно получиться на выходе звонка, потом собирается JSON Schema, сохраняется определение, прикрепляется к ассистенту и проверяется на реальном вызове. Внутри — процедура, а не набор скриптов.

Работа начинается с выбора режима. Можно остановиться на схеме и ничего не трогать в аккаунте, можно сохранить переиспользуемое определение через POST /structured-output, а можно сделать разовый прогон с previewEnabled: true. Тип извлечения тоже выбирается: type: "ai" для смысла и категорий, type: "regex" для буквального совпадения по RE2. Имя сохранённого определения — от 1 до 40 символов.

Без VAPI_API_KEY на доверенном сервере не сохранить определение, не прикрепить его и не забрать результаты. Привязка патчит только assistantIds, остальные ID остаются на месте, а прогон по уже завершённым звонкам принимает не больше 100 идентификаторов за запрос. Включать compliancePlan.forceStoreOnHipaaEnabled скилл советует только по явному запросу.

Какие задачи решает

  • описать схему извлечения данных из записи звонка
  • прикрепить сохранённый Structured Output к нужному ассистенту
  • проверить извлечение на одном реальном звонке перед массовым прогоном
  • прогнать новую схему по уже завершённым звонкам
  • достать типизированный результат звонка через API

Примеры запросов агенту

  • Опиши схему извлечения из звонка: сумма заказа и способ оплаты. Пока только артефакт, ничего не сохраняй.
  • Прикрепи это определение к ассистенту, остальные assistantIds оставь как есть.
  • Прогони превью на одном реальном звонке с previewEnabled: true и покажи, что вернулось.

Как установить create-structured-output

1Через Skills CLI (Vercel)

npx skills add VapiAI/skills --skill create-structured-output -a claude-code

2Вручную: положить файлы

~/.claude/skills/create-structured-output/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/create-structured-output/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о create-structured-output

Как установить create-structured-output в Claude Code?

Выполните npx skills add VapiAI/skills --skill create-structured-output -a claude-code, затем проверьте ~/.claude/skills/create-structured-output/SKILL.md.

Что делает create-structured-output?

Проводит через создание Vapi Structured Output: выбор режима, схема извлечения, сохранение определения, привязка к ассистенту, превью и прогон по звонкам с последующей проверкой результата.

Что нужно для работы скилла?

Ключ VAPI_API_KEY на доверенном сервере: без него не сохранить определение, не прикрепить его к ассистенту и не получить результаты. Для сверки актуальных полей схемы Vapi рекомендуется доступ в интернет.

Исходный текст

SKILL.md · MIT
---
name: create-structured-output
description: Design, create, inspect, update, attach, detach, preview, execute, and verify reusable Vapi Structured Outputs through public API or Server SDK workflows. Use for post-call extraction, typed call artifacts, AI-versus-regex extraction, JSON Schema design, backfilling existing calls, or retrieving structured results programmatically.
license: MIT
compatibility: Internet access is recommended for current Vapi schema verification; VAPI_API_KEY is required for saved resources, assistant attachments, call execution, and result retrieval.
metadata:
  author: vapi
  version: "1.0"
---

# Vapi Structured Output Creation

Build the smallest reusable post-call extraction that represents the user's actual downstream contract. Keep definition creation, assistant attachment, execution, and result retrieval separate: success at one stage does not prove the next stage occurred.

## Source and Safety Rules

- Use the configured Vapi documentation MCP when available. Otherwise use current public Vapi API documentation and [API Examples](references/api-examples.md). Revalidate request fields and SDK methods before final implementation.
- Use a private Vapi API key only on a trusted server. Read it from `VAPI_API_KEY`; never print, request in chat, or embed it in source, client-side code, or examples.
- Never invent resource IDs, call IDs, extraction fields, enum values, data-retention requirements, or customer data.
- Do not enable `compliancePlan.forceStoreOnHipaaEnabled` unless the user explicitly requests it and confirms that the output cannot contain PHI or other sensitive data.
- Treat call transcripts, messages, tool results, and extracted values as sensitive customer data. Minimize what is logged or reproduced.

## Procedure

1. Choose the output mode.
   - For a schema, payload, review, or implementation example, return an artifact without calling Vapi. State that nothing was saved, attached, or executed.
   - For a reusable saved definition, use `POST /structured-output` only when the user asks to create or save it and credentials are available.
   - For a one-call experiment that does not need a saved definition, pass a transient `structuredOutput` to `POST /structured-output/run` with `previewEnabled: true`.
   - Treat attachment, detachment, and execution against existing calls as separate requested actions. Do not infer them from creation alone.

2. Define the extraction contract.
   - Identify the downstream consumer, required fields, optional fields, allowed categories, formats, and behavior when evidence is absent or ambiguous.
   - Ask only for missing facts that materially change the schema. State safe assumptions for the rest.
   - Split unrelated outputs when they have different consumers, retention policies, or iteration cycles. Keep one output when the fields form one stable business record.

3. Choose AI or regex.
   - Use `type: "ai"` for meaning, classification, summarization, sentiment, outcome detection, normalization, or facts expressed in varied language.
   - Use `type: "regex"` only for deterministic transcript matching with a stable pattern. Use RE2-compatible syntax and choose a top-level schema type that matches the documented regex result: boolean, string, number/integer, or array.
   - Do not use regex to infer meaning. Do not use AI when a literal, stable pattern is the entire requirement.

4. Design the smallest useful JSON Schema.
   - Include only fields the caller can provide or the call evidence can support.
   - Add concise descriptions that distinguish semantically similar fields.
   - Use `enum` for a closed category set, `format` or `pattern` for externally validated strings, and numeric bounds when the business contract defines them.
   - Mark a field required only when every valid call should produce it. Make conditionally available values optional instead of forcing guesses.
   - Prefer a primitive schema for a single value and an object only for a cohesive record. Avoid deep nesting unless the downstream contract needs it.
   - Validate the schema with a standard JSON Schema validator before sending it.

5. Create, inspect, or update the definition.
   - Keep saved names between 1 and 40 characters.
   - On create, send `name` and `schema`; add `type`, `description`, `regex`, `model`, or `compliancePlan` only when intentional.
   - On inspect, resolve the exact resource with list filters or a verified ID, then use `GET /structured-output/{id}`. Do not guess from a partial name.
   - On update, read the current definition first and send only fields that should change. Use `schemaOverride=true` only when intentionally changing the schema's top-level type; otherwise do not use it to bypass schema safety.
   - Re-fetch after mutation and compare the requested fields. A successful HTTP status without the expected returned state is not verified success.

6. Attach or detach safely.
   - Prefer the saved Structured Output's documented `assistantIds` relationship for attachment. Read its current `assistantIds`, add or remove exactly the resolved assistant ID, and preserve every unrelated ID.
   - Patch only `assistantIds` on the Structured Output for this operation. Re-fetch the Structured Output and assistant; verify the relationship and the assistant's `artifactPlan.structuredOutputIds` when returned.
   - If the implementation instead patches the assistant, first read the assistant and send the complete existing `artifactPlan` with only `structuredOutputIds` changed. Preserve recording, logging, transcript, scorecard, storage, and other artifact settings.
   - Do not claim that creating a definition attached it. Do not claim that detaching deleted it or removed results already stored on past calls.

7. Preview before broad execution.
   - Use `POST /structured-output/run` with one real call ID and `previewEnabled: true`. Supply either `structuredOutputId` or a transient `structuredOutput`, not both.
   - Confirm the selected call contains representative evidence and that the returned value satisfies the schema and business meaning.
   - State that preview does not update the call artifact.
   - If extraction is wrong, simplify the schema or improve descriptions before changing models or custom extraction prompts.

8. Execute or backfill only when requested.
   - Use `previewEnabled: false` or omit it to update call artifacts. Pass no more than the currently documented maximum of 100 call IDs per request.
   - Before a multi-call run, state the exact output, call count, and that existing values for this output may be replaced while other structured-output values remain.
   - Use only call IDs supplied by the user or returned by a verified public API query. Report partial failures by call ID; do not imply an all-or-nothing transaction.

9. Retrieve and verify results.
   - After a normal attached call finishes, allow for post-call processing before checking the call.
   - Retrieve each call with `GET /call/{id}` and read `call.artifact.structuredOutputs[structuredOutputId].result`.
   - Validate the result against the intended schema and inspect representative source evidence before calling it accurate. Schema validity proves shape, not factual correctness.
   - Report separately: definition saved, assistant linked, preview returned, call artifact updated, and result validated. Mention only stages actually verified.

## Error Handling

- On `400`, inspect the response for schema, regex, model, relationship, or run constraints. Correct one unambiguous documented issue and retry once; never repeat an unchanged request.
- On `401` or `403`, stop and report authentication or permission failure.
- On `404`, report the missing Structured Output, assistant, or call and identify the exact unresolved ID.
- On `409`, re-read current state before deciding whether the intended relationship or update already exists.
- On `429` or `5xx`, preserve the request context, report the service condition, and do not claim success.
- If a result is absent, distinguish processing delay, missing attachment, disabled artifact storage, insufficient call evidence, and extraction failure before recommending a change.

## API Implementation Examples

Read [API Examples](references/api-examples.md) when implementation code is needed. Use the official TypeScript or Python Server SDK only after confirming the generated method in its current official reference; use direct REST when SDK syntax is unavailable or unstable.

## Output Contract

Return only the sections relevant to the request:

- Mode: artifact-only, saved definition, relationship change, preview, or artifact-writing run
- Assumptions or blocking questions
- Final schema and Structured Output configuration
- Created or updated resource ID and verified fields, when mutated
- Attachment state and preserved relationships, when changed
- Preview or execution result, affected call IDs, and whether artifacts changed
- Retrieved result plus schema and evidence limitations
- Remaining configuration or validation work

## Public Sources

- [Structured Outputs quickstart](https://docs.vapi.ai/assistants/structured-outputs-quickstart/)
- [Create Structured Output API](https://docs.vapi.ai/api-reference/structured-outputs/structured-output-controller-create)
- [List Structured Outputs API](https://docs.vapi.ai/api-reference/structured-outputs/structured-output-controller-find-all)
- [Get Structured Output API](https://docs.vapi.ai/api-reference/structured-outputs/structured-output-controller-find-one)
- [Update Structured Output API](https://docs.vapi.ai/api-reference/structured-outputs/structured-output-controller-update)
- [Run Structured Output API](https://docs.vapi.ai/api-reference/structured-outputs/structured-output-controller-run)
- [Get Call API](https://docs.vapi.ai/api-reference/calls/get/)
- [Official TypeScript Server SDK reference](https://github.com/VapiAI/server-sdk-typescript/blob/main/reference.md)
- [Official Python Server SDK reference](https://github.com/VapiAI/server-sdk-python/blob/main/reference.md)

© vapi · MIT · VapiAI/skills

Похожие скиллы

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
structured-output-extractor patricio0312rev Скилл structured-output-extractor для Claude Code извлекает типизированные данные из ответов LLM с помощью JSON Schema, Zod и function calling. Проверяет результат при разборе JSON. CX Codex +1 323установок Structured Output MCP Agent a2a MCP-сервер Structured Output MCP Agent превращает промпт и схему полей в проверенный типизированный JSON. Подходит для задач, где агенту нужен фиксированный формат результата. CX Codex +1 3 042установок voice-ai-development sickn33 Скилл voice-ai-development для Claude Code проектирует голосовых агентов и приложения с речевым интерфейсом. Работает с транскрибацией, синтезом речи и аудио в реальном времени. CX Codex +1 972установок output-contract-enforcer curiositech Скилл output-contract-enforcer для Claude Code проверяет JSON-выход узлов DAG по схеме и выявляет несовместимость соседних узлов. Помогает найти причину неожиданных данных в следующем узле. CX Codex +1 141установок Agent Output Verifier by SarnAI sarnai-dev MCP-сервер Agent Output Verifier by SarnAI проверяет JSON-ответ ИИ-агента по вашей JSON Schema и бизнес-правилам — например, что сумма строк совпадает с итогом счёта. Платите за вызов через x402, без подписки. CX Codex +1 tooluniverse-custom-tool mims-harvard Скилл tooluniverse-custom-tool для Claude Code добавляет локальные инструменты в ToolUniverse через JSON или Python. Включается при обёртке API и добавлении доменной логики. CX Codex +1 294установок

Из того же набора10

Весь набор →
create-assistant Скилл create-assistant для Claude Code проектирует и проверяет голосовых ассистентов Vapi. Он подключается при создании телефонного или веб-агента и настройке его поведения. CX Codex +1 1 100установок create-phone-number Скилл create-phone-number для Claude Code и Codex: управляет телефонными номерами Vapi через публичный API — создание, импорт, маршрутизация, обновление и проверка номеров для голосовых ассистентов. CX Codex +1 973установок setup-webhook Скилл setup-webhook для Claude Code, который настраивает серверные URL и вебхуки для получения событий от Vapi. Запускается при интеграции Vapi в приложение или создании эндпоинтов для обработки вызовов. CX Codex +1 968установок create-tool Скилл create-tool помогает проектировать, создавать и привязывать инструменты к ассистентам Vapi через публичный API. Поддерживает вызовы телефонии, интеграции с сервисами, REST-запросы и MCP. CX Codex +1 958установок create-squad Скилл create-squad помогает решить, нужна ли команда ассистентов вместо одного, и собирает Squad через публичный API Vapi с проверкой ID и хендоффов. CX Codex +1 910установок vapi-bootstrap-framework Скилл vapi-bootstrap-framework для быстрого создания голосовых агентов Vapi из черновика. Генерирует полный проект на Bun + TypeScript с регистром сценариев, стеками языков и bootstrap-скриптом — нужны только ROUGH_DRAFT.md, Bun и API-ключ. CX Codex +1 314установок vapi-prompt-builder Скилл vapi-prompt-builder для Claude Code создаёт, улучшает и проверяет системные промпты Vapi для голосовых агентов и Squad. В промптах задаются сценарии звонков, маршрутизация и передача оператору. CX Codex +1 297установок simulations Скилл simulations проектирует, собирает и запускает голосовые или текстовые симуляции для ассистентов Vapi. Помогает проверить поведение агента в диалоге до релиза. CX Codex +1 161установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой