> ## Documentation Index
> Fetch the complete documentation index at: https://docs.auxilian.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# list_tables

> List every table in a project with its columns and foreign keys.

Returns the definition of every table in a project.

| | |
| - | - |
| Scope | `mcp:read` |
| Annotations | `readOnlyHint: true` |

## Parameters

<ParamField body="projectId" type="string" required>
  Project id from `list_projects`.
</ParamField>

## Result

An array of tables, in creation order.

<ResponseField name="table" type="string">
  Table name.
</ResponseField>

<ResponseField name="definition" type="object">
  The table definition. Same shape as the [`describe_table`](/mcp/tools/describe-table) result.
</ResponseField>

## Example

```json Arguments theme={null}
{ "projectId": "01k7m3x9q2v8d4h6n1r5t0w2yz" }
```

```json Result theme={null}
{
  "data": [
    {
      "table": "authors",
      "definition": {
        "table": "authors",
        "columns": [
          { "name": "id", "type": "uuid", "nullable": false, "default": "gen_random_uuid()" },
          { "name": "created_at", "type": "timestamptz", "nullable": false, "default": "now()" },
          { "name": "name", "type": "text", "nullable": false }
        ]
      }
    },
    {
      "table": "books",
      "definition": {
        "table": "books",
        "columns": [
          { "name": "id", "type": "uuid", "nullable": false, "default": "gen_random_uuid()" },
          { "name": "created_at", "type": "timestamptz", "nullable": false, "default": "now()" },
          { "name": "title", "type": "text", "nullable": false },
          { "name": "author_id", "type": "uuid" },
          { "name": "rating", "type": "integer" }
        ],
        "foreignKeys": [
          { "column": "author_id", "refTable": "authors", "refColumn": "id", "onDelete": "set null" }
        ]
      }
    }
  ]
}
```

## Errors

| Code | When |
| - | - |
| `ACCESS_DENIED` | The project doesn't exist or you can't access it |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.