Skip to main content
reopt Handbook
reopt Handbook
Agentic Documentation

Paradigm Shift

Why Documentation Must ChangeAI-readable Design PrinciplesAI-assisted Writing Process

Practice by Document Type

Project Rule DocumentsFrom Docs to Skills, Plugins, and MCPAgent Documentation SecurityAPI Docs and SpecsREADME and OnboardingArchitecture Decision RecordsRunbooks and OperationsUser Guides and TutorialsKnowledge Bases and Internal Wikis

Operations

Maintenance StrategyTeam Documentation Culture

Appendix

TemplatesVerification ReportUpdates
Handbook›에이전틱 시대의 문서화 혁신›API Docs and Specs
한국어English

API Docs and Specs

Connect OpenAPI 3.2, tool schemas, MCP Resources, and contract tests.

Key takeaways

  • API docs are contracts: they fix request/response shapes, auth scopes, side effects, reliability rules, and validation, which agents use for codegen, tests, debugging, and MCP Tool design.
  • Treat the schema (OpenAPI/JSON Schema) as the source of truth over prose, and keep operationId stable because SDK and tool mappings depend on it.
  • OpenAPI 3.2.0 (released September 19, 2025) suits new projects, but a newer spec does not guarantee validator, codegen, gateway, or renderer support, so verify the full toolchain first.
  • Map API doc items to MCP Tool fields (schemas to inputSchema/outputSchema, auth to authorization, side effects to annotations and approval policy).
  • Detect breaking changes (added required field, removed/retyped response field, removed enum value) and gate them with migration notes and openapi:diff.

API docs are among the most frequently used references for coding agents. Agents use them for code generation, tests, debugging, MCP Tool design, and SDK generation.

An agent-first API document needs a source of truth, examples, side-effect boundaries, and validation.

API Docs Are Contracts

ContractExample
Request shapepath, query, body, headers
Response shapesuccess and error schemas
AuthOAuth scope, API key, role
Side effectread-only, write, destructive, external
Reliabilityidempotency, retry, rate limit
Validationlint, diff, contract test

OpenAPI Version Choice

The latest published OpenAPI version is 3.2.0, released on September 19, 2025.

VersionRecommended use
3.2.0new projects, streaming APIs, query, tag taxonomy, OAuth metadata
3.1.xwhen tooling has not fully adopted 3.2 but JSON Schema 2020-12 matters
3.0.xlegacy tooling constraints

Separate Spec Version From Tool Support

A newer spec version does not guarantee every validator, code generator, gateway, or docs renderer supports it. Verify the full toolchain before switching.

Principles

  1. Schema is source of truth - OpenAPI/JSON Schema beats prose.
  2. Stable operationId - SDK and tool mappings depend on it.
  3. Examples first - include request, response, and error examples.
  4. Error contracts - include status, code, message, and recovery action.
  5. Side effects - document read/write/destructive/open-world behavior.
  6. Validation - document lint, diff, contract tests, and smoke tests.

Agent Contract Pack

api-contract/
├── openapi.yaml
├── errors.md
├── auth.md
├── rate-limits.md
├── idempotency.md
├── examples/
└── validation.md

OpenAPI 3.2 Items to Watch

ItemDocumentation impact
streaming media typesclearer SSE, JSON Lines, JSON Sequences, multipart/mixed
query methodsafe query behavior with payload
querystringschema for the whole query string
expanded tagsbetter navigation and codegen grouping
OAuth metadata URLauth server discovery in the API contract

MCP Tool Mapping

API doc itemMCP Tool doc item
path/query/body schemainputSchema
response schemaoutputSchema or structured content
auth/scopeMCP authorization
read/write/destructiveannotations and approval policy
rate limitretry/backoff policy
error codeTool error and recovery

MCP Tool annotations are hints, not guarantees. Do not treat readOnlyHint or destructiveHint as the security boundary.

Breaking Change Detection

ChangeRiskAction
required request field addedbreakingmigration note
response field removed or type changedbreakingconsumer impact
enum value removedbreakingclient fallback review
optional field addedusually non-breakingdocs/examples update
new error codeconditionalclient handling review
pnpm openapi:lint
pnpm openapi:diff --from main --to HEAD
pnpm test:contract

Prompt

Update the API docs using only the route handlers and OpenAPI files below.
Include operationId, auth, scope, schemas, examples, errors, idempotency, rate limits,
MCP Tool mapping, breaking-change assessment, and validation commands.
Do not invent parameters or tool annotations.

References

  • OpenAPI Specification v3.2.0
  • OpenAPI Initiative: Announcing OpenAPI v3.2
  • Model Context Protocol Schema Reference

Related docs

Verification Report

Source, link, consistency, and build verification for the Agentic Documentation handbook.

Updates

Change log for the Agentic Documentation handbook.

Ch7. Tools, Approval, Connections

Enterprise Eve Agent Development · Design Eve authored tools, human approval, MCP/OpenAPI connections, and OAuth boundaries as enterprise security surfaces.

MCP Integration

Advanced Codex Usage · Connect Codex to MCP servers with explicit tool, data, and trust boundaries.

Prompt Engineering and Guardrails

Vercel Enterprise AI Platform · Design prompts, schemas, safety checks, and review gates for enterprise AI systems.

Agent Documentation Security

Reduce prompt injection, MCP tool poisoning, Plugin supply chain risk, and excessive agency.

README and Onboarding

Split README, llms.txt, agent instructions, and detailed docs by audience.

On this page

API Docs Are ContractsOpenAPI Version ChoicePrinciplesAgent Contract PackOpenAPI 3.2 Items to WatchMCP Tool MappingBreaking Change DetectionPromptReferences