# MCP scopes, tiers and tool permissions

> What an AI assistant may do in Alya Books: read, draft, write and approve tiers per resource, the ceiling of your role, per-tool Always, Ask or Blocked policies, the organisation switch, and how refusals read.

Source: /help/en/api/mcp-scopes-and-tool-permissions

An assistant connected over MCP (Claude, ChatGPT, Cursor and others) never gets more than three things allow at once: the **permissions chosen at consent**, **your role** in the organisation, and the **per-tool policy** set for the connection. The tool list the assistant sees is the intersection of the three; what it cannot see, it cannot call. This page is the reference; the setup per client is in [Connect Alya Books to Claude or ChatGPT](/help/en/api/connect-ai-assistants).

## Tiers per resource

Each resource (invoices and the ledger, supplier invoices, customers, products, settings) has four tiers:

| Tier | Lets the assistant | Includes |
|---|---|---|
| **Read** | List and read records and reports | nothing else |
| **Draft** | Create drafts and previews only: a draft journal entry, a dry run, a posting preview | Read |
| **Write** | Create, change, post and send | Read and Draft |
| **Approve** | Decide approvals and sign off close tasks | nothing: it is its own tier, never implied by Write |

The consent screen preselects **Read** for every resource. Tick Draft, Write or Approve only where the assistant needs it. In the API the tiers are scopes: `invoices:read`, `invoices:draft`, `invoices:write`, `invoices:approve`, and the same for `incoming`, `customers`, `products` and `settings`. Custom fields (`metadata:read`, `metadata:write`), webhooks (`webhooks:manage`) and period locks (`periods:manage`) keep their single scopes. A client that asks for the aliases `mcp:read` or `mcp:write` gets every read tier, or every read, draft and write tier; the approve tier is always chosen by hand.

Ledger, bank, schedules, close and corporate tax tools sit under the resource their data belongs to: posting an invoice is `invoices:write`, a bill is `incoming:write`, bank matching and the close checklist are `settings:write`, a preview is the `draft` tier and a sign-off the `approve` tier. Each tool's description names its scope and tier.

## Your role is the ceiling

A connection acts as the member who approved it, under that member's role. The consent screen offers nothing above the role, and the server checks again at every call:

| Role | May hold at most |
|---|---|
| Owner, admin | Every tier and scope |
| Accountant | Read, Draft and Write on every resource, except changing settings, webhooks and period locks; Approve only when the organisation's posting approval tiers name the accountant role |
| Approver | Read and Approve |
| Viewer | Read |

If your role changes later, the connection follows it at once: a member downgraded to viewer keeps a connection whose write tools no longer appear and whose write calls are refused with `role_forbidden`. A member who leaves the organisation loses the connection.

The routes and tools that need an owner or an admin (the administration settings, the AI settings, the tax engine, the organisation's prompts) check the member the connection acts for, whatever the scopes: a connection approved by an accountant is refused there with `forbidden_action`. See [API environments and keys](/help/en/api/environments-and-api-keys#scopes-and-tiers).

## Per-tool policies: Always, Ask, Blocked

Under the permissions, **Choose per tool** opens the list of tools the chosen tiers allow. Each tool has one policy:

- **Always allow**: the tool runs at once. The default for read tools.
- **Ask first**: the first call returns a summary and a token instead of running; the assistant shows you the summary and calls again with the token when you agree. The token lasts 10 minutes and runs once; a changed argument needs a new token. The default for every draft, write and approve tool.
- **Blocked**: the tool is removed from the list; the connection cannot call it even with the right tier.

Only policies that differ from the default are saved. After connecting, owners, admins and members who manage API keys change them under **Setup → API access → API keys → Connected apps → Policies**.

## The organisation switch

**Setup → API access → API keys → AI assistants (MCP)** is off for every organisation until an owner or admin turns it on. While it is off, no assistant can connect with a sign-in and an existing connection is refused with `mcp_disabled`; the consent screen says so. API keys are not affected by the switch. Every change is written to the audit log.

## Your own connections

**Settings → My account → Connected apps** lists every assistant you connected with your sign-in, across organisations, and lets you revoke any of them. The organisation-wide list for administrators stays under **Setup → API access → API keys → Connected apps**.

## Lists return at most 100 rows

Every list tool and list route returns at most 100 rows per page; a larger `perPage` is capped, never refused. Page with `page` to read more.

## How a refusal reads

Every refusal carries three things: a stable `code`, the database's own `message`, and `nextStep`, one sentence on what to do next. The code is the same whether the call came over REST, the CLI or an MCP tool, so an assistant matches on it and never routes around it:

| Code | Means | Next step |
|---|---|---|
| `insufficient_scope` | The connection lacks the tier named in `extra.scope` | Reconnect and tick that tier |
| `role_forbidden` | Your role does not allow it | Ask an owner or admin to change your role |
| `policy_blocked` | The tool is Blocked for this connection | Change the policy under Connected apps |
| `confirmation_required` | The tool is on Ask: not a refusal, a summary with a token | Confirm, then call again with `confirmToken` |
| `confirmation_expired`, `confirmation_used`, `confirmation_invalid` | The token lapsed, ran already, or belongs to other arguments | Call again without a token for a fresh one |
| `mcp_disabled` | The organisation's switch is off | An owner or admin turns it on |

The ledger's own codes (`period_locked`, `entry_unbalanced`, `approval_required` and the rest) arrive the same way, each with its next step. The full table is in [API errors and status codes](/help/en/api/error-handling).

## Related

- [Connect Alya Books to Claude or ChatGPT](/help/en/api/connect-ai-assistants)
- [API errors and status codes](/help/en/api/error-handling)
- [Users and roles](/help/en/account-and-setup/users-and-roles)
