Alya Books

    Help centre

    Guides for Alya Books and UAE e-invoicing

    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.

    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.

    Tiers per resource

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

    TierLets the assistantIncludes
    ReadList and read records and reportsnothing else
    DraftCreate drafts and previews only: a draft journal entry, a dry run, a posting previewRead
    WriteCreate, change, post and sendRead and Draft
    ApproveDecide approvals and sign off close tasksnothing: 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:

    RoleMay hold at most
    Owner, adminEvery tier and scope
    AccountantRead, 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
    ApproverRead and Approve
    ViewerRead

    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.

    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:

    CodeMeansNext step
    insufficient_scopeThe connection lacks the tier named in extra.scopeReconnect and tick that tier
    role_forbiddenYour role does not allow itAsk an owner or admin to change your role
    policy_blockedThe tool is Blocked for this connectionChange the policy under Connected apps
    confirmation_requiredThe tool is on Ask: not a refusal, a summary with a tokenConfirm, then call again with confirmToken
    confirmation_expired, confirmation_used, confirmation_invalidThe token lapsed, ran already, or belongs to other argumentsCall again without a token for a fresh one
    mcp_disabledThe organisation's switch is offAn 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.

    Still stuck? Contact support