# MCP tools

> Reference for every tool Deer's MCP server exposes, with inputs, required scope and risk, and the approval retry for task deletion.

Source: https://docs.deerapp.co/en/connect/mcp_tools/

## How tools work

Each MCP tool is a Deer action, and the tool name is the action id, for example `tasks.create`. The input schema the client receives is generated from the same definition the interface uses, so a model fills in the same fields a person does.

`tools/list` returns only the tools the connection may use right now. A tool appears when both of these allow it:

- the connection's scope: `tasks:read` or `tasks:write`, and
- the current permissions of the person who created the connection.

Each tool also carries standard MCP annotations: `readOnlyHint` is `true` for `tasks.list`, `destructiveHint` is `true` for `tasks.delete`, and `openWorldHint` is `false` for all of them because they only touch your workspace.

## Tool summary

| Tool | What it does | Scope | Risk | Approval |
| --- | --- | --- | --- | --- |
| `tasks.list` | Lists tasks, filtered by assignee, team, status or overdue state. | `tasks:read` | Read | No |
| `tasks.create` | Creates a task. | `tasks:write` | Write | No |
| `tasks.update` | Edits an existing task. | `tasks:write` | Write | No |
| `tasks.set_status` | Changes a task's status. | `tasks:write` | Write | No |
| `tasks.assign` | Sets the people assigned to a task. | `tasks:write` | Write | No |
| `tasks.add_comment` | Adds a comment to a task. | `tasks:write` | Write | No |
| `tasks.set_subtask` | Checks or unchecks a subtask. | `tasks:write` | Write | No |
| `tasks.delete` | Moves a task to trash. | `tasks:write` | Destructive | Always |

A connection with **Read** access sees `tasks.list` only. **Read & write** includes all eight.

## Identifiers

Tools refer to records by their internal id, not by their display key:

- `task` is the task's `id` from `tasks.list`, not its key such as `APP-145`.
- `project` is a team id. Tasks returned by `tasks.list` include `projectId`.
- `assignee` and the entries of `assignees` are person ids. Tasks include `assigneeId` and `assigneeIds`.

There is no tool for looking up people or teams by name yet. Use the ids returned with existing tasks.

## Tool reference

### tasks.list

All fields are optional. With no input, the tool returns every task you can see.

| Field | Type | Notes |
| --- | --- | --- |
| `assignee` | string | Person id. |
| `project` | string | Team id. |
| `status` | string | `backlog`, `todo`, `in-progress`, `in-review` or `done`. |
| `overdue` | boolean | `true` for open tasks past their due date. |

Each task in the result has `id`, `key`, `title`, `status`, `priority`, `due`, `projectId`, `assigneeId` and `assigneeIds`.

### tasks.create

| Field | Type | Notes |
| --- | --- | --- |
| `title` | string | Required. 1 to 1000 characters. |
| `description` | string | Up to 20,000 characters. |
| `project` | string | Team id. The team must not be archived. |
| `assignee` | string | One person id. |
| `assignees` | string | A JSON array of person ids, sent as a string: `"[\"<person-id>\"]"`. |
| `priority` | string | `urgent`, `high`, `medium` or `low`. Default `medium`. |
| `status` | string | Same values as `tasks.list`. Default `todo`. |
| `due` | string | A date, `YYYY-MM-DD`. |
| `repeat` | string | `none`, `daily`, `weekdays`, `weekly` or `monthly`. |
| `blockedBy` | array | Up to 20 task ids that block this task. |

The result includes `entity` with the new task's `id`.

### tasks.update

`task` is required. Every other field from `tasks.create` is optional and changes only what you send. An empty `project` removes the task from its team, and an empty `due` clears the date. Two extra fields:

| Field | Type | Notes |
| --- | --- | --- |
| `labels` | string | A JSON array of up to 25 labels, each `{ "ar": "...", "en": "..." }`. |
| `commentChannels` | string | A JSON array of linked channel ids for comment mirroring. `"[]"` keeps comments on the task only, `"null"` uses all eligible linked channels. |

Blockers cannot form a cycle. Marking a repeating task `done` creates its next occurrence once.

### tasks.set_status

| Field | Type | Notes |
| --- | --- | --- |
| `task` | string | Required. |
| `status` | string | Required. `backlog`, `todo`, `in-progress`, `in-review` or `done`. |

### tasks.assign

| Field | Type | Notes |
| --- | --- | --- |
| `task` | string | Required. |
| `assignee` | string | One person id. |
| `assignees` | string | A JSON array of person ids as a string. `"[]"` removes everyone. |

Send `assignee` or `assignees`. Each person must be a member of the workspace.

### tasks.add_comment

| Field | Type | Notes |
| --- | --- | --- |
| `task` | string | Required. |
| `text` | string | Up to 20,000 characters. |
| `uploads` | array | Items of `{ "name", "mime", "content" }`, with base64 `content`. |

Send `text`, `uploads` or both. A comment can include up to five PNG, JPEG, WebP or GIF images and one WebM, MP4 or Ogg audio recording, up to 10 MiB combined. With `mcp-remote`, as in the Claude Desktop setup, keep total attachments under about 7.5 MiB to allow for base64 and the rest of the message. If the task team has linked comment channels and you can post in them, Deer mirrors the comment there.

