MCP
Server identity, OAuth scopes, complete tools reference, history, trash and errors.
Server identity
- MCP endpoint:
https://www.siglata.com/v1/mcp(Streamable HTTP with OAuth 2.1). - Server card:
https://www.siglata.com/.well-known/mcp/server-card.json. - Client registration: use an HTTPS Client ID Metadata Document URL as
client_idor register atPOST https://www.siglata.com/auth/oauth2/register(registration_endpoint).
OAuth scopes
| Scope | What it allows |
|---|---|
office | Call every office tool for the company chosen during approval. |
Clients may also request openid, profile, email and offline_access. A token without office receives HTTP 403 with insufficient_scope. Scopes never widen the person's access: in Records, each statement runs with the connecting person's read or write permissions. To switch companies or re-authorize, create a new connection via the install guide.
tools/list exposes the same tools to every connection holding office. Results return JSON text and structuredContent (exception: office_status returns English text and {"state": "active"} in structuredContent). While the office is provisioning, only office_status answers; other tools ask to retry in a minute.
Office status
office_status
Reports whether the office is ready: provisioning during setup, active when ready, or failed. Call first after connecting and repeat while provisioning. Read-only.
No arguments. Returns state. With failed, the message asks the owner to contact Siglata support.
Files
Files stores the company's documents by path, such as contratos/2026/acme.pdf. Each save creates a new version, and earlier versions remain readable.
files_save
Saves a file as a new version. Text goes in content; bytes go in contentBase64. Writes without deleting anything.
| Argument | Required | What it is |
|---|---|---|
path | yes | The file's relative path. |
note | yes | What changed, for the company's people. |
content | no | The content as text. Send this or contentBase64. |
contentBase64 | no | The content as bytes, in base64. |
contentType | no | The MIME type. Defaults to text/plain; charset=utf-8 for text and application/octet-stream for bytes. |
Returns path and version. Refusals: invalid_input, invalid_path (non-relative, ., .., backslashes, control chars or > 900 bytes), too_large (> 10 MiB), unavailable.
files_upload_begin
Prepares a one-use upload for a local file named by the person, only when the agent has shell access. Up to 50 MiB; expires in 10 minutes. Never show the URL to the person.
| Argument | Required | What it is |
|---|---|---|
path | yes | The file's relative path in Files. |
note | yes | What changed. |
size | yes | File size in bytes, an integer from 1 to 52428800. |
contentType | yes | The file's MIME type. |
sha256 | no | SHA-256 as 64 lowercase hexadecimal characters. |
Returns uploadUrl, expiresAt (ISO), size and path. Upload with curl --fail-with-body --show-error --silent --max-time 120 -T <file> "<uploadUrl>" (curl.exe in PowerShell), without credentials. Confirm path and version from the PUT response, or verify size and sha256 via files_get with metadataOnly: true after a failure or timeout. Tool refusals: invalid_input, invalid_path, too_large, unavailable (PUT: 400, 404, 409, 413, 503).
files_download_begin
Up to 50 MiB, one attempt, ten minutes. Never show the URL. A remote shell saves there; for manual download, share the console link.
| Argument | Required | What it is |
|---|---|---|
path | yes | Relative path. |
version | no | 1 or greater; defaults to current. |
Returns downloadUrl and the console url. Download with curl -fsS --output "<destination>" "<downloadUrl>" (macOS/Linux) or Invoke-WebRequest -Uri "<downloadUrl>" -OutFile "<destination>" (PowerShell) and verify local SHA-256. Refusals: invalid_input, invalid_path, not_found, too_large, unavailable (URLs: 404, 503).
files_get
Reads a file: the current version or a requested version. Text files return in content; binary files in contentBase64. Read-only.
| Argument | Required | What it is |
|---|---|---|
path | yes | The file's relative path. |
version | no | Version number starting at 1. Defaults to current. |
metadataOnly | no | true: metadata only, without bytes or the 10 MiB limit. |
Returns path, version, contentType, size, sha256, note, savedAt, url and, without metadataOnly: true, the content. Refusals: invalid_input, not_found, invalid_path, too_large, unavailable.
files_delete
Deletes a whole file and all its versions. Frees Files space at once; the trash retains it for 30 days. Changes data.
| Argument | Required | What it is |
|---|---|---|
path | yes | Relative path. |
Returns path, trash, versions and bytes. Refusals: invalid_input, invalid_path, not_found, unavailable.
files_restore
Restores a file and all its versions from the trash. Reclaims its Files space. Changes data.
| Argument | Required | What it is |
|---|---|---|
trash | yes | The item id as text, from history_list with kind: "trash". |
Returns path, trash, versions and bytes. Refusals: invalid_input, not_in_trash, path_taken, space_full, unavailable.
Records
Records is the company's PostgreSQL database. Each statement runs with the connecting person's permissions. Both tools accept only the arguments below.
records_query
Runs one read-only SQL statement for rows, totals and counts. Read-only.
| Argument | Required | What it is |
|---|---|---|
sql | yes | One SQL statement. Use $1, $2… for values. |
params | no | Values for $1, $2…, in order. |
Returns command, rowCount, rows and truncated (capped at 100,000 characters). Refusals: invalid_arguments, PostgreSQL SQLSTATE (42P01, 42501), no-company, not-active, not-member, roles-pending, unavailable.
records_change
Runs one SQL statement that inserts, updates or deletes rows. Each changed row goes into History with the person and agent, and history_undo undoes it. To drop a table or column, run SELECT siglata.drop_table('table') or SELECT siglata.drop_column('table', 'column'). Changes data.
| Argument | Required | What it is |
|---|---|---|
sql | yes | One SQL statement. Use $1, $2… for values. |
params | no | Values for $1, $2…, in order. |
Returns action (History action id) and result. Refusals: same as records_query; DROP TABLE and DROP COLUMN are refused and point to the trash functions.
History
History records what each person and agent changed in Records with undo, and the trash keeps dropped tables, columns and deleted files for 30 days.
history_list
Lists, newest first, row changes (entries), actions (actions) and trash items (trash). Read-only.
| Argument | Required | What it is |
|---|---|---|
kind | no | entries, actions or trash. Without it, all three lists. |
table | no | Only items touching this table. |
person | no | A current member's name or email. |
ai | no | The agent's name, as shown in the list. |
since | no | Only from this timestamp forward. |
before | no | Smallest id returned for pagination. Requires kind. |
limit | no | Items per list, from 1 to 200 (default: 50). |
Refusals: same as records_query, plus ambiguous_person when two members share the given name.
history_undo
Undoes row changes in Records or restores a trash item. Send one target. With a primary key, undo matches by key; without one, it matches all row values (identical rows are refused with 55000). Schema changes (CREATE TABLE, ALTER TABLE) cannot be undone. Changes data.
| Argument | Required | What it is |
|---|---|---|
entry | no | Undoes one row change. |
action | no | Undoes every row change made by one records_change call. |
trash | no | Restores a dropped table or column from trash (for files, use files_restore). |
Returns undone and result. Refusals: already_undone, already_restored, not_found, not_a_change, 42704, 55000, 40001 (undo newer changes on the same row first) and records_query refusals.
Errors
Tool refusals
Tool refusals return isError: true, plain-language text and structuredContent with error (stable code) and message:
{
"error": "not_found",
"message": "Files has no file at contratos/2026/acme.pdf."
}
Request refusals
| Situation | Response |
|---|---|
| Missing or invalid token | HTTP 401 with WWW-Authenticate |
Token lacks office scope | HTTP 403 with insufficient_scope |
| Connection expired/revoked or user left company | HTTP 401 with invalid_token |
| Cross-origin browser request | HTTP 403 with JSON-RPC -32000 |
| Unknown tool | JSON-RPC -32602 |
| Unexpected failure | HTTP 500 with JSON-RPC -32603 |