Agent-Ready APIs: What They Are and How to Build Them
An agent is asked to refund a duplicate charge. It reads your API catalog and finds three operations named create, update, and process. Each one is described as "Handles payment records." The agent picks process, sends the amount in dollars where the API expects cents, and gets back 400 Bad Request with an empty body. A developer in the same spot would read the docs, ask a teammate, or open the source code. The agent can only retry, guess again, or give up.
Most enterprise APIs were designed for developers who fill in missing context on their own. AI agents work only from what the API states. This guide defines what makes an API agent-ready and breaks it into four requirements you can build. It then maps each requirement to current standards and shows where to start. It is the pillar article in the broader agent-ready API series.
What Does "Agent-Ready" Actually Mean?
An agent-ready API is an API that AI agents can discover, understand, call, and evaluate without a human filling in the gaps. Its purpose, inputs, outputs, errors, and permissions are stated in a machine-readable form. Agent-readiness is a deliberate design property. It is different from an API that happens to work when an agent calls it. Agent-ready does not mean unsupervised. An API can be agent-ready and still require human approval for risky actions, such as payments or deletions. The MCP specification itself recommends that a person can deny tool invocations. The goal is to remove manual integration work, not oversight.
The difference shows up when no one is guiding the agent. An API with decent docs can work in a demo, because a developer wrote the prompt and chose the endpoint. The same API breaks down when an agent must choose among dozens of operations, recover from an error, or decide whether a retry is safe.
Three related terms are often used as if they were the same thing:
- Agent-ready API: A property of the interface. Any API can become agent-ready, whatever runs behind it.
- AI-ready API: A broader label for APIs prepared for AI consumption in general. That includes LLM-backed applications where a developer still wires up each call by hand.
- Agentic API: A term used inconsistently. Some teams mean an API designed for agents. Others mean an API that is itself backed by an agent. If you use it, say which meaning you intend.
Why This Matters Now
The primary consumer of many APIs is changing faster than API design practice. Postman's 2025 State of the API Report surveyed more than 5,700 developers and API professionals. It found that 89% of developers use AI, but only 24% design APIs with AI agents in mind. The same survey found that about half of developers (51%) named unauthorized or excessive API calls from agents as their top security concern.
Agents are a distinct class of consumer, not a faster developer. They have no intuition about your domain, and they cannot read between the lines. Traditional integrations already call APIs at machine speed. What is new is that an agent chooses which operations to call at runtime, and its plan can change from one run to the next.
| Human developer | AI agent | |
|---|---|---|
| How it learns the API | Reads the docs once and builds a mental model | Reads names, descriptions, and schemas in its context window when it decides on a call |
| When a name or field is ambiguous | Asks a teammate or reads the source | Picks the most plausible reading of the text it has |
| Call sequence | Fixed in code that the developer writes and tests | Chosen at runtime, and can change from one run to the next |
| Identity | A person or a registered application | Software acting on behalf of a user or a system, which needs its own delegated identity |
These differences change where the cost of a weak API shows up. With human consumers, a confusing endpoint costs developer time once, during integration. With agents, the same confusion can recur on every run, because the agent rereads the same ambiguous text each time it plans a call. Fixing the contract once removes a failure that would otherwise repeat in production.
None of this calls for a new kind of API. It calls for making explicit what human developers used to infer.
The Four Requirements of an Agent-Ready API
An API becomes agent-ready through four properties. Each one answers a question the agent cannot answer for itself.
| Requirement | The question it answers for the agent | What it covers |
|---|---|---|
| Clear semantics | What does this do, and what went wrong? | Names, descriptions, schemas, and error responses |
| Machine-readable exposure | How do I find this capability and call it? | A discoverable interface the agent runtime can call, such as MCP tools |
| Governance | Am I allowed to do this, and how often? | Identity, scopes, limits, and policy on side effects |
| Observability | What did I actually do? | Traces that follow a task across many tool calls |
Clear Semantics
An agent chooses an operation by reading text. As far as the model is concerned, operation names, descriptions, parameter schemas, and error bodies are the entire interface. Anything a human would learn from a hallway conversation has to be in the contract.
Compare these two partial OpenAPI fragments for the same operation. The first leaves the agent to guess.
paths:
/invoices:
post:
operationId: create
summary: Create
requestBody:
content:
application/json:
schema:
type: object
properties:
amount:
type: number
The second states the purpose, the side effect, the units, and the constraints.
paths:
/customers/{customerId}/invoices:
post:
operationId: createCustomerInvoice
summary: Create a draft invoice for an existing customer
description: >-
Creates an invoice in DRAFT status. This does not charge the customer.
Call sendCustomerInvoice to deliver the invoice.
parameters:
- name: customerId
in: path
required: true
description: ID of an existing customer, for example cus_123.
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [amountMinor, currency]
properties:
amountMinor:
type: integer
minimum: 1
maximum: 99999999
description: Whole number in the currency's minor unit,
for example cents for USD. Fractions are rejected, not rounded.
currency:
type: string
enum: [USD, EUR, GBP]
description: ISO 4217 code. Only USD, EUR, and GBP are
accepted.
Both fragments are partial. A complete operation also documents its success response and each error response. For money fields, state the allowed currencies, the unit, the precision, the bounds, and whether values are rounded or rejected. A three-letter pattern only checks the shape of a currency code. It does not tell the agent which codes the API accepts. Add examples for fields with a non-obvious format, and list enum values explicitly. An example shows the expected format directly, so the agent does not have to infer it from a sentence of prose. For a full walkthrough of these fields, see OpenAPI for AI agents.
The same discipline applies to errors. A bare 400 gives the agent nothing to correct. A structured error body that names the field, the rule, and the received value lets it fix the call and try again. RFC 9457 defines a standard format for this, called problem details, served as application/problem+json.
Treat the specification as a live contract rather than a documentation artifact. Lint it in CI and fail the build when an operation lacks a description or an error response is undocumented. When the spec drifts from the implementation, an agent is the first consumer to fail, because it trusts the spec completely.
Machine-Readable Exposure
An agent needs a machine-readable, discoverable interface that its runtime can use. MCP is one way to provide it. Tool or function definitions in the agent's own framework, generated from your OpenAPI description, are another. The Model Context Protocol (MCP) is an open protocol that lets AI applications discover and call external tools. A client asks an MCP server for its tools with tools/list. Each tool has a name, a description, and an inputSchema. It can also declare an outputSchema and annotations that describe its behavior (MCP specification, tools). The client then invokes a tool with tools/call.
Of the four requirements, exposure is the one where a converged standard, MCP, has emerged. Since December 2025, MCP has been stewarded by the Agentic AI Foundation under the Linux Foundation. The other requirements still draw on several competing or partial approaches.
MCP does not replace your REST API. Applications keep calling the REST API. MCP tools are a curated surface for agents over capabilities you already own (REST API vs MCP covers when to add that layer). The design question is which tools to offer, and the answer is rarely "one per endpoint." A tool such as get_order_status that returns the order, its shipment, and any open refund is easier for an agent to use than three tools that each return one part. Anthropic's engineering guidance on tools for agents makes the same point. It recommends choosing tools deliberately and consolidating related operations instead of wrapping every endpoint (Anthropic, Writing effective tools for agents). For a comparison of the wider integration patterns, see AI agent API integration.
Two details in the specification matter for safety and recovery:
- Annotations are hints, not controls. Annotations such as
readOnlyHintanddestructiveHintdescribe intended behavior. Clients must treat them as untrusted unless the server is trusted. Enforce read-only and destructive boundaries in authorization, not in tool metadata. - Validation errors go back to the model. The 2025-11-25 revision clarified that input validation failures should be returned as tool execution errors, with
isError: true, rather than as protocol errors. That lets the model see the problem and correct its call.
Governance
An agent acts on behalf of someone. Governance answers two questions for every call: who is calling, and what are they allowed to do?
- Authentication that works without a person present. Login flows that depend on a browser session or a CAPTCHA stall an unattended agent. When the agent acts under its own identity, the OAuth 2.0 client credentials grant issues it a token as a client. When it acts for a user, use the authorization code flow with PKCE, which protects the authorization code from interception. The MCP authorization specification builds on these. It requires MCP clients to use PKCE and to send a resource indicator. The resource indicator binds each token to the MCP server it is meant for.
- Scopes per action, not per API. Separate read access from write access. A token that can list invoices should not be able to void them. Map scopes to individual operations or tools so that a narrow task gets a narrow token. Permission models for AI agents covers this in depth.
- Limits sized for loops. Apply rate limits and quotas per agent identity, not only per application. A misconfigured agent can retry the same call far faster than a person would notice.
- Explicit side effects. State in the contract whether an operation changes data. On write operations, accept a client-supplied idempotency key and return the original result when the same key arrives again. Bind each key to the operation and its parameters, and reject a request that reuses a key with different parameters. Without that, a timeout followed by a retry can create a second payment.
- Policy enforced outside the model. Tool descriptions and system prompts guide behavior, but they do not control access. Enforce permissions where the call is received, at the API or at a gateway in front of it.
Observability
A request log can tell you that POST /refunds returned 201. It cannot tell you why the agent called it, what the agent read first, or whether the agent called it twice. Agent observability means following the task, not the single request.
In practice, that requires a few things:
- One trace per task. Propagate a trace ID across every tool call in a multi-step task. The W3C Trace Context
traceparentheader is the common format for carrying it between services. - Identity on every span. Record the agent's identity and, where relevant, the user it acts for.
- What was called, and with what. Capture the tool or operation name, the arguments with sensitive values redacted, the result status, and the latency.
- Model calls correlated, not merged. Calls to the LLM and calls to your tools are separate traffic with separate costs. Keep them as separate spans in the same trace, so you can see which model turn led to which tool call.
A trace built this way answers the questions that come up in an incident review. Which user asked for this refund? Which tool results did the agent read before it acted, and did a guardrail change what the model saw? How much did the task cost in model tokens? When those answers live in separate systems, every review becomes a manual join across log stores.
Treat agent traces as audit data. Tool arguments and results can contain personal information, so apply the same retention and access rules you use for other sensitive logs.