### tasks.set_subtask

| Field | Type | Notes |
| --- | --- | --- |
| `task` | string | Required. |
| `index` | integer | Required. The subtask position, starting at `0`. |
| `done` | boolean | Required. |

### tasks.delete

| Field | Type | Notes |
| --- | --- | --- |
| `task` | string | Required. |
| `_moeen_approval` | string | The approval id, sent only when you retry after approval. |

The task moves to trash for 30 days, where a person with access to it can restore it in Deer. The first call never deletes: it creates an approval request.

## Results

Every `tools/call` result has one `text` content item that holds a JSON object, and `isError` is `true` when the action did not succeed.

```json
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"ok\":true,\"message\":{\"ar\":\"حُفظ التغيير.\",\"en\":\"Change saved.\"},\"entity\":{\"kind\":\"task\",\"id\":\"<task-id>\",\"label\":{\"ar\":\"Draft the launch email\",\"en\":\"Draft the launch email\"},\"href\":\"/tasks?open=<task-id>\"},\"data\":{\"entity\":{\"kind\":\"task\",\"id\":\"<task-id>\",\"label\":{\"ar\":\"Draft the launch email\",\"en\":\"Draft the launch email\"},\"href\":\"/tasks?open=<task-id>\"}}}"
      }
    ],
    "isError": false
  }
}
```

`message` is always given in Arabic and English. When a call fails, the object carries a stable `code` instead. See [Errors and approvals](https://docs.deerapp.co/en/developers/errors_and_approvals/).

## Retry a write without duplicating it

Some write tools that run without approval accept the optional `_moeen_idempotency_key` argument. Check the tool schema in `tools/list`. Use a unique value per intended change, such as a UUID, with 1 to 128 visible ASCII characters.

After a timeout, repeat the same call with the same key and arguments from the same MCP connection within 24 hours. Deer returns the first result without repeating the change. Reusing a key with different arguments returns `IDEMPOTENCY_CONFLICT`. `tasks.delete` uses a single-use approval ID instead.

## Approval flow

`tasks.delete` is the only MCP tool that needs a person's approval. The person who approves is the one who created the connection.

#### The client asks
The client calls `tasks.delete` with the task id.

#### Deer records a request
Deer does not delete anything. It returns `isError: true` with the code `MCP_APPROVAL_REQUIRED` and an `approvalId`, and records the attempt as pending approval in the audit log.

#### The owner decides
The connection owner opens **Settings**, then **MCP**, and finds the request under **Approval requests**. They select **Approve deletion** or **Reject**.

#### The client retries
After approval, the client calls `tasks.delete` again with exactly the same arguments, plus `_moeen_approval` set to the approval id. Deer deletes the task and marks the approval as used.

The first call and its response:

```json
{"jsonrpc":"2.0","id":7,"method":"tools/call","params":{"name":"tasks.delete","arguments":{"task":"<task-id>"}}}
```

```json
{"jsonrpc":"2.0","id":7,"result":{"content":[{"type":"text","text":"{\"ok\":false,\"message\":{\"ar\":\"ينتظر الإجراء موافقتك داخل دير.\",\"en\":\"The action is waiting for approval in Deer.\"},\"data\":{\"code\":\"MCP_APPROVAL_REQUIRED\",\"approvalId\":\"<approval-id>\"}}"}],"isError":true}}
```

The retry after approval and its response:

```json
{"jsonrpc":"2.0","id":8,"method":"tools/call","params":{"name":"tasks.delete","arguments":{"task":"<task-id>","_moeen_approval":"<approval-id>"}}}
```

```json
{"jsonrpc":"2.0","id":8,"result":{"content":[{"type":"text","text":"{\"ok\":true,\"message\":{\"ar\":\"حُفظ التغيير.\",\"en\":\"Change saved.\"},\"data\":{}}"}],"isError":false}}
```

## Approval rules

- **Same request only.** The approval covers that tool, those exact arguments and the task as it was. If the task changes before the decision, Deer cannot approve the stale request; ask again.
- **Fifteen minutes.** A request expires 15 minutes after the first call, approved or not.
- **One use.** An approval id works once. A second retry with the same id is refused.
- **Repeats are merged.** Calling again with the same arguments while a request is open returns the same `approvalId`, and no new request is created.
- **Up to 20 open requests** per connection. Beyond that, calls return `MCP_TOO_MANY_APPROVALS` until requests are decided or expire.
- **Rejected or expired.** A retry with the id returns `MCP_APPROVAL_REQUIRED`. Call again without `_moeen_approval` to create a new request.
- **Only where needed.** Sending `_moeen_approval` to any other tool returns the JSON-RPC error `Invalid approval ID`.
- **Revocation clears.** Revoking a connection deletes its open requests.

- [MCP](https://docs.deerapp.co/en/connect/mcp/) Create, configure and revoke a connection.
- [Errors and approvals](https://docs.deerapp.co/en/developers/errors_and_approvals/) Every error a client can receive.
- [Tasks](https://docs.deerapp.co/en/workspace/tasks/) How tasks, teams and trash work in Deer.
