# get_collection_schema

Source: https://modulify.ai/docs/mcp/database/get-collection-schema

Reads the columns of one table in a site database, with their types, nullability, primary key and CMS field type.

- Title: Read a collection schema
- Scope: `data:read`
- Access: Read only

Each column carries its `uiType`, the CMS field type registered for it, such as `image`, `richtext` or `code`, or null. A language column with no type of its own reports its base field's type when that type is `color`, `richtext`, `code`, `file`, `image`, `date` or `datetime`. A `code` value is raw HTML, CSS or JavaScript that the site runs exactly as written. A `richtext` value is HTML, and an [embed](https://modulify.ai/docs/data/cms#embeds) inside it is an empty `<div data-embed="…">` whose attribute holds the embed's code with `&`, `<`, `>` and `"` escaped.

A foreign key column names the table and column it points at in `references`. Read this before writing a row with `create_row` or `update_row`, so the right columns are supplied. See [Column types](https://modulify.ai/docs/data/column-types).

A collection that does not exist in the site's database is refused with a `404` and the message "That collection was not found in your database!".

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |
| `name` | string | Yes | The table name, from `list_collections`. |