# MCP tools

> Every tool and resource the MCP server offers, with its arguments and the scope it needs. Generated from the code.

Source: https://docs.ligament.ai/reference/mcp-tools/

The server is at `https://app.ligament.ai/api/mcp`. A key sees only the tools its scopes allow. Setup and examples: [MCP server](https://docs.ligament.ai/developers/mcp/index.md).

## Record tools

### `records_query`

Scope: `records:read:<entity>`

List records of an entity: filters (\[{field, op, value|values}\], ops eq ne contains empty not\_empty in lt lte gt gte), match all|any, sort ("-salary,name"), q (search), limit (≤ 200), offset. With asOf, effective-dated fields are as of that date and each row has \_effective (versions shown, which fields are current).

| Argument | Type | Description |
| --- | --- | --- |
| `entity` required | `string` | Entity key, e.g. person |
| `filters` | `object[]` |  |
| `match` | `"all" | "any"` |  |
| `sort` | `string` |  |
| `q` | `string` |  |
| `limit` | `number` |  |
| `offset` | `number` |  |
| `asOf` | `string` | Effective dating: a date YYYY-MM-DD (00:00 in the workspace time zone) or @today, @end\_of\_last\_month, @end\_of\_last\_quarter, @end\_of\_last\_year. Dated fields show their value on that date; other fields show today's; access is decided now. Records not started on that date are absent. |
| `knownAt` | `string` | As recorded at this instant (bitemporal: before later corrections). Needs records.as\_recorded or an audit:read key. |

### `records_get`

Scope: `records:read:<entity>`

One record by id. With asOf: as of that date (404 effective\_not\_started when it didn't exist yet), with \_effective.

| Argument | Type | Description |
| --- | --- | --- |
| `entity` required | `string` | Entity key, e.g. person |
| `id` required | `string` |  |
| `asOf` | `string` | Effective dating: a date YYYY-MM-DD (00:00 in the workspace time zone) or @today, @end\_of\_last\_month, @end\_of\_last\_quarter, @end\_of\_last\_year. Dated fields show their value on that date; other fields show today's; access is decided now. Records not started on that date are absent. |
| `knownAt` | `string` | As recorded at this instant (bitemporal: before later corrections). Needs records.as\_recorded or an audit:read key. |

### `records_history`

Scope: `records:read:<entity>`

An effective-dated record's history: versions per group (e.g. comp, job), newest first, with from/to, kind, reason, who, when recorded, status (scheduled, in\_force, past, superseded). include \["corrections"\] adds superseded versions (records.as\_recorded).

| Argument | Type | Description |
| --- | --- | --- |
| `entity` required | `string` | Entity key, e.g. person |
| `id` required | `string` |  |
| `group` | `string` |  |
| `include` | `"corrections" | "proposed"[]` |  |
| `knownAt` | `string` | As recorded at this instant (bitemporal: before later corrections). Needs records.as\_recorded or an audit:read key. |

### `records_changes`

Scope: `records:read:<entity>`

The changes feed for exports (payroll-style): changes RECORDED since recordedSince (an instant: your last watermark), new, corrected or rescinded, with the periods whose values changed and the values after (and before, for records.as\_recorded). Filter by group, effectiveFrom/effectiveTo, overlapsBefore (periods you already exported). Pass nextCursor to page; keep watermark.

| Argument | Type | Description |
| --- | --- | --- |
| `entity` required | `string` | Entity key, e.g. person |
| `recordedSince` required | `string` |  |
| `recordedUntil` | `string` |  |
| `group` | `string[]` |  |
| `effectiveFrom` | `string` |  |
| `effectiveTo` | `string` |  |
| `overlapsBefore` | `string` |  |
| `cursor` | `string` |  |
| `limit` | `number` |  |

### `records_change`

Scope: `records:write:<entity>`

Change a record. On an effective-dated entity pass effective: { from: "2027-03-01", reason: "merit", mode: "change" | "correction" | "rescind", version?, group? }: a change from a date (future = scheduled), a correction of the version in force on from (or with version + from, re-timing it), or a rescind of a version. Without effective, dated values change from today. Returns the record (today's values) and effective (versions written, warnings about later changes it rewrote).

| Argument | Type | Description |
| --- | --- | --- |
| `entity` required | `string` | Entity key, e.g. person |
| `id` required | `string` |  |
| `values` | `object` |  |
| `effective` | `object` |  |

## Access tools

### `access_whoami`

Scope: `records:read`

Who this key acts as here: user id, role (capped at the key creator's role), key scopes, and how access is decided (evaluator: v2 = roles, permission sets and restrictions decide; shadow = the previous access rules decide while the current ones are compared).

### `access_explain`

Scope: `records:read`

Why a principal may or may not do an action on an entity or one record: allow, reason (granted, no\_grant, forbidden, row\_mismatch, field\_level, app\_access, key\_scope), the fix, the row predicate in words, field levels, and the trace of rules that decided it. A record outside the scope is never described.

| Argument | Type | Description |
| --- | --- | --- |
| `entity` required | `string` | Entity key, e.g. incident |
| `action` | `"read" | "create" | "update" | "delete" | "transition"` | default read |
| `recordId` | `string` |  |
| `fields` | `string[]` |  |
| `principal` | `string | object` | Whom to explain: "self" (default), {"user": "<userId>"} or {"role": "<roleKey>"}. Others need an admin key. |

### `access_effective`

Scope: `records:read`

What a principal can do: per entity, each action (read, create, update, delete, transition) allowed or not with the reason and the rows in words, plus every field's level (hidden, read, write). Omit entity for all entities.

| Argument | Type | Description |
| --- | --- | --- |
| `entity` | `string` | Entity key, e.g. incident |
| `principal` | `string | object` | Whom to explain: "self" (default), {"user": "<userId>"} or {"role": "<roleKey>"}. Others need an admin key. |

### `access_plan`

Scope: `spec:read`

Dry-run changes to access artefacts (role/<key>, permissionSet/<key>, restriction/<key>, groupMapping/<groupId>, hierarchy/<key>, share/<key>) without writing: the spec plan (per item action, changes, errors, permission, whether a person must apply it) plus accessDiff, the effective-access diff: per affected role and member, per entity, action and field, what is gained, lost or changed, in words, with live row counts before → after. Apply with spec\_apply or a changeset. The key's creator needs the Build capability, or must be an app admin planning their own app's permission sets, roles and restrictions.

| Argument | Type | Description |
| --- | --- | --- |
| `items` required | `object[]` |  |

## Spec tools

### `spec_catalog`

Scope: `spec:read`

The catalog for writing valid spec docs: artefact types (with the build permission each needs), entities with their fields, roles, approved components and the page block registry.

### `spec_list`

Scope: `spec:read`

List the artefacts in the spec store (effective layer): address, type, key, app, layer, hash, customised, conflict count.

| Argument | Type | Description |
| --- | --- | --- |
| `type` | `"page" | "acl" | "role" | "permissionSet" | "restriction" | "groupMapping" | "hierarchy" | "share"` |  |
| `app` | `string` | App key, or \_\_tenant\_\_ for workspace-owned artefacts |

### `spec_get`

Scope: `spec:read`

Read one artefact: { address, layer, doc, hash, version, customised, base, conflicts }. doc is exactly what spec\_apply takes: applying it with baseHash = hash is a noop.

| Argument | Type | Description |
| --- | --- | --- |
| `address` required | `string` | Artefact address: <app>/<type>/<key> (as spec\_list / spec\_get return it) or <type>/<key>. Types: page, acl, role, permissionSet, restriction, groupMapping, hierarchy, share |
| `layer` | `"effective" | "base" | "custom" | "source"` | default effective |
| `version` | `integer` | a past version (spec\_history) |

### `spec_schema`

Scope: `spec:read`

The JSON Schema of one artefact type (also served as resource ligament://spec/schema/<type>).

| Argument | Type | Description |
| --- | --- | --- |
| `type` required | `"page" | "acl" | "role" | "permissionSet" | "restriction" | "groupMapping" | "hierarchy" | "share"` |  |

### `spec_validate`

Scope: `spec:read`

Validate docs against the workspace (no state, no permissions): { ok, errors\[\], warnings\[\] } with { address, code, path, message, fix }.

| Argument | Type | Description |
| --- | --- | --- |
| `items` required | `object[]` |  |

### `spec_plan`

Scope: `spec:read`

Plan changes without writing: per item the action, the layer it writes, per-path changes, the merge with changes made since baseHash (none / clean / conflict with base, yours, current), the permission it needs and whether you hold it, and whether a person must apply it.

| Argument | Type | Description |
| --- | --- | --- |
| `items` required | `object[]` |  |

### `spec_history`

Scope: `spec:read`

Version history of one artefact, newest first: version, action, layer, hash, changes, changeset, who and when.

| Argument | Type | Description |
| --- | --- | --- |
| `address` required | `string` | Artefact address: <app>/<type>/<key> (as spec\_list / spec\_get return it) or <type>/<key>. Types: page, acl, role, permissionSet, restriction, groupMapping, hierarchy, share |

### `spec_apply`

Scope: `spec:apply`

Apply changes all-or-nothing. Every item needs baseHash (null = new). Returns { versions } (empty = noop). Errors: spec.conflict (conflicts: base/yours/current), spec.merge\_available (merged docs to re-apply), spec.changed, spec.invalid, spec.permission. When the workspace requires a person to apply it (access/code changes made with a key), nothing is applied and the result says proposed: true with the changeset waiting for review.

| Argument | Type | Description |
| --- | --- | --- |
| `items` required | `object[]` |  |
| `onConflict` | `"reject" | "merge"` | reject (default): a clean merge with changes made since comes back as a spec.merge\_available error holding the merged doc; merge: apply clean merges directly. Real conflicts are always refused. |
| `title` | `string` | Changeset title used if the change has to wait for a person |

## Changeset tools

### `changeset_list`

Scope: `spec:read`

Changesets, newest first: id, title, status, item count, addresses, who proposed it.

| Argument | Type | Description |
| --- | --- | --- |
| `status` | `"open" | "ready" | "applied" | "discarded"[]` |  |

### `changeset_get`

Scope: `spec:read`

One changeset with its items (address, baseHash, doc | delete) and activity.

| Argument | Type | Description |
| --- | --- | --- |
| `id` required | `string` | Changeset id (changeset\_list / changeset\_create) |

### `changeset_create`

Scope: `spec:propose`

Propose a change for a person to review (never applies anything). Items are optional; an item without baseHash starts from the current doc. ready: true marks it ready for review.

| Argument | Type | Description |
| --- | --- | --- |
| `title` required | `string` |  |
| `note` | `string` |  |
| `items` | `object[]` |  |
| `ready` | `boolean` |  |

### `changeset_put_items`

Scope: `spec:propose`

Add or replace items of an open changeset (one per artefact).

| Argument | Type | Description |
| --- | --- | --- |
| `id` required | `string` | Changeset id (changeset\_list / changeset\_create) |
| `items` required | `object[]` |  |

### `changeset_plan`

Scope: `spec:read`

The plan of every item of a changeset against current (same shape as spec\_plan).

| Argument | Type | Description |
| --- | --- | --- |
| `id` required | `string` | Changeset id (changeset\_list / changeset\_create) |

### `changeset_apply`

Scope: `spec:apply`

Apply every item of a changeset all-or-nothing (same errors as spec\_apply). When the workspace requires a person to apply it, nothing is applied and the result says so with the changeset link.

| Argument | Type | Description |
| --- | --- | --- |
| `id` required | `string` | Changeset id (changeset\_list / changeset\_create) |
| `onConflict` | `"reject" | "merge"` | reject (default): a clean merge with changes made since comes back as a spec.merge\_available error holding the merged doc; merge: apply clean merges directly. Real conflicts are always refused. |

### `changeset_discard`

Scope: `spec:propose`

Discard a changeset (kept, with its activity, as discarded).

| Argument | Type | Description |
| --- | --- | --- |
| `id` required | `string` | Changeset id (changeset\_list / changeset\_create) |

## Invite tools

### `invites_list`

Scope: `members:write`

List this workspace's invites: email invites and domain/open links that are pending (expired ones included), with state (pending, expired, used\_up, accepted, revoked), expiresAt and expiresInDays. history: true adds the invites accepted or revoked in the last 30 days. Admins only.

| Argument | Type | Description |
| --- | --- | --- |
| `history` | `boolean` | also list invites accepted or revoked in the last 30 days |

### `invites_resend`

Scope: `members:write`

Resend an email invite that is pending or expired: issues a new link (the old link stops working), restarts the expiry (the workspace's invite expiry, default 14 days) and emails the invite again. Returns the invite, the new link and whether the email was sent. Links (domain/open) can't be resent: create a new one. Admins only.

| Argument | Type | Description |
| --- | --- | --- |
| `id` required | `string` | invite id (invites\_list) |

## Exchange-rate tools

### `fx_convert`

Scope: `records:read`

Convert a money amount to another currency with the exchange rate in force on a date (the direct pair, else the inverse pair). Send the amount as a decimal string, e.g. { amount: { amount: "1250.00", currency: "USD" }, to: "EUR", asOf: "2026-01-31" }. Returns { amount, currency, from, rate, rateDate (the date the rate took effect), source, inverse? }, the amount rounded half-even to the currency's minor units. Error code fx\_rate\_missing when no rate exists for the pair on that date.

| Argument | Type | Description |
| --- | --- | --- |
| `amount` required | `object` |  |
| `to` required | `string` | target ISO 4217 code |
| `asOf` | `string` | The date whose rate applies: YYYY-MM-DD (in the workspace time zone) or @today, @end\_of\_last\_month, @end\_of\_last\_quarter, @end\_of\_last\_year. Default: today. |

### `fx_rates`

Scope: `records:read`

The exchange rates in force on a date (default today): \[{ base, quote, rate, rateDate, source }\], 1 base = rate quote. rateDate is the date each rate took effect.

| Argument | Type | Description |
| --- | --- | --- |
| `asOf` | `string` | The date whose rate applies: YYYY-MM-DD (in the workspace time zone) or @today, @end\_of\_last\_month, @end\_of\_last\_quarter, @end\_of\_last\_year. Default: today. |

## E-signature tools

### `esign_status`

Scope: `esign:read`

An envelope: status, recipients (who signed when), documents, the seal (certificate id, key id, timestamp).

| Argument | Type | Description |
| --- | --- | --- |
| `envelopeId` required | `string` |  |

### `esign_sealed_pdf`

Scope: `esign:read`

Where to download the sealed PDF of a completed envelope (GET with the same key), its sha256 and its Verify page.

| Argument | Type | Description |
| --- | --- | --- |
| `envelopeId` required | `string` |  |

### `esign_create_envelope`

Scope: `esign:write`

Create an e-signature envelope on a record and send it (send: false keeps a draft). Documents are PDFs attached to that record (attachmentId) or a template key. People sign themselves: members in the app, others through an emailed link + one-time code. Returns the envelope.

| Argument | Type | Description |
| --- | --- | --- |
| `subject` required | `object` |  |
| `title` | `string` |  |
| `message` | `string` |  |
| `template` | `string` |  |
| `documents` | `object[]` |  |
| `recipients` required | `object[]` |  |
| `fields` | `object[]` | { recipient (index or email), document?, kind, page, x, y, w, h, required?, label? } in PDF points. |
| `signingOrder` | `"parallel" | "sequential"` |  |
| `expiresInDays` | `integer` |  |
| `reminderEveryDays` | `integer` |  |
| `send` | `boolean` |  |
| `idempotencyKey` | `string` |  |

### `esign_send`

Scope: `esign:write`

Send a draft envelope (invites the first signers).

| Argument | Type | Description |
| --- | --- | --- |
| `envelopeId` required | `string` |  |

### `esign_void`

Scope: `esign:write`

Void (withdraw) an envelope that is not finished. The reason is shown to the signers.

| Argument | Type | Description |
| --- | --- | --- |
| `envelopeId` required | `string` |  |
| `reason` required | `string` |  |

### `esign_remind`

Scope: `esign:write`

Remind the signers whose turn it is (or one recipient) with a fresh link.

| Argument | Type | Description |
| --- | --- | --- |
| `envelopeId` required | `string` |  |
| `recipientId` | `string` |  |

## App Store tools

### `store_updates`

Scope: `apps:read`

Installed apps with a newer version available in this workspace: key, name, from, to, bump (patch/minor/major).

### `store_install_plan`

Scope: `apps:read`

What installing an app does here, in order (deepest dependency first, the app last), with versions and plan prices, the dependencies already installed and the paid ones that need explicit acceptance. Changes nothing.

| Argument | Type | Description |
| --- | --- | --- |
| `appKey` required | `string` |  |
| `planKey` | `string` |  |
| `version` | `string` |  |

### `store_install_status`

Scope: `apps:read`

One install run: each step (app, version, plan, status, error), what is installed and the failed step.

| Argument | Type | Description |
| --- | --- | --- |
| `runId` required | `string` |  |

### `store_install`

Scope: `apps:install`

Install an app. dependencies: "fail" (default) refuses when other apps must be installed first and returns the plan; "install" installs them first, in order, one at a time. A dependency with no free plan needs acceptPaid: \["<key>"\] (nothing is bought otherwise). A failure stops the run: resume it with store\_install\_resume.

| Argument | Type | Description |
| --- | --- | --- |
| `appKey` required | `string` |  |
| `planKey` | `string` |  |
| `version` | `string` |  |
| `dependencies` | `"install" | "fail"` |  |
| `acceptPaid` | `string[]` |  |

### `store_install_resume`

Scope: `apps:install`

Retry a failed install run from the step that failed; what is installed stays and is not redone.

| Argument | Type | Description |
| --- | --- | --- |
| `runId` required | `string` |  |

### `store_upgrade`

Scope: `apps:install`

Upgrade installed apps, dependencies first. appKeys (or all: true). dryRun: true previews each app's changes (entities/fields added, removed, changed) and what would be blocked. A destructive change blocks that app unless its key is in confirm. Access-widening changes are held.

| Argument | Type | Description |
| --- | --- | --- |
| `appKeys` | `string[]` |  |
| `all` | `boolean` |  |
| `dryRun` | `boolean` |  |
| `confirm` | `string[]` |  |

### `store_uninstall`

Scope: `apps:install`

Uninstall an app (its records stay). Refused while other installed apps depend on it: the error names them. preview: true returns who loses which access, changing nothing.

| Argument | Type | Description |
| --- | --- | --- |
| `appKey` required | `string` |  |
| `preview` | `boolean` |  |

### `store_auto_patch`

Scope: `settings:write`

The owner setting "auto-apply patch updates" (default off): on applies x.y.Z updates that are not destructive and widen no access, once a day. Omit \`on\` to read it. Changing it needs the workspace owner's key.

| Argument | Type | Description |
| --- | --- | --- |
| `on` | `boolean` |  |

## Your workspace's own tools

| Tool name | Scope | Description |
| --- | --- | --- |
| `connector__<connector>__<operation>` | `endpoints:invoke` | One tool per operation of each connector the workspace has marked as exposed. Inputs are the operation's template variables. |
| `script__<script>` | `endpoints:invoke` | One tool per script the workspace has marked as exposed. Takes the script's JSON input. |

## Resources

| URI | Description |
| --- | --- |
| `ligament://spec/catalog` | Artefact types, entities and fields, roles, components and blocks (same as spec\_catalog). |
| `ligament://spec/schema/page` | The JSON Schema of a page doc. |
| `ligament://spec/schema/acl` | The JSON Schema of a acl doc. |
| `ligament://spec/schema/role` | The JSON Schema of a role doc. |
| `ligament://spec/schema/permissionSet` | The JSON Schema of a permissionSet doc. |
| `ligament://spec/schema/restriction` | The JSON Schema of a restriction doc. |
| `ligament://spec/schema/groupMapping` | The JSON Schema of a groupMapping doc. |
| `ligament://spec/schema/hierarchy` | The JSON Schema of a hierarchy doc. |
| `ligament://spec/schema/share` | The JSON Schema of a share doc. |
| `ligament://spec/schema/{type}` | JSON Schema of one artefact type (page, acl, role, permissionSet, restriction, groupMapping, hierarchy, share) |
