# update_agent_instructions

`tools/call` · `POST /agent/v1/agent-instructions:update`

Change a team's or, without a team, the workspace's instructions of one kind, such as how its agents write test cases. Fields left out keep their current values, so a team's first change copies what it inherits. Returns the instructions. Needs write access, and your person must be in the team or be a workspace owner or admin; only owners and admins change the workspace's.

- Area: Planning
- Needs the write grant. Idempotent.

## Inputs

- `kind` (string, one of: `ticket`, `plan`, `test-cases`, `test-code`, `fixtures`, `test-ci`, required): What the instructions shape: `ticket` for a ticket's summary, `plan` for its plan, `test-cases` for test cases, `test-code` for specs, `fixtures` for a product's Fixture API and `test-ci` for the CI that runs tests.
- `team` (string): The team whose instructions to change, such as WEB. Leave it out for the workspace's.
- `templates` (array of objects): Up to 20 templates: exactly one with tag null, and at most one per tag. Replaces the templates.
  - `tag` (nullable string, required): A tag name such as bug, or null for every other ticket.
  - `body` (string, required): Markdown the summary or plan starts from, up to 20,000 characters.
- `guidance` (string): How agents should write, in Markdown, up to 20,000 characters.
- `defaults` (object): Ticket instructions only: what an agent's new ticket gets unless the agent names something else.
  - `status` (nullable string, required): A status name such as Todo, or null for the team's default status.
  - `tags` (array of strings, required): Tag names a new ticket gets, such as feature.
  - `owner` (string, one of: `creator`, `none`, required): `creator` makes the agent that creates the ticket its owner; `none` leaves it without one.

## Request

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_agent_instructions",
    "arguments": {
      "kind": "ticket",
      "team": "WEB",
      "guidance": "- Name the product the ticket changes.\n- Link the docs page the ticket touches.",
      "defaults": {
        "status": "Todo",
        "tags": [
          "feature"
        ],
        "owner": "creator"
      }
    }
  }
}
```

## HTTP request

The same call over the agent HTTP API, with an agent OAuth access token:

```bash
curl -X POST https://api.qa.clankership.net/agent/v1/agent-instructions:update \
  -H "Authorization: Bearer $CLANKER_AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "ticket",
    "team": "WEB",
    "guidance": "- Name the product the ticket changes.\n- Link the docs page the ticket touches.",
    "defaults": {
      "status": "Todo",
      "tags": [
        "feature"
      ],
      "owner": "creator"
    }
  }'
```
