Get "PHP 8 in a Nutshell" (Now with PHP 8.5)
Amit Merchant
Amit Merchant

A blog on PHP, JavaScript, and more

APIs for Systems That Make Their Own Plans

feat. Canva, Stripe, and MCP

APIs have traditionally had a fairly predictable audience. There is an application on one side, a developer who wrote it, and an endpoint on the other side that does exactly what the developer asked it to do.

const response = await fetch('/api/products/123');
const product = await response.json();

The application already knows which endpoint to call, which parameters to send, and what the response means.

Now imagine asking an AI agent to prepare a product launch. It might need to find the product, generate an image, create a few designs, resize them for different channels, and export the final assets.

The interesting things here is not that each of those operations can be exposed through an API. We have been doing that for years.

What’s interesting is that the caller now has to discover what is available, decide which capability is useful, and work out the order in which to use several capabilities.

An API can be callable without being particularly understandable.

APIs were built for predictable callers

REST is still a good fit when an application needs precise control over a known operation. The developer chooses the endpoint and writes the workflow explicitly.

An agent starts from a different place. It may receive an outcome rather than a sequence of HTTP requests:

Create a launch kit for the new product and export versions for social media.

That instruction leaves several decisions open. Which design tool should it use? What information is required? Is the operation synchronous? Does the result need to be polled? Can the current user access the brand assets?

Those questions are not solved by making an endpoint technically available. They are solved by describing capabilities in a way that an agent can inspect and use.

This is the small but important shift: the API consumer is no longer always a program with a fixed plan. Sometimes it is a system that has to make a plan.

MCP makes capabilities discoverable

The Model Context Protocol (MCP) is an open protocol for connecting LLM applications with external data sources and tools. Its specification describes servers exposing resources, prompts and tools, with tools representing functions that an AI model can execute. The MCP specification is the useful reference here; MCP is a protocol for the interaction layer, not a replacement for the business logic behind it.

A tool can carry a name, a description and an input schema. That gives an agent more context than a bare URL and a list of parameters.

Here is a deliberately simplified example:

const tool = {
  name: 'create_campaign',
  description: 'Create an editable product launch campaign',
  inputSchema: {
    type: 'object',
    properties: {
      productId: { type: 'string' },
      formats: {
        type: 'array',
        items: { type: 'string' }
      }
    },
    required: ['productId', 'formats']
  }
};

This is a conceptual schema, not a Canva or Stripe tool definition. The point is the shape of the interaction: the agent can discover a meaningful capability, understand its inputs, and decide whether it belongs in the plan.

The description matters as much as the function name. create_campaign gives an agent a useful boundary. A collection of low-level calls such as create_page, insert_text, upload_asset and update_element may be flexible, but it also forces the agent to assemble more of the product’s internal workflow itself.

That does not mean every API operation should become a large, magical tool. It means the interface should expose the right level of intent for the caller.

One product, three useful surfaces

Canva’s developer update from November 24, 2026 is a good example of these surfaces existing together. Canva says its MCP server is generally available, alongside new REST APIs, an expanded CLI and service accounts. The announcement describes the three interfaces in practical terms:

  • MCP lets an agent discover and choose tools for an outcome.
  • REST APIs give an application precise, predictable control.
  • The CLI gives coding agents and command-driven workflows a focused interface.

Canva says 72% of commands typed into its CLI in October came from agents. That is a company-reported usage figure, not an industry-wide measurement, but it makes an important point: a CLI that was originally designed for people can become a useful agent interface too. An agent does not always need a large tool catalogue; for repetitive or bulk work, a focused command may be the simpler path.

The three surfaces should not become three different implementations of the same business rules. A healthier architecture looks more like this:

The interaction surface can vary. The security boundary should not.

Canva’s authentication details also show why these surfaces are not interchangeable. Its MCP integration uses a user’s Canva account and permissions, and its developer documentation says MCP does not support organization-level or service-account authentication. Canva’s REST API service accounts are intended for controlled backend access without asking each end user to sign in. The MCP guide and the service-account announcement make that distinction explicit.

An agent needs a safer place to make mistakes

The more capable the caller becomes, the more important its boundaries become.

An agent that can create a design is one thing. An agent that can issue a refund, change a subscription or move money needs a much more deliberate control model.

Stripe’s 2026 developer keynote showed a workflow that combines MCP, Stripe skills, the Stripe CLI and isolated sandboxes. The demonstrated agent used MCP to choose a Stripe integration, used the CLI to provision a sandbox, and created the integration against that isolated environment. Stripe’s keynote describes the demo and the reasoning behind combining these interfaces.

The sandbox is not just a convenience. It gives an agent a place to exercise real response behaviour without immediately operating on production data or money.

Stripe also introduced agent-tagged API keys in that keynote, treating an agent as a distinct actor whose actions can be observed and governed. Its approval documentation now describes rules that can pause sensitive actions for a designated reviewer, or block them outright. The supported examples include refunds, payment intents and subscription changes. Stripe’s approval rules are the source of truth for the current behaviour.

This is the part of agent-oriented API design that is easy to skip when the discussion stays focused on tool schemas. The agent needs to know not only what it can do, but also what happens when it reaches a boundary.

An approval should produce a structured result. A permission failure should explain the missing permission. A long-running operation should expose progress or a way to check its state. An operation that cannot be safely retried should say so.

Good errors are part of the interface too.

What should change in your APIs?

You do not need to replace a REST API because an agent may use it one day. You probably need to make the underlying capabilities easier to describe and safer to operate.

That can mean:

  • Designing tools around meaningful outcomes where that makes the workflow clearer.
  • Writing descriptions that explain intent, side effects and important constraints.
  • Keeping input and output schemas explicit and stable.
  • Returning structured errors that tell the caller what can be corrected.
  • Separating user authentication from service-to-service identities.
  • Applying authorization, validation and audit logging in the shared service layer.
  • Providing a sandbox or dry-run mode for operations with meaningful side effects.
  • Requiring human approval when the cost of a wrong decision is high.

Stripe’s current MCP documentation also makes a useful distinction between approval by the MCP client and approval enforced by Stripe itself. Those are different controls, and the service-side control still matters if the same action can arrive through REST, MCP, a CLI or the Dashboard.

That last detail is worth holding on to. If an action is sensitive, the protection should live at the action’s real boundary, not only in the interface that happened to call it.

The API is still the API

The arrival of agents does not make REST obsolete, and it does not make every endpoint need a conversational wrapper.

It does change what “developer experience” includes.

For a long time, developer experience meant readable documentation, good SDKs, useful examples and predictable responses. Those things still matter. Now there is another consumer to consider: a caller that reads the description, chooses the operation, supplies the arguments and reacts to the result without a developer spelling out every step.

That caller will expose the fuzzy edges in an API quickly. Ambiguous names, hidden prerequisites, inconsistent errors and undocumented side effects are difficult for humans too; agents simply encounter them at a much larger scale.

The next improvement to an API may not be another endpoint. It may be a better description of what the existing capability means, a safer way to invoke it, or a response that makes the next decision obvious.

The API is still the API, and it still needs the same things every caller has always needed: a clear contract, predictable behaviour and boundaries that hold.

I’d be curious to hear how you’re thinking about this. Are you exposing agent-facing tools as a separate layer, or are you making your existing REST and CLI interfaces easier for agents to understand?

References

👋 Hi there! This is Amit, again. I write articles about all things web development. If you enjoy my work (the articles, the open-source projects, my general demeanour... anything really), consider leaving a tip & supporting the site. Your support is incredibly appreciated!

Comments?