An agent-ready API is discoverable, understandable, callable, and accountable, with human approval where risk requires it.
The Emerging Standards Landscape
Each requirement draws on standards at different stages of maturity. Some have been stable for years. Others changed in the past few months. A published version does not mean every SDK or gateway supports it yet.
| Standard | Used for | Steward | Status in October 2026 |
|---|---|---|---|
| OpenAPI | API contracts and schemas | OpenAPI Initiative | Stable. Version 3.2.1 is the current patch release. Version 3.2.0 was released in September 2025 |
| Arazzo | Multi-step API workflows | OpenAPI Initiative | Version 1.1.0 is current |
| llms.txt | An entry point for LLMs reading a site | Community proposal | A proposal, not a ratified standard |
| MCP | Exposing tools to agents | Agentic AI Foundation | Revision 2026-07-28 is the current revision |
| A2A | Agent-to-agent delegation | Agentic AI Foundation | Version 1.0 was released in March 2026. Version 1.0.1 is the latest release |
| OAuth 2.0 with PKCE | Delegated authorization | IETF | Stable RFCs. MCP authorization servers must implement OAuth 2.1 |
MCP shows how fast this layer is still moving. Under the 2026-07-28 revision, every request carries its own protocol version and client capabilities in request metadata. If you publish MCP servers, pin the revision you target and test your clients against it. A2A plays a different role from MCP. MCP connects an agent to tools and data, while A2A lets one agent discover another through an Agent Card and delegate a task to it.
There are also community efforts to describe agent-readiness as a whole. AgentReady is one attempt. It is an MIT-licensed specification from Ora, Vercel, Mintlify, Auth0, and Stripe. It groups practices into find, read, and act, and assigns each a MUST, SHOULD, or MAY level. One finding from its agent studies is practical for API teams. Agents reached agent-facing files such as llms.txt mostly by following links, not by guessing paths. Publishing a discovery file is not enough on its own. Link it from pages that agents already visit, such as your docs.
AgentReady covers much more than APIs, including crawler access, payments, and in-page tools. The four requirements in this guide are a narrower cut, aimed at the teams that own and operate APIs.
What Happens When an API Isn't Agent-Ready
When one of the four requirements is missing, the failure rarely looks like an outage. It looks like an agent that does the wrong thing quietly.
- The capability is invisible: If an API is not published with clear metadata in a place agents can find, then for an agent it does not exist. The agent works around it or reports that the task is impossible.
- The call is malformed: An undocumented enum is a common cause. Your API expects
status=OPEN, the agent sendsstatus=open, and the filter silently returns nothing. The agent then reports, with confidence, that there are no open orders. - The error is a dead end: A
500or an empty400gives the agent no signal. It repeats the same call, tries an unrelated operation, or stops. Each of these is worse than a clear error it could act on. - The side effect happens twice: A payment call times out, the agent retries, and both requests succeed. Without idempotency, the API has no way to recognize the retry.
- No one can explain what happened: After an incident, the logs show a set of unrelated requests. Without a shared trace and an agent identity, nobody can reconstruct the sequence or say which user it acted for.
How to Start Making Your APIs Agent-Ready
You do not need to change every API at once. Start where agents already create real operational pressure. These are the usual signals that it is time to act:
- Coding assistants or internal copilots already call your APIs.
- Teams use more than one model or provider and need the same policy across all of them.
- Finance or platform teams need to attribute model spend to applications or teams.
- Prompts or tool results can contain personal or regulated data.
- Agents perform writes in production, not only reads.
Once one of those applies, work through the requirements in a fixed order:
- Pick a small set of capabilities. Choose the tasks agents most need, not the whole API estate.
- Repair the contract. Rewrite operation IDs and descriptions, document units and enums, and add structured error bodies. Add spec linting to CI so the contract stays clean.
- Publish for discovery. List the APIs in a catalog that serves machine-readable specs. Link an llms.txt index from your docs. Match discovery to the audience, so internal agents find internal APIs through authenticated discovery. Hiding an API from an index is not access control, so enforce authorization on every call.
- Design the tool layer. Define a few task-shaped tools over those capabilities, for example as MCP tools. Test them with real agent runs and refine the descriptions where agents choose wrongly.
- Put policy at the edge. Give each agent its own identity, scope tokens per tool, set per-agent limits, and require idempotency keys on writes.
- Trace from the first call. Turn on task-level tracing before the first production rollout, not after the first incident.
How WSO2 Makes APIs Agent-Ready
WSO2 API Platform manages APIs and AI traffic from a single control plane. WSO2 launched the platform in March 2026 with agent-readiness as its stated goal. The platform is built to control traditional APIs and AI assets, such as models, MCP servers, and prompts, together. Each of the four requirements maps to a specific part of the platform.

