> ## Documentation Index
> Fetch the complete documentation index at: https://ngquct-fix-customizable-find-shortcut.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Resources

> Read-only resources for connections, schema, tables, and query history, with their URI templates

export const what_0 = "read"

Eight URIs, all read-only, all JSON. A client reads them to find its way around before it calls a tool.

Every {what_0} clears the same gates a tool call does: the token's `resources:read` scope, its connection allowlist, and the connection's **External Clients** level and AI policy. See [Scopes and gates](/external-api/mcp-tools#scopes-and-gates).

Reads count against the caller's [request rate](/external-api/tokens#rate-limits) like anything else.

## Discovery

`resources/list` returns `tablepro://connections`, plus four entries for each connection that is currently connected and visible to this token: its schema, its tables, its databases, and its history. The list is sorted by connection name.

`resources/templates/list` returns the seven templated URIs, so a client can build one for a connection that is not open yet. Both methods page at 50 entries with `nextCursor`.

## The URIs

| URI                                                                           | Name                   | Payload                                                                                       |
| ----------------------------------------------------------------------------- | ---------------------- | --------------------------------------------------------------------------------------------- |
| `tablepro://connections`                                                      | `connections`          | Every saved connection this token may use, with live session state                            |
| `tablepro://connections/{connection_id}/schema`                               | `connection_schema`    | Tables and their columns for the browsed database                                             |
| `tablepro://connections/{connection_id}/databases`                            | `connection_databases` | `{ "databases": ["app", "analytics"] }`                                                       |
| `tablepro://connections/{connection_id}/schemas{?database}`                   | `connection_schemas`   | `{ "schemas": ["public", "reporting"], "database": "app" }`                                   |
| `tablepro://connections/{connection_id}/tables{?database,schema,row_counts}`  | `connection_tables`    | Table and view names without columns, as the `list_tables` tool returns them                  |
| `tablepro://connections/{connection_id}/tables/{table}{?database,schema}`     | `table_description`    | Columns, indexes, foreign keys and an approximate row count, as `describe_table` returns them |
| `tablepro://connections/{connection_id}/tables/{table}/ddl{?database,schema}` | `table_ddl`            | The `CREATE` statement as the engine reports it, as `get_table_ddl` returns it                |
| `tablepro://connections/{connection_id}/history{?limit,search,date_filter}`   | `connection_history`   | Queries recently run against this connection, newest first                                    |

`{connection_id}` must be a UUID; a name is `-32602`. On the `tables` URI, `row_counts=true` asks for approximate counts and `1` and `yes` also work. `completion/complete` fills every variable in these templates against the live schema, including `table`, `database` and `schema`. See [Completions](/external-api/mcp-prompts#completions).

<Note>
  These URIs live inside the MCP transport and are not the shell-level [URL scheme deep links](/external-api/url-scheme), which happen to share the `tablepro://` prefix.
</Note>

## Reading

`resources/read` needs `params.uri` and, in the modern era, an `Mcp-Name` header carrying the same URI. Every URI except `tablepro://connections` reads a live session, and TablePro opens the connection first if it is not open yet. A connection that will not open is `-32602`.

```json theme={null}
{
  "contents": [
    {
      "uri": "tablepro://connections",
      "mimeType": "application/json",
      "text": "{\"connections\":[…]}"
    }
  ]
}
```

The payload is a JSON string inside `text`. The shapes on the rest of this page are what you get after parsing it. Each read carries a `private` cache hint whose TTL depends on the URI; the numbers are in [Cache hints](/external-api/mcp-protocol#cache-hints).

## `tablepro://connections`

```json theme={null}
{
  "connections": [
    {
      "id": "9f1f0c3e-2e3d-4b14-9c3a-1d2f4ad1f6f1",
      "name": "Production",
      "type": "PostgreSQL",
      "host": "db.example.com",
      "port": 5432,
      "database": "app",
      "is_connected": false,
      "ai_policy": "askEachTime",
      "external_access": "readOnly",
      "safe_mode": "silent"
    }
  ]
}
```

`database` is the session's browsed database when connected, the saved default otherwise. `type` uses display casing (`MySQL`, `PostgreSQL`, `SQLite`). Connections with `external_access: blocked` or `ai_policy: never` are omitted, as are connections outside the token's allowlist.

## `tablepro://connections/{id}/schema`

```json theme={null}
{
  "database": "app",
  "tables": [
    {
      "name": "users",
      "type": "TABLE",
      "schema": "public",
      "columns": [
        { "name": "id", "data_type": "uuid", "is_nullable": false, "is_primary_key": true },
        { "name": "email", "data_type": "text", "is_nullable": false, "is_primary_key": false }
      ]
    }
  ]
}
```

Capped at 100 tables. Beyond that the payload also carries `truncated: true` and `total_tables`. For a larger schema use the `list_tables` tool, or `search_schema` to find one column.

This is the only subscribable resource. See [Subscriptions](/external-api/mcp-subscriptions).

## `tablepro://connections/{id}/history{?limit,search,date_filter}`

| Parameter     | Meaning                                                                                               |
| ------------- | ----------------------------------------------------------------------------------------------------- |
| `limit`       | 1 to 500, default 50. Out-of-range values are clamped, not rejected.                                  |
| `search`      | Matched against the recorded statement text.                                                          |
| `date_filter` | `today`, `thisWeek` (last 7 days), or `thisMonth` (last 30 days). Anything else means no date filter. |

```json theme={null}
{
  "history": [
    {
      "id": "9b2d3c5a-…",
      "query": "SELECT * FROM users WHERE active = true",
      "connection_id": "9f1f0c3e-…",
      "database_name": "app",
      "database_type": "PostgreSQL",
      "source": "editor",
      "statement_type": "select",
      "executed_at": "2026-08-20T10:14:22Z",
      "execution_time_ms": 18.4,
      "row_count": 142,
      "was_successful": true
    }
  ]
}
```

`executed_at` is ISO 8601. `schema_name` appears when the entry has one, and `error_message` when `was_successful` is false, redacted.

## Errors

| Code     | Meaning                                                                                                                           |
| -------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `-32602` | Missing `uri`, wrong scheme, unknown URI, connection id that is not a UUID, empty table name, or a connection that would not open |
| `-32020` | The `Mcp-Name` header does not match `params.uri`                                                                                 |
| `-33007` | The token's allowlist rejects the connection, or its external access is `blocked`                                                 |

Resource-not-found is `-32602` rather than a code of its own; [MCP Protocol](/external-api/mcp-protocol#errors) lists the rest.
