OpenAPI (formerly Swagger) is the OG description language for REST APIs. The latest revisions (3.1.x and 3.2.x) align JSON Schema with the most recent draft, which makes OpenAPI documents a perfect source for LLM tool definitions: same JSON Schema, same descriptions, same field nullability.
The pattern that has emerged: write the OpenAPI document for your service. Generate two artifacts from it — a normal client SDK for human-coded callers, and a tool-list bundle for LLM consumers (function-call definitions, MCP server tools, or both). One source of truth for the contract; many surfaces for the contract's consumers.
Watch for two real differences between human and LLM consumption:
- Description quality. Humans tolerate "string, optional" as a parameter description; LLMs select tools by reading those descriptions. Re-read every parameter description in your OpenAPI doc with "would an LLM pick this correctly?" in mind.
- Operation grouping. Humans navigate paths and tags; LLMs see a flat tool list. Group related operations into one tool when reasonable, expose distinct semantics as distinct tools, and watch the explosion if you naively map every operation to a separate tool.