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

# save_preset

> Save a set of rules under a name so the user can reuse it in create_card or set_card_preset.

Connect to `https://mcp.agentcard.sh/mcp` with the **user's connection token** (or a `buy_token` for org-owned accounts).

## What it does

Save a set of rules under a name so the user can reuse it in create\_card or set\_card\_preset. Save a name that already exists and the change applies to cards created from now on; cards the user already has keep their rules. The built-in names `ai_labs`, `weekday_meals`, `cli_only`, and `daily` cannot be saved over. Pass the rule fields below, or a raw `privileges` array. The fields mean the same as the flags on [`cards preset save`](/tools/cli/cards-preset-save). Categories, `Strict` and `Watch`, places, currencies, and time windows are explained in [Set rules on a card](/issuing/set-rules-on-a-card).

## Inputs

| Field               | Type   | Description                                                                                                                                                                                                                                                                                                                     |
| ------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` *(required)* | string | A name for this preset, e.g. `meals-only`.                                                                                                                                                                                                                                                                                      |
| `total`             | number | Lifetime spend cap, in US dollars.                                                                                                                                                                                                                                                                                              |
| `per_day`           | number | Spend cap per rolling 24 hours, in US dollars.                                                                                                                                                                                                                                                                                  |
| `per_week`          | number | Spend cap per rolling 7 days, in US dollars.                                                                                                                                                                                                                                                                                    |
| `per_month`         | number | Spend cap per rolling 30 days, in US dollars.                                                                                                                                                                                                                                                                                   |
| `only_categories`   | string | Comma-separated spend categories to allow (strict), e.g. `meals,groceries` (`meals`, `groceries`, `travel`, `software`, `ai`, `wellness`, `retail`).                                                                                                                                                                            |
| `watch_categories`  | string | Categories in `Watch` mode (allow + notify on mismatch instead of refuse/pause): `meals`, `groceries`, `travel`, `software`, `ai`, `wellness`, `retail`. Spend caps, places, time windows, and merchant-only rules stay strict.                                                                                                 |
| `only_merchants`    | string | Comma-separated merchant name patterns to allow, e.g. `openai,anthropic`.                                                                                                                                                                                                                                                       |
| `only_in`           | string | Comma-separated places to allow charges from, e.g. `US,California` (a country or a US state).                                                                                                                                                                                                                                   |
| `only_currencies`   | string | The currencies the card may pay in, comma-separated, as codes or plain names in any case: `usd,eur` or `dollars,euros`. A charge in any other currency is refused and the user is told. A name that means several currencies, such as `pesos`, is refused when you save. Agentcard checks this rule; the card network does not. |
| `watch_currencies`  | string | The same list in `Watch` mode: a purchase in another currency is allowed and the user is told. Pass `only_currencies` or `watch_currencies`, not both.                                                                                                                                                                          |
| `only_days`         | string | Comma-separated days to allow, e.g. `mon,tue,wed` or `weekdays`/`weekends`.                                                                                                                                                                                                                                                     |
| `only_hours`        | string | An hour range to allow, e.g. `9-17` (24-hour clock; defaults to UTC without timezone).                                                                                                                                                                                                                                          |
| `timezone`          | string | IANA timezone for only\_days/only\_hours (default UTC), e.g. `America/Los_Angeles`. Always shown in summaries. Unknown zones are refused.                                                                                                                                                                                       |
| `only_from`         | string | Comma-separated callers to allow, e.g. `cli,mcp` (`cli`, `mcp`, `api`, `browser`).                                                                                                                                                                                                                                              |
| `privileges`        | array  | Advanced: raw privilege objects instead of the rule fields above.                                                                                                                                                                                                                                                               |

## Returns

| Field                  | Type   | Description                                           |
| ---------------------- | ------ | ----------------------------------------------------- |
| `message` *(required)* | string | Human-readable result or guidance for the next step.  |
| `preset`               | object | The saved preset: `id`, `name`, `version`, `summary`. |

## Example call

```json theme={null}
{
  "tool": "save_preset",
  "arguments": {
    "name": "lunch",
    "per_day": 25,
    "only_categories": "meals"
  }
}
```

A preset that keeps purchases in dollars or euros. Codes or names, any case; the summary reads `Currency: USD, EUR`:

```json theme={null}
{
  "tool": "save_preset",
  "arguments": {
    "name": "euro-zone",
    "only_currencies": "usd, euros"
  }
}
```

## Example error

An unknown category, captured from a local sandbox. `isError` is set and `structuredContent.status` carries the code:

```json theme={null}
{
  "content": [
    {
      "type": "text",
      "text": "Unknown category \"crypto\". Use meals, groceries, travel, software, ai, wellness, or retail."
    }
  ],
  "structuredContent": {
    "message": "Unknown category \"crypto\". Use meals, groceries, travel, software, ai, wellness, or retail.",
    "status": "policy_invalid"
  },
  "isError": true
}
```

A currency Agentcard cannot read answers the same way. `save_preset` with `"only_currencies": "pesos"`, captured from a local run:

```json theme={null}
{
  "content": [
    {
      "type": "text",
      "text": "\"pesos\" could be MXN, ARS, CLP, COP, or PHP. Write the currency code, or name the country (Mexican pesos)."
    }
  ],
  "structuredContent": {
    "message": "\"pesos\" could be MXN, ARS, CLP, COP, or PHP. Write the currency code, or name the country (Mexican pesos).",
    "status": "policy_invalid"
  },
  "isError": true
}
```
