{ "name": "notion-update-data-source", "description": "Update a Notion data source's schema, title, or attributes using SQL DDL statements. Returns Markdown showing updated structure and schema.\n\nAccepts a data source ID (collection ID from fetch response's tag) or a single-source database ID. Multi-source databases require the specific data source ID.\n\nThe statements param accepts semicolon-separated DDL statements:\n- ADD COLUMN \"Name\" - add a new property\n- DROP COLUMN \"Name\" - remove a property\n- RENAME COLUMN \"Old\" TO \"New\" - rename a property\n- ALTER COLUMN \"Name\" SET - change type/options\n\n\nSame type syntax as create_database. Key types:\n- SELECT('opt':color, ...) / MULTI_SELECT('opt':color, ...)\n- NUMBER [FORMAT 'dollar'] / FORMULA('expression')\n- RELATION('ds_id') / RELATION('ds_id', DUAL) / RELATION('ds_id', DUAL 'synced_name' 'synced_id')\n- ROLLUP('rel_prop', 'target_prop', 'function') / UNIQUE_ID [PREFIX 'X']\n- Simple: TITLE, RICH_TEXT, DATE, PEOPLE, CHECKBOX, URL, EMAIL, PHONE_NUMBER, STATUS, FILES\n\n\n{\"data_source_id\": \"f336d0bc-b841-465b-8045-024475c079dd\", \"statements\": \"ADD COLUMN \"Priority\" SELECT('High':red, 'Medium':yellow, 'Low':green); ADD COLUMN \"Due Date\" DATE\"}\n{\"data_source_id\": \"f336d0bc-b841-465b-8045-024475c079dd\", \"statements\": \"RENAME COLUMN \"Status\" TO \"Project Status\"\"}\n{\"data_source_id\": \"f336d0bc-b841-465b-8045-024475c079dd\", \"statements\": \"DROP COLUMN \"Old Property\"\"}\n{\"data_source_id\": \"f336d0bc-b841-465b-8045-024475c079dd\", \"statements\": \"ADD COLUMN \"Parent\" RELATION('f336d0bc-b841-465b-8045-024475c079dd', DUAL 'Children' 'children'); ADD COLUMN \"Children\" RELATION('f336d0bc-b841-465b-8045-024475c079dd', DUAL 'Parent' 'parent')\"}\n{\"data_source_id\": \"f336d0bc-b841-465b-8045-024475c079dd\", \"title\": \"Project Tracker 2024\"}\n{\"data_source_id\": \"f336d0bc-b841-465b-8045-024475c079dd\", \"in_trash\": true}\n\nNotes: Cannot delete/create title properties. Max one unique_id property. Cannot update synced databases. Use \"fetch\" first to see current schema and get the data source ID from tags.", "inputSchema": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "data_source_id": { "type": "string", "description": "The data source to update. Accepts a collection:// URI from tags, a bare UUID, or a database ID (only if the database has a single data source)." }, "statements": { "description": "Semicolon-separated SQL DDL statements to update the schema. Supports ADD COLUMN, DROP COLUMN, RENAME COLUMN, ALTER COLUMN SET.", "type": "string" }, "title": { "description": "The new title of the data source.", "type": "string" }, "description": { "description": "The new description of the data source.", "type": "string" }, "is_inline": { "description": "Whether the database should display inline (true) or as full page (false). Only applicable for single-source databases.", "type": "boolean" }, "in_trash": { "description": "Move data source to trash. Cannot be undone without Notion UI.", "type": "boolean" } }, "required": [ "data_source_id" ], "additionalProperties": {} } }