Tool calls and model calls take independent paths under separate policies. Neither passes through the other.
The two paths through the AI Gateway in the diagram are independent. A tool call travels from the agent to an MCP server under MCP policies. A model call travels from the agent to an LLM provider under LLM policies. Neither path passes through the other. The control plane distributes policy to the gateway and collects analytics from both paths.
Clear semantics: rules on the contract
API Governance validates OpenAPI and AsyncAPI definitions against Spectral-based rulesets. Rulesets are grouped into policies, and results appear on a compliance dashboard. Teams can also check APIs against guideline documents written in natural language, using AI-assisted analysis (API Governance overview). Violations, such as a missing description, are flagged on the compliance dashboard when the API is updated, rather than surfacing as a failure in an agent run. Governance policies currently notify rather than block, so add a blocking check to your CI/CD pipeline if a release must stop on a violation.
MCP exposure and discovery: one catalog for people and agents
The API Portal and MCP Hub generates an llms.txt index on request. It also serves the catalog, documentation, and specifications as Markdown and raw specification files. Publishers can hide an individual API from agent-facing surfaces while keeping it visible to human developers in the portal (AI agent discovery). Visibility controls what an agent can find, not what it can call, so authorization still applies at the gateway. MCP servers published to the MCP Hub appear in the same index, so agents and developers read from one source.
Governance: policy at the AI Gateway
For tool traffic, the AI Gateway applies three MCP policies. MCP Authentication follows the MCP specification's authorization profile. MCP Authorization checks access to specific tools, resources, and prompts using JWT claims or OAuth scopes. MCP Access Control filters the tool list with allow and deny rules, so a filtered tool is never offered to the caller (MCP governance). For model traffic, the same gateway applies guardrails such as PII masking and JSON Schema validation, token-based rate limits, and cost-based budgets. It can also front A2A agents and serve their Agent Cards.
Observability: one view across API, LLM, and MCP traffic
The gateway produces logs, traces, and analytics. MCP analytics show tool usage, agent sessions, and the distribution of clients. LLM analytics show token usage for model traffic. Platform-level views break traffic down across APIs, LLM proxies, and MCP (Observe MCP traffic on the AI Gateway). Because the views share one control plane, a team can review API, model, and tool traffic in one place.
Conclusion
An API becomes agent-ready through four properties you can build and test. Those are clear semantics, machine-readable exposure, governance designed for automated callers, and observability into what agents actually did. A label does not make an API agent-ready. A contract an agent can read without help does.
Start with one capability that agents already need. Fix its contract, publish it where agents look, put policy in front of it, and trace every call. To see how these pieces work together under a single control plane, explore WSO2 API Platform.
Frequently Asked Questions
Is agent-ready the same as AI-ready?
No. Agent-ready is narrower. It means an autonomous agent can find, call, and recover from errors on an API without a person interpreting the API for it.
Do I need MCP if agents can already call my REST API?
Not always. Agents can call well-described REST APIs directly. MCP adds a standard way to discover tools and a task-shaped surface designed for model use.
Is llms.txt an official standard?
No. It is a community proposal from 2024. Publishing one takes little effort and gives agents a clear place to start.
Can an agent use the same API key as the application it runs in?
It can, but you lose the ability to tell the agent's actions apart. A separate identity per agent makes per-agent scopes, limits, and audit trails possible.
Where should agent permissions be enforced?
At the point where the call is received, such as the API or a gateway in front of it. Prompts and tool descriptions are not access controls.