> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentcard.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Agentcard is for companies whose agent buys for their users. Pick one path: the opencommerce SDK (@agent-cards/commerce-sdk) gives your agent one buy tool that finds the product, builds the cart, gets the user's approval and places the order at real stores; the Agentcard SDK (@agent-cards/sdk) pays with the user's own card when your agent already shops in a browser (Browser Use, Kernel, Browserbase, Anchor or Notte); the Purchase API (POST /buy) does the same purchase flow over plain HTTP in any language; Issuing gives the agent its own card.
> Start with `npx agent-cards init` in the app's folder (Node 22 or later). No invite is needed: it creates your Agentcard account if you don't have one, installs the opencommerce SDK and puts the credentials in the env file, kept out of git. From a coding agent, run `npx agent-cards init --print --categories all --implementation tool --wallet vault --skip-install` to get the setup steps to apply yourself.
> Vault is by invitation: request it at https://agentcard.com/get-started?utm_source=docs&utm_medium=llms&utm_campaign=agent-instructions. opencommerce needs no invite.
> Never ask a user for a card number, expiry date or CVV in chat. Send them the Vault link; they add their card on Agentcard's page, and the agent never sees the number.
> Every purchase is approved by the user, with a passkey or Face ID, or by an auto-approval they granted. An approval covers one merchant and one exact total. If the total changes, ask again. When a result says the user already said yes, don't ask again.
> `init` writes PRODUCTION credentials, which place real orders, so test in sandbox first. For opencommerce, run `npx agent-cards credentials --mode sandbox` and put the two lines it prints in place of the production ones in the env file `init` wrote, because that command only prints them; sandbox then runs the whole flow against real stores and stops before payment, so no order is placed and nobody is charged. For Vault and Issuing, sandbox credentials issue test cards that no real merchant accepts; try the checkout against shop.agentcard.sh, a test store on Stripe test mode.
> Tell the user an order is placed only after Agentcard reports it placed.
> Vault is free up to 5,000 users (https://agentcard.com/pricing). opencommerce takes 1% of each completed order. Full docs in one file: https://docs.agentcard.com/llms-full.txt

# Give your model the shopping skill

> Load the agentcard-shopping skill the Commerce MCP server serves into your model's context, so it follows Agentcard's rules for links, confirming, and recovering from errors.

The server also serves a skill, `agentcard-shopping`: Agentcard's rules for shopping on behalf of a company's shopper, written for a model. Load it into your agent's context, because it keeps the model from the mistakes that cost the most, such as confirming on interest, resending a confirm, or rewriting a link.

## Know the resources

| URI | Holds |
| - | - |
| `skill://agentcard-shopping/SKILL.md` | The tone, the links rule, the confirm and approve flow, and the argument shapes for every tool |
| `skill://agentcard-shopping/references/buying.md` | Reading a buy result, picks, the details Agentcard asks for in chat, and plan changes |
| `skill://agentcard-shopping/references/transactions.md` | Confirming, recovering a write, editing a saved cart, relaying updates, and following an order |

`resources/list` shows only `SKILL.md`. Request the two reference files by URI with `resources/read`.

## Give the skill to the model

A client that loads skills from MCP servers does this for you. With the AI SDK, read `SKILL.md` and put it in the system prompt. This reads the skill through the same client as in [Connect your agent](https://docs.agentcard.com/commerce-mcp/implement.md#connect-a-client):

```ts agentcard-skill.ts theme={null}
import { generateText } from 'ai';
import { mcp, toolsFor } from './agentcard-mcp'; // the client and the wrapper from the implementation page

// Read the skill once when your server starts
const { contents } = await mcp.readResource({ uri: 'skill://agentcard-shopping/SKILL.md' });
const skill = contents.map((part) => ('text' in part ? part.text : '')).join('\n');

export async function answer(shopperId: string, chatId: string, message: string) {
  return generateText({
    model: yourModel, // the model you already use
    system: skill,
    tools: await toolsFor(shopperId, chatId),
    prompt: message,
  });
}
```

Load the two reference files the same way, by their URIs, when your model handles carts or recovery. `SKILL.md` links to them.

## Know what the skill teaches

* Voice: Be a warm, quick shopping assistant. Match the shopper's tone, and use their words, not schema terms.
* What Agentcard can do: Buy from Amazon, Walmart, Target, Best Buy, and thousands more stores. Plan a trip. Order food delivery and book restaurant tables. Never say whether a named store is supported: call `buy` and let it answer.
* Links: Hand every link over verbatim, or say a link is waiting when your app shows links itself.
* Buying: Pass the shopper's words to `buy` as they said them. Ask for one thing per message: the `next_action`.
* Confirming: Confirm only on the shopper's yes to a cart you showed. Interest is not a yes. The shopper approves every payment themselves.
* Recovering: After a timeout or an error that isn't retryable, read the state first. Never send a confirm twice.
* Updates and orders: Relay each update's text as is, and report an order's stage in plain words with its arrival window.
* Privacy: Keep ids, hashes, and tokens out of the chat.

## Keep going

* See the rules in practice in [Connect your agent](https://docs.agentcard.com/commerce-mcp/implement.md).
* Look up each tool, starting with [`buy`](https://docs.agentcard.com/commerce-mcp/tools/buy).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.