Archituredocs

MCP tools

Every tool of the Architure MCP server, what it reads or writes, its inputs, what it answers and the permission it needs; then authentication, limits, errors and how objects are named.

The Architure MCP server is at https://app.architure.dev/api/mcp (Streamable HTTP; the server's name is architure). It has 15 tools: five read the workspace (repositories, tech stack, skills, environment variable names), six read databases, and four write databases. Connect your agent sets it up; the skill tells the agent in which order to call the tools.

Every answer is text: JSON for most tools, Architure's text format for get_database. A refusal comes back as a tool error whose first word is its code (see Errors).

The tools at a glance

ToolGroupNeedsWhat it answers
list_repositoriesWorkspacereadThe imported repositories (owner/name) and their packages
list_tech_stackWorkspacereadThe tech stack by category, with doc links, notes, linked variable names and skills
list_skillsWorkspacereadThe skills of a package, or of the organization
get_skillWorkspacereadOne skill's files
list_environment_variablesWorkspacereadThe variable names of a package, or of the organization; never a value
list_databasesDatabasereadThe databases of a package, or of the organization
get_databaseDatabasereadA database, or one schema, in the text format, with its revision
get_tableDatabasereadOne table in detail
search_columnsDatabasereadColumns across the organization's databases
list_column_definitionsDatabasereadThe organization's column definitions
check_databaseDatabasereadThe database's issues and how to fix them
create_tableDatabase writewriteCreates a table with its columns, foreign keys and indexes
update_columnDatabase writewriteChanges one column
set_descriptionDatabase writewriteWrites a description from Markdown
apply_operationsDatabase writewriteApplies raw operations, all or nothing

read is any API key or an OAuth token with schema:read. write is a write API key, or an OAuth token with schema:write for an owner, admin or member of the organization. See Authentication.

Telling the tools where you work

The organization's work is organized by repositories and their packages: the folders that run with their own environment, such as apps/web or packages/email (. for a repository without workspaces). Databases, skills and environment variables are each linked to packages or available to all packages.

list_skills, list_environment_variables and list_databases take two optional inputs that name the package:

InputTypeRequiredWhat
repositorystring, 3 to 200 charactersnoThe GitHub repository as owner/name, as git remote get-url origin shows it (case does not matter). Left out, the tool answers for the whole organization
pathstring, up to 500 charactersnoThe folder you work in, from the repository's root (apps/web, or a folder inside it). Read only with repository; left out, the repository's root package

The answer is then for the package that holds the folder: the deepest package whose path is the folder or one of its parents, else the root package. It names that package first (package: repository, path, name). A repository the organization did not import, or a folder that no package holds (in a monorepo whose root is not a package), answers NotFound: call list_repositories, or leave repository out.

Workspace reads

list_repositories

The GitHub repositories the organization imported, each with its packages. Use it to check that your repository is there and which folder is a package.

Inputs: none.

Answers: repositories, each with repository (owner/name), private, defaultBranch and packages (path, name from its package.json).

Needs: read.

list_tech_stack

The organization's tech stack: its preferred technologies and libraries. Agents read it before choosing a library, framework or service, prefer what it lists and follow the docs it links to.

Inputs: none. The tech stack is the organization's, not a package's.

Answers: categories, the categories that have items in their fixed order, each with its name and items in the team's order: id, name, version, docUrls, notes (Markdown), environmentVariables (the names of the variables linked to the item) and skills (the names of the skills linked to it).

Needs: read.

list_skills

The team's skills: folders with a SKILL.md, instructions the team wants agents to follow. Archived skills and skills in the trash are left out.

Inputs: repository and path (see Telling the tools where you work).

Answers: skills (with package when repository is given): those linked to the package or available to all packages, else every live skill of the organization. Each has name, description, source (skills_sh or custom), skillsShId (the skills.sh id of a copy from skills.sh, else null), audit (each audit partner's provider and status, or not audited) and files (how many files it has).

Needs: read.

get_skill

One skill's files, by name. The agent follows its instructions; to install it in a repository, it writes the files under .agents/skills/<name>/ (or wherever the user's agent reads skills). A repository can also install every skill its packages use with its install link.

InputTypeRequiredWhat
namestring, 1 to 64 charactersyesThe skill's name, from list_skills

Answers: name, description, source and files, each with its path (SKILL.md first at the root, then supporting files such as references/api.md) and contents. A name that is not a live skill answers NotFound.

Needs: read.

list_environment_variables

