Get a granted table or view with its columns and keys.
The columns of one source (name, database type, position, primary key, nullability, default, unique, indexed, foreign-key target) and the table's row estimate and size in megabytes: what the query builder's source picker shows. Needs View Query Builder Schema, and 403 when the caller holds no query-builder grant on the source. Use the column names in execute_query_sources.
| |
|---|
| Scope | analytics:read |
| Asynchronous | No |
| MCP tool | get_query_source |
| Portal permissions | view_query_builder_schema |
Parameters
| Name | In | Type | Required | Description |
|---|
query_source_id | path | string | Required | |
Docwize-Version | header | string (date) | Optional | |
If-None-Match | header | string | Optional | Answers 304 when the representation is unchanged (resources that publish an ETag). |
Responses
Errors
The problem codes this operation can answer with. Each code links to its page.
Schemas
QuerySource
| Field | Type | Required | Description |
|---|
columns | array of QuerySourceColumn | Required | Every column with its keys; null in list items (get_query_source reads them). |
kind | string | Required | table or view. |
name | string | Required | |
query_source_id | string | Required | base64url (no padding) of the granted table or view name. |
row_count | string or null | Required | The database's row estimate, as the query builder shows it; null in list items. |
size_mb | number or null | Required | The table's size on disk in megabytes (0 for a view, which has no storage of its own); null in list items. |
QuerySourceColumn
| Field | Type | Required | Description |
|---|
default_value | string or null | Required | The column's default as the database states it; null when it has none. |
foreign_column | string or null | Required | |
foreign_table | string or null | Required | The table a foreign key points at; null when the column is no foreign key. |
is_foreign_key | boolean | Required | |
is_indexed | boolean | Required | |
is_nullable | boolean | Required | |
is_primary_key | boolean | Required | |
is_unique | boolean | Required | |
key | string | Required | |
name | string | Required | |
ordinal_position | integer or null | Required | The column's place in the table, starting at 1. |
type | string | Required | |