> ## 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.

# Give your model Agentcard's instructions

> Start your model's system prompt with the instructions Agentcard recommends, so it describes what Agentcard buys the way Agentcard does.

Put `appInstructions()` at the start of your model's system prompt. Your model then describes what Agentcard can do in Agentcard's own words, and sends every shopping request to the buy tool.

```ts agent.ts theme={null}
import { appInstructions } from '@agent-cards/commerce-sdk';

const system = appInstructions({ markdown: true });
```

## Pass the instructions to your model

Use the string as your system prompt, with the buy tool beside it. `buy` is the tool you build for the shopper, as the [quickstart](https://docs.agentcard.com/commerce-sdk/quickstart.md) shows. Its `sendLink` hands your app each link: a step the shopper opens, such as the one to add a card, and each product or store card, where a flight option carries no URL. [Sending each link](https://docs.agentcard.com/commerce-sdk/guides/sending-each-link.md) shows every kind:

```ts agent.ts theme={null}
import Anthropic from '@anthropic-ai/sdk';
import { appInstructions, buyTool } from '@agent-cards/commerce-sdk';

const buy = buyTool({
  agentcard,
  externalUserId: shopper.id,
  sendLink: (link) =>
    ['vault', 'approval', 'store_login'].includes(link.kind)
      ? sendStep(shopper.id, link) // your code: a step the shopper opens
      : sendCard(shopper.id, link), // your code: a product or store card
});

const answer = await new Anthropic().beta.messages.toolRunner({
  model: 'claude-sonnet-5-5',
  max_tokens: 16000,
  system: appInstructions({ markdown: true }),
  tools: [buy],
  messages,
});
```

The buy tool's own description tells the model how to call the tool and what each answer means. `appInstructions()` tells the model what Agentcard can do for the shopper and how to write.

## Say how your app shows text

Pass `markdown: true` when your app shows the model's words as Markdown. A shopper who asks for a table then gets a table. Leave it out when your app shows plain text, such as an SMS chat: the model writes no Markdown and starts each list line with `• `.

Pass `textingStyle: true` when your app is a chat that writes in lowercase, the way a person texts. Pass the same value you pass to `buyTool`, so the model's words and Agentcard's read alike.

```ts agent.ts theme={null}
const system = appInstructions({ markdown: false, textingStyle: true });
```

## Add your own lines

Write your own lines after Agentcard's, and keep them about your app, such as its name or the current date.

```ts agent.ts theme={null}
const system = [
  appInstructions({ markdown: true }),
  'You are the shopping assistant in Acme. Each message opens with the shopper\'s local time.',
].join('\n\n');
```

Leave out lines about which stores Agentcard reaches or how to format a reply. `appInstructions()` covers both, and its text changes with each SDK release.

A line of your own that says "no markdown" or "most online stores" contradicts Agentcard's instructions. The shopper then reads two different answers in one chat.

## See what your model reads

Print the string to read it. The block below shows the first lines of a call with `markdown: true` and `textingStyle: true`.

```text theme={null}
You help a shopper buy what they ask for, with the `buy` tool from Agentcard.

When the shopper asks what you can do, answer from these lines without calling the tool:
```

The text ships inside the package, so your app makes no request to read it.

`APP_INSTRUCTIONS_VERSION` names the version of the text you run. Log it with each conversation to know which instructions your model had.


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