The environment variable names the code reads, with their descriptions. Never the values: the agent uses the names in code (process.env.STRIPE_SECRET_KEY), asks the user for a value when it needs one, and never writes a value into a committed file.

Inputs: repository and path (see Telling the tools where you work).

Answers:

  • With repository: package and environmentVariables, the names that package resolves to, each with name, description and scopes: each scope that holds a value (all, production, preview, development) with its source, package (the variable is linked to the package, which wins) or allPackages (available to every package).
  • Without: environmentVariables, every variable of the organization, with name, description (Markdown) and scopes (the scopes that hold a value).

An environment's own value overrides all.

Needs: read.

Database reads

list_databases

The databases, most recently changed first. Every database tool takes a databaseId from this list.

Inputs: repository and path (see Telling the tools where you work).

Answers: databases (with package when repository is given): those the package uses (linked to it or available to all packages), else every database of the organization. Each has id, name, dialect (postgresql or mysql), revision, updatedAt, schemas (the names of its schemas, in the canvas's order) and description (Markdown). Archived databases and databases in the trash are left out.

Needs: read.

get_database

One database in Architure's text format (DBML plus type: for information types, use: for column definitions, and table groups for areas), with its current revision: the baseRevision of the write tools.

InputTypeRequiredWhat
databaseIduuidyesThe database, from list_databases
schemastringnoOnly this schema, by name or id: its tables, the relationships between them and the areas that hold one. Relationships with other schemas' tables are counted, not shown. Default: the whole database
includeIdsbooleannoAlso list the id of every schema, table, column, relationship, index, area and column definition, for apply_operations. A definition marked archived is archived or in the trash: columns may not link to it anew

Answers: a header (the database's name, id, dialect and revision; its schemas with their table counts; whether the connection may write, else why not: a read key or a viewer, or a plan that is not active), then the text format, then the ids when asked. An unknown schema is refused with the names there are.

Needs: read.

get_table

One table in detail, as JSON. Use it for the descriptions, which the text format leaves out.

InputTypeRequiredWhat
databaseIduuidyesThe database
tablestringyesschema.table (public.orders), table when the name is unique across schemas, or the table's id

Answers: revision and table: id, path, schema, name, description, area, primaryKey (column names), columns (each with id, name, position, dataType, enumValues, nullable, defaultValue, isPrimaryKey, isUnique, isAutoIncrement, informationType, columnDefinition and description; a column linked to a column definition shows the definition's type, values, information type and description), relationships that start or end on the table (id, name, kind, direction, from, to, cardinality, onDelete, onUpdate, description) and indexes (id, name, isUnique, columns). Descriptions are Markdown.

Needs: read.

search_columns

Finds columns across every live database of the organization, so the agent reuses the names and types already chosen (how is an email stored elsewhere? which columns use the order_status enum?). Filters combine.

InputTypeRequiredWhat
namestring, up to 200 charactersnoPart of the column name, without case: email finds email, billing_email, EmailVerified
dataTypestring, up to 200 charactersnoPart of the data type (timestamp, varchar, uuid). A linked column matches on its definition's type and name, so an enum definition's name finds the columns that use it
informationTypeone of the seven information typesnoOnly columns of this type (a linked column has its definition's)
databaseIduuidnoOnly this database
limitinteger, 1 to 200noThe most results, 50 by default

Answers: count, truncated (with a note when more columns match) and columns, each with databaseId, databaseName, dialect, schemaName, tableId, tableName, columnId, columnName, path (schema.table.column), dataType, informationType, columnDefinition (id and name, or null), nullable, isPrimaryKey and isUnique.

Needs: read.

list_column_definitions

The organization's column definitions: shared enums and column types. Agents link a column to a definition instead of repeating an enum's values.

Inputs: none.

Answers: columnDefinitions (archived ones and those in the trash left out), each with id, name, dialect (null: it works in PostgreSQL and MySQL), dataType, enumValues, informationType, nullable, defaultValue and description (Markdown). A column links only to a definition of its database's dialect or with dialect null, by name, or by id when two share a name.

Needs: read.

check_database

Lints the database, as the canvas's issues panel does. Agents call it after every change they write, fix the errors, and fix the warnings unless the user decided otherwise.

InputTypeRequiredWhat
databaseIduuidyesThe database
severityerror, warning or infonoList only this severity. By default errors and warnings are listed and information issues are counted per rule
limitinteger, 1 to 1000noList at most this many issues, errors first (100 by default)
includeAllbooleannoList every issue, without a limit

Answers: revision; summary (the number of errors, warnings and info); rules, each rule found once with its severity, title and fix; issues, each with rule, severity, message and target (kind, id, path); omitted, how many were not listed; infoByRule, the information issues counted per rule with up to 10 example paths; and next, what to do about what was left out.

Needs: read.

Database writes

Every write is one change of the database, with the agent as its author: the open canvas shows it within seconds. Each write tool takes baseRevision (see Revisions and conflicts) and answers with the new revision and next, a reminder to call check_database.

Writes are refused with Forbidden for a read key, a token without schema:write or a viewer, and with PlanRequired once the organization's trial is over or its subscription is not active.

create_table

Creates a table with its columns in one change, placed on the canvas to the right of the existing tables, with its foreign keys and single-column indexes. Refused when the schema already has a table of that name.

InputTypeRequiredWhat
databaseIduuidyesThe database
baseRevisionintegernoThe revision the agent read; left out, the current one
schemastringnoThe schema's name or id. Default: public, or the database's only schema
namestringyesThe table's name, following the database's naming
descriptionMarkdown, up to 20,000 charactersnoWhat the table holds and why
columnsarray, 1 to 500yesThe columns, in order (below)

Each column:

FieldTypeRequiredWhat
namestringyesThe column's name
dataTypestringnoThe type as the dialect writes it in DDL (uuid, varchar(255), numeric(10,2), timestamp with time zone). Left out when definition is set
definitionstringnoA column definition's name or id: the column then reads its type, values, information type and description
nullablebooleannoDefault: false for a primary key column, the definition's for a linked column, true otherwise
defaultValuestring or nullnoThe SQL default as written in DDL (now(), 'draft')
primaryKeybooleannoPart of the primary key; several columns make a composite key
uniquebooleannoValues must be unique
autoIncrementbooleannoFilled by a sequence or identity
informationTypeone of the seven information typesnoWhat the column holds
referencesstringnoMakes the column a foreign key to schema.table.column, table.column or a column id (the new table's own columns too). Many-to-one, or one-to-one when the column is unique or the only primary key column; named <table>_<column>_fkey
onDeleteno_action, restrict, cascade, set_null or set_defaultnoThe foreign key's ON DELETE action
indexbooleannoAn index on this column alone; set it on foreign keys that do not start the primary key, or check_database warns
descriptionMarkdownnoWhat the column holds, its unit or format

Answers: revision, table (id, path, and columns: each column's name with its id), relationships (the names of the foreign keys created) and next.

Needs: write.

update_column

Changes one existing column. Send only the fields that change. To add, delete or reorder columns, or to change relationships and indexes, use apply_operations.

InputTypeRequiredWhat
databaseIduuidyesThe database
baseRevisionintegernoThe revision the agent read
columnstringyesschema.table.column (public.orders.status), table.column, or the column's id
changesobjectyesAt least one of the fields below

changes takes name (renames the column, which keeps its identity), dataType (unlinks a linked column), definition (links the column to a definition by name or id; null unlinks it and keeps the definition's type as the column's own; not together with dataType), nullable, defaultValue (null removes it), primaryKey, unique, autoIncrement, informationType (null clears it) and description (Markdown; null or empty clears it).

Answers: revision, column (id and path), a note when the description was set on a linked column (readers show the definition's description), and next.

Needs: write.

set_description

Writes the description of the database, a schema, a table, a column or a relationship from Markdown, replacing the whole description. It is stored as sanitized rich text and shown in the canvas's editor.

InputTypeRequiredWhat
databaseIduuidyesThe database
baseRevisionintegernoThe revision the agent read
kinddatabase, schema, table, column or relationshipyesWhat to describe
targetstringfor all but databaseA schema name, schema.table, schema.table.column, a relationship's constraint name, or any id
markdownstring or null, up to 20,000 charactersyesParagraphs, ## and ### headings, bold, italic, code, links, lists and fenced code blocks are kept; other markup is dropped. Null or empty clears it

Answers: revision, described (kind and path), a note for a column linked to a definition, and next.

Needs: write.

apply_operations

The general write tool, for what the other three do not cover: adding, deleting or reordering columns; relationships, indexes, areas and schemas; moves and deletes. The operations apply in order, all or nothing, as the canvas applies its edits.

InputTypeRequiredWhat
databaseIduuidyesThe database
baseRevisionintegeryesThe revision the operations were written against
operationsarray, 1 to 1000yesOperations, each discriminated by type

The operation types are database.update; schema.create, schema.update, schema.delete; table.create, table.update, table.move, table.delete; column.create, column.update, column.reorder, column.delete; relationship.create, relationship.update, relationship.delete; area.create, area.update, area.move, area.delete; index.create, index.update, index.delete; and database.import.

  • A create carries the whole row with a new id the agent makes (a uuid, v7 preferred). An update carries id and only the changed fields in changes. A delete carries id and cascades as the database does: deleting a table removes its columns, indexes and relationships.
  • Ids come from get_database with includeIds, or from get_table.
  • Descriptions inside operations are descriptionHtml, sanitized on the server; set_description, which takes Markdown, is simpler.

Answers: revision and next. An operation that does not apply is a ValidationError naming it.

Needs: write.

Addressing objects

Tools name objects by path:

ObjectPathExample
Schemaits namepublic
Tableschema.table, or table when the name is unique across schemaspublic.orders
Columnschema.table.column, or table.column when the table name is uniquepublic.orders.status
Relationshipits constraint nameorders_customer_id_fkey
Column definitionits nameorder_status

Exact names match first, then names without case. Ids (uuids) work everywhere a path does. A name that matches several objects (a duplicate, or names that differ only in case) is refused with their paths and ids, never resolved to the first: the agent sends the id.

Revisions and conflicts

Each database has a revision, a counter that moves with every change. get_database, get_table, check_database and every write answer with it. A write names the revision it was based on (baseRevision; required by apply_operations, the revision just read when the other write tools get none).

When the database has moved past it, someone else (the canvas, another agent) changed it in between: nothing is written and the answer is a Conflict with the current revision and the changes since, with their operations in full while they fit in about 20 KB (an import shown by its counts), else outlined by operation types and target ids. The agent reads the database again, redoes its change on the current schema and retries with the new revision.

Authentication

Every request carries a bearer token: Authorization: Bearer <token>. A request without one, or with one the server refuses, answers 401 with a WWW-Authenticate header that points at the server's OAuth metadata (resource_metadata, at /.well-known/oauth-protected-resource/api/mcp) and asks for the scopes schema:read schema:write, so an agent that supports OAuth starts the sign-in by itself.

API keys

An organization API key starts with architure_. An owner or admin creates it on Agents with the permission Read or Read and write (see Create an API key).

  • Read calls every read tool. The write tools answer Forbidden: an owner or admin creates a write key.
  • Read and write calls every tool.

A key acts for the organization; its changes are signed with the agent's name and the key's name. It is never challenged for a scope.

OAuth

Any other bearer token is an OAuth access token, issued after the user signs in and chooses the organization on the consent page. Its scopes are schema:read and schema:write, limited by the user's role, which is read again on every call: an owner, admin or member writes with schema:write; a viewer only reads, whatever the scopes; a user who left the organization is refused.

A write tool called with a token that lacks schema:write answers 403 with an insufficient_scope challenge asking for schema:read schema:write, so the agent can ask the user to sign in again with write access. A viewer's token that has the scope gets Forbidden from the tool instead.

Rate limit

An API key may make 600 requests a minute. Past it the server answers 429 with Retry-After: 60. One MCP request counts once, whatever the tools do inside it.

Errors

A refused call comes back as a tool error whose first word is its code, then the reason and what to do. Before any tool runs, the HTTP layer may answer 401, 403, 429 or 500 instead.

CodeWhenWhat the agent does
ConflictThe database moved past baseRevision; the answer lists the changes sinceRead the database again, redo the change, retry with the new revision
ValidationErrorAn input or an operation does not apply; operations.<index> names the operation, and the message starts with not_found, already_exists, invalid_reference, invalid_row or invalid_operationFix the input and retry
PlanRequiredA write while the organization's trial is over or its subscription is not activeTell the user: an owner or admin restores writing in the billing settings. Reads still work. Do not retry
ForbiddenA write with a read key, a token without schema:write or a viewer's connectionTell the user. Do not retry
NotFoundNo database with that id, no live skill of that name, a repository the organization did not import, or a folder no package holdsCall list_databases, list_skills or list_repositories again
401 UnauthorizedNo token, an unknown, revoked or expired one, or a token without an organizationSign in again, or check the key
429The API key passed 600 requests in a minuteWait for Retry-After

A path that matches nothing, or several objects, is refused with a message that says which (and lists the candidates' ids), and nothing is written.

On this page