@atikk-co-jp/notion-mcp-server 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.ja.md +64 -14
  2. package/README.md +64 -14
  3. package/dist/src/index.d.ts +1 -1
  4. package/dist/src/index.d.ts.map +1 -1
  5. package/dist/src/index.js +1 -1
  6. package/dist/src/notion-client.d.ts +26 -10
  7. package/dist/src/notion-client.d.ts.map +1 -1
  8. package/dist/src/notion-client.js +48 -11
  9. package/dist/src/schemas/block.d.ts +2 -1
  10. package/dist/src/schemas/block.d.ts.map +1 -1
  11. package/dist/src/tools/create-database.js +3 -3
  12. package/dist/src/tools/create-page-simple.d.ts.map +1 -1
  13. package/dist/src/tools/create-page-simple.js +6 -5
  14. package/dist/src/tools/create-page.js +6 -6
  15. package/dist/src/tools/index.d.ts +4 -2
  16. package/dist/src/tools/index.d.ts.map +1 -1
  17. package/dist/src/tools/index.js +8 -3
  18. package/dist/src/tools/move-page.d.ts.map +1 -1
  19. package/dist/src/tools/move-page.js +8 -7
  20. package/dist/src/tools/query-data-source.d.ts +4 -0
  21. package/dist/src/tools/query-data-source.d.ts.map +1 -0
  22. package/dist/src/tools/{query-database.js → query-data-source.js} +9 -7
  23. package/dist/src/tools/retrieve-data-source.d.ts +4 -0
  24. package/dist/src/tools/retrieve-data-source.d.ts.map +1 -0
  25. package/dist/src/tools/retrieve-data-source.js +55 -0
  26. package/dist/src/tools/retrieve-database.d.ts.map +1 -1
  27. package/dist/src/tools/retrieve-database.js +7 -24
  28. package/dist/src/tools/search.d.ts.map +1 -1
  29. package/dist/src/tools/search.js +6 -5
  30. package/dist/src/tools/update-data-source.d.ts +4 -0
  31. package/dist/src/tools/update-data-source.d.ts.map +1 -0
  32. package/dist/src/tools/update-data-source.js +31 -0
  33. package/dist/src/tools/update-database.d.ts.map +1 -1
  34. package/dist/src/tools/update-database.js +9 -8
  35. package/dist/src/tools/update-page.d.ts.map +1 -1
  36. package/dist/src/tools/update-page.js +9 -4
  37. package/package.json +1 -1
  38. package/dist/src/tools/query-database.d.ts +0 -4
  39. package/dist/src/tools/query-database.d.ts.map +0 -1
package/README.ja.md CHANGED
@@ -6,6 +6,8 @@ Notion API用のMCP(Model Context Protocol)サーバー。AIアシスタン
6
6
 
7
7
  > ⚠️ **注意**: これは初期リリースです。APIは変更される可能性があります。
8
8
 
9
+ > **APIバージョン**: 2025-09-03(最新)
10
+
9
11
  ## 特徴
10
12
 
11
13
  - **ページ操作**: Notionページの作成、取得、更新、移動
@@ -34,7 +36,10 @@ Notion API用のMCP(Model Context Protocol)サーバー。AIアシスタン
34
36
  | | [Retrieve database](https://developers.notion.com/reference/retrieve-a-database) | `retrieve-database` | simple/json |
35
37
  | | [Update database](https://developers.notion.com/reference/update-a-database) | `update-database` | JSON |
36
38
  | | [Archive database](https://developers.notion.com/reference/update-a-database) | `archive-database` | JSON |
37
- | | [Query database](https://developers.notion.com/reference/post-database-query) | `query-database` | simple/json |
39
+ | **データソース** | | | |
40
+ | | [Retrieve data source](https://developers.notion.com/reference/retrieve-a-data-source) | `retrieve-data-source` | simple/json |
41
+ | | [Query data source](https://developers.notion.com/reference/post-data-source-query) | `query-data-source` | simple/json |
42
+ | | [Update data source](https://developers.notion.com/reference/patch-data-source) | `update-data-source` | JSON |
38
43
  | **ブロック** | | | |
39
44
  | | [Retrieve block](https://developers.notion.com/reference/retrieve-a-block) | `retrieve-block` | markdown/json |
40
45
  | | [Update block](https://developers.notion.com/reference/update-a-block) | `update-block` | JSON |
@@ -134,11 +139,11 @@ Claude Desktopの設定ファイル(macOSの場合: `~/.config/claude/claude_d
134
139
 
135
140
  ### create-page
136
141
 
137
- データベースに新しいページを作成します。
142
+ データソースに新しいページを作成します。
138
143
 
139
144
  ```json
140
145
  {
141
- "database_id": "データベースのUUID",
146
+ "data_source_id": "データソースのUUID",
142
147
  "properties": {
143
148
  "Name": {
144
149
  "title": [{ "text": { "content": "新しいページタイトル" } }]
@@ -155,7 +160,7 @@ Claude Desktopの設定ファイル(macOSの場合: `~/.config/claude/claude_d
155
160
  Markdownを使ってページを作成します。`create-page`と比較して**出力トークン約80%削減**。
156
161
 
157
162
  **パラメータ:**
158
- - `database_id` (必須): ページを作成するデータベースのID
163
+ - `data_source_id` (必須): ページを作成するデータソースのID
159
164
  - `title` (必須): ページタイトル(文字列)
160
165
  - `content` (任意): ページ本文(Markdown形式)
161
166
  - `properties` (任意): 追加のNotionプロパティ
@@ -173,7 +178,7 @@ Markdownを使ってページを作成します。`create-page`と比較して**
173
178
 
174
179
  ```json
175
180
  {
176
- "database_id": "データベースのUUID",
181
+ "data_source_id": "データソースのUUID",
177
182
  "title": "バグレポート",
178
183
  "content": "## 再現手順\n\n1. ログイン\n2. 設定を開く\n\n## 期待動作\n\n正常に表示される",
179
184
  "properties": {
@@ -191,7 +196,15 @@ Markdownを使ってページを作成します。`create-page`と比較して**
191
196
 
192
197
  ### update-page
193
198
 
194
- ページのプロパティを更新します。
199
+ ページのプロパティ、アイコン、カバー、アーカイブ状態、ロック状態を更新します。
200
+
201
+ **パラメータ:**
202
+ - `page_id` (必須): 更新するページのID
203
+ - `properties` (任意): 更新するプロパティ
204
+ - `icon` (任意): アイコン(nullで削除)
205
+ - `cover` (任意): カバー画像(nullで削除)
206
+ - `archived` (任意): trueでアーカイブ
207
+ - `is_locked` (任意): ページをロックしてUI上での編集を防止
195
208
 
196
209
  ```json
197
210
  {
@@ -200,16 +213,17 @@ Markdownを使ってページを作成します。`create-page`と比較して**
200
213
  "Status": {
201
214
  "status": { "name": "完了" }
202
215
  }
203
- }
216
+ },
217
+ "is_locked": true
204
218
  }
205
219
  ```
206
220
 
207
- ### query-database
221
+ ### query-data-source
208
222
 
209
- フィルターやソートを使ってデータベースをクエリします。
223
+ フィルターやソートを使ってデータソースをクエリします。
210
224
 
211
225
  **パラメータ:**
212
- - `database_id` (必須): クエリするデータベースのID
226
+ - `data_source_id` (必須): クエリするデータソースのID
213
227
  - `filter` (任意): フィルター条件(JSONオブジェクト)
214
228
  - `sorts` (任意): ソート条件(配列)
215
229
  - `start_cursor` (任意): ページネーション用カーソル
@@ -220,7 +234,7 @@ Markdownを使ってページを作成します。`create-page`と比較して**
220
234
 
221
235
  ```json
222
236
  {
223
- "database_id": "データベースのUUID",
237
+ "data_source_id": "データソースのUUID",
224
238
  "filter": {
225
239
  "property": "Status",
226
240
  "status": { "equals": "進行中" }
@@ -258,20 +272,54 @@ Markdownを使ってページを作成します。`create-page`と比較して**
258
272
 
259
273
  ### update-database
260
274
 
261
- 既存のデータベースのプロパティ、タイトル、スキーマを更新します。
275
+ 既存のデータベースコンテナ(タイトル、説明、アイコン、カバー)を更新します。
276
+
277
+ **注意:** スキーマ(プロパティ/カラム)の更新には `update-data-source` を使用してください。
262
278
 
263
279
  **パラメータ:**
264
280
  - `database_id` (必須): 更新するデータベースのID
265
281
  - `title` (任意): 新しいタイトル(リッチテキスト配列)
266
282
  - `description` (任意): 新しい説明(リッチテキスト配列)
267
- - `properties` (任意): 追加、更新、削除するプロパティ(nullで削除)
268
283
  - `icon` (任意): アイコン(nullで削除)
269
284
  - `cover` (任意): カバー画像(nullで削除)
285
+ - `is_inline` (任意): trueの場合、インラインデータベースとして作成
270
286
  - `archived` (任意): trueでアーカイブ
287
+ - `is_locked` (任意): データベースをロックしてUI上での編集を防止
271
288
 
272
289
  ```json
273
290
  {
274
291
  "database_id": "データベースのUUID",
292
+ "title": [{ "type": "text", "text": { "content": "新しいタイトル" } }],
293
+ "is_locked": true
294
+ }
295
+ ```
296
+
297
+ ### retrieve-data-source
298
+
299
+ データソーススキーマをIDで取得します。
300
+
301
+ **パラメータ:**
302
+ - `data_source_id` (必須): データソースのID
303
+ - `format` (任意): 出力形式 - `"simple"` (デフォルト) または `"json"`
304
+
305
+ ```json
306
+ {
307
+ "data_source_id": "データソースのUUID",
308
+ "format": "simple"
309
+ }
310
+ ```
311
+
312
+ ### update-data-source
313
+
314
+ データソーススキーマ(プロパティ/カラム)を更新します。
315
+
316
+ **パラメータ:**
317
+ - `data_source_id` (必須): 更新するデータソースのID
318
+ - `properties` (任意): 追加、更新、削除するプロパティ(nullで削除)
319
+
320
+ ```json
321
+ {
322
+ "data_source_id": "データソースのUUID",
275
323
  "properties": {
276
324
  "NewColumn": { "rich_text": {} },
277
325
  "OldColumn": null
@@ -281,7 +329,7 @@ Markdownを使ってページを作成します。`create-page`と比較して**
281
329
 
282
330
  ### search
283
331
 
284
- すべてのページとデータベースを横断検索します。
332
+ すべてのページとデータソースを横断検索します。
285
333
 
286
334
  ```json
287
335
  {
@@ -290,6 +338,8 @@ Markdownを使ってページを作成します。`create-page`と比較して**
290
338
  }
291
339
  ```
292
340
 
341
+ **フィルター値:** `"page"` または `"data_source"`
342
+
293
343
  ### get-block-children
294
344
 
295
345
  ページまたはブロックの子ブロックを取得します。
package/README.md CHANGED
@@ -6,6 +6,8 @@ MCP (Model Context Protocol) server for Notion API. Enables AI assistants to int
6
6
 
7
7
  > ⚠️ **Note**: This is an early release. API may change.
8
8
 
9
+ > **API Version**: 2025-09-03 (latest)
10
+
9
11
  ## Features
10
12
 
11
13
  - **Page Operations**: Create, retrieve, update, and move Notion pages
@@ -34,7 +36,10 @@ MCP (Model Context Protocol) server for Notion API. Enables AI assistants to int
34
36
  | | [Retrieve database](https://developers.notion.com/reference/retrieve-a-database) | `retrieve-database` | simple/json |
35
37
  | | [Update database](https://developers.notion.com/reference/update-a-database) | `update-database` | JSON |
36
38
  | | [Archive database](https://developers.notion.com/reference/update-a-database) | `archive-database` | JSON |
37
- | | [Query database](https://developers.notion.com/reference/post-database-query) | `query-database` | simple/json |
39
+ | **Data Sources** | | | |
40
+ | | [Retrieve data source](https://developers.notion.com/reference/retrieve-a-data-source) | `retrieve-data-source` | simple/json |
41
+ | | [Query data source](https://developers.notion.com/reference/post-data-source-query) | `query-data-source` | simple/json |
42
+ | | [Update data source](https://developers.notion.com/reference/patch-data-source) | `update-data-source` | JSON |
38
43
  | **Blocks** | | | |
39
44
  | | [Retrieve block](https://developers.notion.com/reference/retrieve-a-block) | `retrieve-block` | markdown/json |
40
45
  | | [Update block](https://developers.notion.com/reference/update-a-block) | `update-block` | JSON |
@@ -134,11 +139,11 @@ Retrieve a Notion page by its ID.
134
139
 
135
140
  ### create-page
136
141
 
137
- Create a new page in a database.
142
+ Create a new page in a data source.
138
143
 
139
144
  ```json
140
145
  {
141
- "database_id": "database-uuid-here",
146
+ "data_source_id": "data-source-uuid-here",
142
147
  "properties": {
143
148
  "Name": {
144
149
  "title": [{ "text": { "content": "New Page Title" } }]
@@ -155,7 +160,7 @@ Create a new page in a database.
155
160
  Create a new page using Markdown. **~80% fewer output tokens** compared to `create-page`.
156
161
 
157
162
  **Parameters:**
158
- - `database_id` (required): The database ID to create the page in
163
+ - `data_source_id` (required): The data source ID to create the page in
159
164
  - `title` (required): Page title as a simple string
160
165
  - `content` (optional): Page content in Markdown
161
166
  - `properties` (optional): Additional Notion properties
@@ -173,7 +178,7 @@ Create a new page using Markdown. **~80% fewer output tokens** compared to `crea
173
178
 
174
179
  ```json
175
180
  {
176
- "database_id": "database-uuid-here",
181
+ "data_source_id": "data-source-uuid-here",
177
182
  "title": "Bug Report",
178
183
  "content": "## Steps to Reproduce\n\n1. Login\n2. Open settings\n\n## Expected Behavior\n\nShould display correctly",
179
184
  "properties": {
@@ -191,7 +196,15 @@ Create a new page using Markdown. **~80% fewer output tokens** compared to `crea
191
196
 
192
197
  ### update-page
193
198
 
194
- Update a page's properties.
199
+ Update a page's properties, icon, cover, archive status, or lock status.
200
+
201
+ **Parameters:**
202
+ - `page_id` (required): The ID of the page to update
203
+ - `properties` (optional): Properties to update
204
+ - `icon` (optional): Icon (set to null to remove)
205
+ - `cover` (optional): Cover image (set to null to remove)
206
+ - `archived` (optional): Set to true to archive
207
+ - `is_locked` (optional): Lock the page to prevent edits in the UI
195
208
 
196
209
  ```json
197
210
  {
@@ -200,16 +213,17 @@ Update a page's properties.
200
213
  "Status": {
201
214
  "status": { "name": "Done" }
202
215
  }
203
- }
216
+ },
217
+ "is_locked": true
204
218
  }
205
219
  ```
206
220
 
207
- ### query-database
221
+ ### query-data-source
208
222
 
209
- Query a database with optional filters and sorts.
223
+ Query a data source with optional filters and sorts.
210
224
 
211
225
  **Parameters:**
212
- - `database_id` (required): The ID of the database to query
226
+ - `data_source_id` (required): The ID of the data source to query
213
227
  - `filter` (optional): Filter conditions as a JSON object
214
228
  - `sorts` (optional): Sort conditions as an array
215
229
  - `start_cursor` (optional): Cursor for pagination
@@ -220,7 +234,7 @@ Query a database with optional filters and sorts.
220
234
 
221
235
  ```json
222
236
  {
223
- "database_id": "database-uuid-here",
237
+ "data_source_id": "data-source-uuid-here",
224
238
  "filter": {
225
239
  "property": "Status",
226
240
  "status": { "equals": "In Progress" }
@@ -258,20 +272,54 @@ Create a new database as a subpage of an existing page.
258
272
 
259
273
  ### update-database
260
274
 
261
- Update an existing database's properties, title, or schema.
275
+ Update an existing database container (title, description, icon, cover).
276
+
277
+ **Note:** For schema (properties/columns) updates, use `update-data-source` instead.
262
278
 
263
279
  **Parameters:**
264
280
  - `database_id` (required): The ID of the database to update
265
281
  - `title` (optional): New title as rich text array
266
282
  - `description` (optional): New description as rich text array
267
- - `properties` (optional): Properties to add, update, or delete (set to null)
268
283
  - `icon` (optional): Icon (set to null to remove)
269
284
  - `cover` (optional): Cover image (set to null to remove)
285
+ - `is_inline` (optional): If true, creates an inline database
270
286
  - `archived` (optional): Set to true to archive
287
+ - `is_locked` (optional): Lock the database to prevent edits in the UI
271
288
 
272
289
  ```json
273
290
  {
274
291
  "database_id": "database-uuid-here",
292
+ "title": [{ "type": "text", "text": { "content": "New Title" } }],
293
+ "is_locked": true
294
+ }
295
+ ```
296
+
297
+ ### retrieve-data-source
298
+
299
+ Retrieve a data source schema by its ID.
300
+
301
+ **Parameters:**
302
+ - `data_source_id` (required): The ID of the data source
303
+ - `format` (optional): Output format - `"simple"` (default) or `"json"`
304
+
305
+ ```json
306
+ {
307
+ "data_source_id": "data-source-uuid-here",
308
+ "format": "simple"
309
+ }
310
+ ```
311
+
312
+ ### update-data-source
313
+
314
+ Update a data source schema (properties/columns).
315
+
316
+ **Parameters:**
317
+ - `data_source_id` (required): The ID of the data source to update
318
+ - `properties` (optional): Properties to add, update, or delete (set to null)
319
+
320
+ ```json
321
+ {
322
+ "data_source_id": "data-source-uuid-here",
275
323
  "properties": {
276
324
  "NewColumn": { "rich_text": {} },
277
325
  "OldColumn": null
@@ -281,7 +329,7 @@ Update an existing database's properties, title, or schema.
281
329
 
282
330
  ### search
283
331
 
284
- Search across all pages and databases.
332
+ Search across all pages and data sources.
285
333
 
286
334
  ```json
287
335
  {
@@ -290,6 +338,8 @@ Search across all pages and databases.
290
338
  }
291
339
  ```
292
340
 
341
+ **Filter values:** `"page"` or `"data_source"`
342
+
293
343
  ### get-block-children
294
344
 
295
345
  Get the child blocks of a page or block.
@@ -1,7 +1,7 @@
1
1
  export { createNotionClient, type NotionClient } from './notion-client.js';
2
2
  export * from './schemas/index.js';
3
3
  export { startServer } from './server.js';
4
- export { registerAllTools, registerAppendBlockChildren, registerCreateComment, registerCreatePage, registerGetBlockChildren, registerQueryDatabase, registerRetrievePage, registerSearch, registerUpdatePage, } from './tools/index.js';
4
+ export { registerAllTools, registerAppendBlockChildren, registerCreateComment, registerCreatePage, registerGetBlockChildren, registerQueryDataSource, registerRetrieveDataSource, registerRetrievePage, registerSearch, registerUpdateDataSource, registerUpdatePage, } from './tools/index.js';
5
5
  export type { McpResponse, McpTextContent } from './utils/index.js';
6
6
  export { formatResponse, formatSuccessMessage, handleError } from './utils/index.js';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAE1E,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,GACnB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEnE,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAE1E,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,cAAc,EACd,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEnE,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA"}
package/dist/src/index.js CHANGED
@@ -4,6 +4,6 @@ export { createNotionClient } from './notion-client.js';
4
4
  export * from './schemas/index.js';
5
5
  export { startServer } from './server.js';
6
6
  // Tool registration
7
- export { registerAllTools, registerAppendBlockChildren, registerCreateComment, registerCreatePage, registerGetBlockChildren, registerQueryDatabase, registerRetrievePage, registerSearch, registerUpdatePage, } from './tools/index.js';
7
+ export { registerAllTools, registerAppendBlockChildren, registerCreateComment, registerCreatePage, registerGetBlockChildren, registerQueryDataSource, registerRetrieveDataSource, registerRetrievePage, registerSearch, registerUpdateDataSource, registerUpdatePage, } from './tools/index.js';
8
8
  // Utils
9
9
  export { formatResponse, formatSuccessMessage, handleError } from './utils/index.js';
@@ -35,6 +35,8 @@ export declare class NotionClient {
35
35
  database_id: string;
36
36
  } | {
37
37
  page_id: string;
38
+ } | {
39
+ data_source_id: string;
38
40
  };
39
41
  properties: Record<string, PropertyValue>;
40
42
  children?: Block[];
@@ -50,6 +52,7 @@ export declare class NotionClient {
50
52
  archived?: boolean;
51
53
  icon?: Icon | null;
52
54
  cover?: Cover | null;
55
+ is_locked?: boolean;
53
56
  }) => Promise<T>;
54
57
  retrieveProperty: <T>(params: {
55
58
  page_id: string;
@@ -63,27 +66,40 @@ export declare class NotionClient {
63
66
  page_id: string;
64
67
  } | {
65
68
  database_id: string;
69
+ } | {
70
+ data_source_id: string;
66
71
  };
67
72
  }) => Promise<T>;
68
73
  };
74
+ dataSources: {
75
+ retrieve: <T>(params: {
76
+ data_source_id: string;
77
+ }) => Promise<T>;
78
+ query: <T>(params: {
79
+ data_source_id: string;
80
+ filter?: Filter;
81
+ sorts?: Sort[];
82
+ start_cursor?: string;
83
+ page_size?: number;
84
+ }) => Promise<T>;
85
+ update: <T>(params: {
86
+ data_source_id: string;
87
+ properties?: DatabaseProperties;
88
+ }) => Promise<T>;
89
+ };
69
90
  databases: {
70
91
  create: <T>(params: {
71
92
  parent: {
72
93
  page_id: string;
73
94
  };
74
95
  title?: RichText[];
75
- properties: DatabaseProperties;
96
+ initial_data_source?: {
97
+ properties: DatabaseProperties;
98
+ };
76
99
  icon?: Icon;
77
100
  cover?: Cover;
78
101
  is_inline?: boolean;
79
102
  }) => Promise<T>;
80
- query: <T>(params: {
81
- database_id: string;
82
- filter?: Filter;
83
- sorts?: Sort[];
84
- start_cursor?: string;
85
- page_size?: number;
86
- }) => Promise<T>;
87
103
  retrieve: <T>(params: {
88
104
  database_id: string;
89
105
  }) => Promise<T>;
@@ -91,11 +107,11 @@ export declare class NotionClient {
91
107
  database_id: string;
92
108
  title?: RichText[];
93
109
  description?: RichText[];
94
- properties?: DatabaseProperties;
95
110
  icon?: Icon | null;
96
111
  cover?: Cover | null;
97
112
  is_inline?: boolean;
98
113
  archived?: boolean;
114
+ is_locked?: boolean;
99
115
  }) => Promise<T>;
100
116
  };
101
117
  blocks: {
@@ -149,7 +165,7 @@ export declare class NotionClient {
149
165
  search: <T>(params?: {
150
166
  query?: string;
151
167
  filter?: {
152
- value: "page" | "database";
168
+ value: "page" | "data_source";
153
169
  property: "object";
154
170
  };
155
171
  sort?: {
@@ -1 +1 @@
1
- {"version":3,"file":"notion-client.d.ts","sourceRoot":"","sources":["../../src/notion-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAClF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAM5D,KAAK,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAC9C,KAAK,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA;AACtC,KAAK,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AACxC,KAAK,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AACxD,KAAK,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAClE,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,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AK,CAAC,EAAE,MAAM,CAAA;QACd,MAAM,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC;YAAC,QAAQ,EAAE,QAAQ,CAAA;SAAE,CAAA;QAC9D,IAAI,CAAC,EAAE;YAAE,SAAS,EAAE,WAAW,GAAG,YAAY,CAAC;YAAC,SAAS,EAAE,kBAAkB,CAAA;SAAE,CAAA;QAC/E,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,KAAG,OAAO,CAAC,CAAC,CAAC,CAEb;CACF;AAED,wBAAgB,kBAAkB,IAAI,YAAY,CASjD"}
@@ -1,5 +1,5 @@
1
1
  const NOTION_API_BASE = 'https://api.notion.com/v1';
2
- const NOTION_VERSION = '2022-06-28';
2
+ const NOTION_VERSION = '2025-09-03';
3
3
  export class NotionClient {
4
4
  token;
5
5
  constructor(options) {
@@ -40,7 +40,19 @@ export class NotionClient {
40
40
  // Pages
41
41
  pages = {
42
42
  create: (params) => {
43
- return this.request('/pages', { method: 'POST', body: params });
43
+ // API 2025-09-03 requires explicit type in parent
44
+ let parentWithType;
45
+ if ('data_source_id' in params.parent) {
46
+ parentWithType = { type: 'data_source_id', data_source_id: params.parent.data_source_id };
47
+ }
48
+ else if ('database_id' in params.parent) {
49
+ parentWithType = { type: 'database_id', database_id: params.parent.database_id };
50
+ }
51
+ else {
52
+ parentWithType = { type: 'page_id', page_id: params.parent.page_id };
53
+ }
54
+ const body = { ...params, parent: parentWithType };
55
+ return this.request('/pages', { method: 'POST', body });
44
56
  },
45
57
  retrieve: (params) => {
46
58
  return this.request(`/pages/${params.page_id}`);
@@ -56,18 +68,43 @@ export class NotionClient {
56
68
  });
57
69
  },
58
70
  move: (params) => {
59
- const { page_id, ...body } = params;
60
- return this.request(`/pages/${page_id}/move`, { method: 'POST', body });
71
+ // API 2025-09-03 requires explicit type in parent
72
+ let parentWithType;
73
+ if ('data_source_id' in params.parent) {
74
+ parentWithType = { type: 'data_source_id', data_source_id: params.parent.data_source_id };
75
+ }
76
+ else if ('database_id' in params.parent) {
77
+ parentWithType = { type: 'database_id', database_id: params.parent.database_id };
78
+ }
79
+ else {
80
+ parentWithType = { type: 'page_id', page_id: params.parent.page_id };
81
+ }
82
+ return this.request(`/pages/${params.page_id}/move`, { method: 'POST', body: { parent: parentWithType } });
61
83
  },
62
84
  };
63
- // Databases
64
- databases = {
65
- create: (params) => {
66
- return this.request('/databases', { method: 'POST', body: params });
85
+ // Data Sources (new in 2025-09-03)
86
+ dataSources = {
87
+ retrieve: (params) => {
88
+ return this.request(`/data_sources/${params.data_source_id}`);
67
89
  },
68
90
  query: (params) => {
69
- const { database_id, ...body } = params;
70
- return this.request(`/databases/${database_id}/query`, { method: 'POST', body });
91
+ const { data_source_id, ...body } = params;
92
+ return this.request(`/data_sources/${data_source_id}/query`, { method: 'POST', body });
93
+ },
94
+ update: (params) => {
95
+ const { data_source_id, ...body } = params;
96
+ return this.request(`/data_sources/${data_source_id}`, { method: 'PATCH', body });
97
+ },
98
+ };
99
+ // Databases (container operations only in 2025-09-03)
100
+ databases = {
101
+ create: (params) => {
102
+ // API 2025-09-03 requires explicit type in parent
103
+ const body = {
104
+ ...params,
105
+ parent: { type: 'page_id', page_id: params.parent.page_id },
106
+ };
107
+ return this.request('/databases', { method: 'POST', body });
71
108
  },
72
109
  retrieve: (params) => {
73
110
  return this.request(`/databases/${params.database_id}`);
@@ -127,7 +164,7 @@ export class NotionClient {
127
164
  return this.request('/users/me');
128
165
  },
129
166
  };
130
- // Search
167
+ // Search (filter value changed from 'database' to 'data_source' in 2025-09-03)
131
168
  search = (params) => {
132
169
  return this.request('/search', { method: 'POST', body: params || {} });
133
170
  };
@@ -17,11 +17,12 @@ export interface Block {
17
17
  archived?: boolean;
18
18
  in_trash?: boolean;
19
19
  parent?: {
20
- type: 'database_id' | 'page_id' | 'block_id' | 'workspace';
20
+ type: 'database_id' | 'page_id' | 'block_id' | 'workspace' | 'data_source_id';
21
21
  database_id?: string;
22
22
  page_id?: string;
23
23
  block_id?: string;
24
24
  workspace?: boolean;
25
+ data_source_id?: string;
25
26
  };
26
27
  [key: string]: unknown;
27
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../src/schemas/block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,MAAM,WAAW,KAAK;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3C,cAAc,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/C,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,CAAA;QAC1D,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB,CAAA;IACD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAGD,eAAO,MAAM,kBAAkB;;;;;iBAK7B,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;iBAM3B,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;iBAM3B,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;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MjC,CAAA;AAGF,eAAO,MAAM,qBAAqB;;;;;;;;;;iBAahC,CAAA;AAGF,eAAO,MAAM,yBAAyB;;;;;;;iBAOpC,CAAA;AAGF,eAAO,MAAM,0BAA0B;;;;;;;;;iBASrC,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;mBAAmE,CAAA;AAGjG,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS3B,CAAA;AAGF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAM9B,CAAA;AAGF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAO9B,CAAA;AAGF,eAAO,MAAM,sBAAsB;;;;iBAIjC,CAAA;AAGF,eAAO,MAAM,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAoCxC,CAAA;AAED,eAAO,MAAM,mBAAmB,iFAAuB,CAAA"}
@@ -7,7 +7,7 @@ const inputSchema = {
7
7
  properties: z
8
8
  .record(z.string(), z.any())
9
9
  .describe('Property schema (must include one title property)'),
10
- icon: z.any().optional().describe('Database icon'),
10
+ icon: z.any().optional().describe('Database icon { type: "emoji", emoji: "📝" } or { type: "external", external: { url: "..." } }. Emoji must be an actual emoji character.'),
11
11
  cover: z.any().optional().describe('Cover image'),
12
12
  is_inline: z.boolean().optional().describe('Inline database'),
13
13
  };
@@ -15,13 +15,13 @@ export function registerCreateDatabase(server, notion) {
15
15
  server.registerTool('create-database', {
16
16
  description: 'Create a new database as a subpage of an existing Notion page. ' +
17
17
  'Requires a parent_page_id and properties object defining the database schema. ' +
18
- 'Each database must have exactly one title property.',
18
+ 'Each database must have exactly one title property. (API version 2025-09-03)',
19
19
  inputSchema,
20
20
  }, async ({ parent_page_id, title, properties, icon, cover, is_inline }) => {
21
21
  try {
22
22
  const params = {
23
23
  parent: { page_id: parent_page_id },
24
- properties: properties,
24
+ initial_data_source: { properties: properties },
25
25
  };
26
26
  if (title) {
27
27
  params.title = title;
@@ -1 +1 @@
1
- {"version":3,"file":"create-page-simple.d.ts","sourceRoot":"","sources":["../../../src/tools/create-page-simple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAYvD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA2DtF"}
1
+ {"version":3,"file":"create-page-simple.d.ts","sourceRoot":"","sources":["../../../src/tools/create-page-simple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAYvD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA4DtF"}
@@ -3,19 +3,20 @@ import { markdownToBlocks } from '../converters/index.js';
3
3
  import { formatResponse, handleError } from '../utils/index.js';
4
4
  // Minimal schema for MCP
5
5
  const inputSchema = {
6
- database_id: z.string().describe('Database ID'),
6
+ data_source_id: z.string().describe('Data source ID (required in API 2025-09-03)'),
7
7
  title: z.string().describe('Page title'),
8
8
  content: z.string().optional().describe('Page content in Markdown'),
9
9
  properties: z.record(z.string(), z.any()).optional().describe('Additional properties'),
10
- icon: z.string().optional().describe('Emoji icon (e.g. "bug")'),
10
+ icon: z.string().optional().describe('Emoji character (e.g. "📝", "🐛", "✅"). Must be an actual emoji, not a name.'),
11
11
  };
12
12
  export function registerCreatePageSimple(server, notion) {
13
13
  server.registerTool('create-page-simple', {
14
14
  description: 'Create a Notion page with Markdown content. ' +
15
15
  'Simpler than create-page: just provide title and markdown text. ' +
16
- 'Supports: headings (#), lists (- or 1.), checkboxes (- [ ]), code blocks (```), quotes (>), images (![]()), bold (**), italic (*), links ([]()), etc.',
16
+ 'Supports: headings (#), lists (- or 1.), checkboxes (- [ ]), code blocks (```), quotes (>), images (![]()), bold (**), italic (*), links ([]()), etc. ' +
17
+ '(API version 2025-09-03)',
17
18
  inputSchema,
18
- }, async ({ database_id, title, content, properties, icon }) => {
19
+ }, async ({ data_source_id, title, content, properties, icon }) => {
19
20
  try {
20
21
  // Build properties with title
21
22
  const pageProperties = {
@@ -32,7 +33,7 @@ export function registerCreatePageSimple(server, notion) {
32
33
  }
33
34
  // Build params
34
35
  const params = {
35
- parent: { database_id },
36
+ parent: { data_source_id },
36
37
  properties: pageProperties,
37
38
  };
38
39
  // Convert markdown to blocks if content provided
@@ -2,22 +2,22 @@ import { z } from 'zod';
2
2
  import { formatResponse, handleError } from '../utils/index.js';
3
3
  // Minimal schema for MCP (full validation by Notion API)
4
4
  const inputSchema = {
5
- database_id: z.string().describe('Database ID'),
5
+ data_source_id: z.string().describe('Data source ID (required in API 2025-09-03)'),
6
6
  properties: z.record(z.string(), z.any()).describe('Notion properties object'),
7
7
  children: z.array(z.any()).optional().describe('Block objects array'),
8
- icon: z.any().optional().describe('Page icon'),
8
+ icon: z.any().optional().describe('Page icon { type: "emoji", emoji: "📝" } or { type: "external", external: { url: "..." } }. Emoji must be an actual emoji character.'),
9
9
  cover: z.any().optional().describe('Cover image'),
10
10
  };
11
11
  export function registerCreatePage(server, notion) {
12
12
  server.registerTool('create-page', {
13
- description: 'Create a new page in a Notion database. Requires a database_id and properties object. ' +
13
+ description: 'Create a new page in a Notion data source. Requires a data_source_id and properties object. ' +
14
14
  'Optionally include initial content blocks, icon, and cover image. ' +
15
- 'Returns the created page with its ID and URL.',
15
+ 'Returns the created page with its ID and URL. (API version 2025-09-03)',
16
16
  inputSchema,
17
- }, async ({ database_id, properties, children, icon, cover }) => {
17
+ }, async ({ data_source_id, properties, children, icon, cover }) => {
18
18
  try {
19
19
  const params = {
20
- parent: { database_id },
20
+ parent: { data_source_id },
21
21
  properties: properties,
22
22
  };
23
23
  if (children) {
@@ -13,10 +13,11 @@ import { registerGetBlockChildren } from './get-block-children.js';
13
13
  import { registerListComments } from './list-comments.js';
14
14
  import { registerListUsers } from './list-users.js';
15
15
  import { registerMovePage } from './move-page.js';
16
- import { registerQueryDatabase } from './query-database.js';
16
+ import { registerQueryDataSource } from './query-data-source.js';
17
17
  import { registerRetrieveBlock } from './retrieve-block.js';
18
18
  import { registerRetrieveBotUser } from './retrieve-bot-user.js';
19
19
  import { registerRetrieveDatabase } from './retrieve-database.js';
20
+ import { registerRetrieveDataSource } from './retrieve-data-source.js';
20
21
  import { registerRetrievePage } from './retrieve-page.js';
21
22
  import { registerRetrievePageProperty } from './retrieve-page-property.js';
22
23
  import { registerRetrieveUser } from './retrieve-user.js';
@@ -24,7 +25,8 @@ import { registerSearch } from './search.js';
24
25
  import { registerUpdateBlock } from './update-block.js';
25
26
  import { registerUpdateBlockSimple } from './update-block-simple.js';
26
27
  import { registerUpdateDatabase } from './update-database.js';
28
+ import { registerUpdateDataSource } from './update-data-source.js';
27
29
  import { registerUpdatePage } from './update-page.js';
28
30
  export declare function registerAllTools(server: McpServer, notion: NotionClient): void;
29
- export { registerRetrievePage, registerCreatePage, registerCreatePageSimple, registerUpdatePage, registerArchivePage, registerRetrievePageProperty, registerMovePage, registerCreateDatabase, registerUpdateDatabase, registerArchiveDatabase, registerQueryDatabase, registerRetrieveDatabase, registerSearch, registerGetBlockChildren, registerAppendBlockChildren, registerAppendBlocksSimple, registerRetrieveBlock, registerUpdateBlock, registerUpdateBlockSimple, registerDeleteBlock, registerCreateComment, registerListComments, registerListUsers, registerRetrieveUser, registerRetrieveBotUser, };
31
+ export { registerRetrievePage, registerCreatePage, registerCreatePageSimple, registerUpdatePage, registerArchivePage, registerRetrievePageProperty, registerMovePage, registerCreateDatabase, registerUpdateDatabase, registerArchiveDatabase, registerRetrieveDatabase, registerRetrieveDataSource, registerQueryDataSource, registerUpdateDataSource, registerSearch, registerGetBlockChildren, registerAppendBlockChildren, registerAppendBlocksSimple, registerRetrieveBlock, registerUpdateBlock, registerUpdateBlockSimple, registerDeleteBlock, registerCreateComment, registerListComments, registerListUsers, registerRetrieveUser, registerRetrieveBotUser, };
30
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAA;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;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A;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAErD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAyC9E;AAED,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,EACxB,cAAc,EACd,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,GACxB,CAAA"}
@@ -11,10 +11,11 @@ import { registerGetBlockChildren } from './get-block-children.js';
11
11
  import { registerListComments } from './list-comments.js';
12
12
  import { registerListUsers } from './list-users.js';
13
13
  import { registerMovePage } from './move-page.js';
14
- import { registerQueryDatabase } from './query-database.js';
14
+ import { registerQueryDataSource } from './query-data-source.js';
15
15
  import { registerRetrieveBlock } from './retrieve-block.js';
16
16
  import { registerRetrieveBotUser } from './retrieve-bot-user.js';
17
17
  import { registerRetrieveDatabase } from './retrieve-database.js';
18
+ import { registerRetrieveDataSource } from './retrieve-data-source.js';
18
19
  import { registerRetrievePage } from './retrieve-page.js';
19
20
  import { registerRetrievePageProperty } from './retrieve-page-property.js';
20
21
  import { registerRetrieveUser } from './retrieve-user.js';
@@ -22,6 +23,7 @@ import { registerSearch } from './search.js';
22
23
  import { registerUpdateBlock } from './update-block.js';
23
24
  import { registerUpdateBlockSimple } from './update-block-simple.js';
24
25
  import { registerUpdateDatabase } from './update-database.js';
26
+ import { registerUpdateDataSource } from './update-data-source.js';
25
27
  import { registerUpdatePage } from './update-page.js';
26
28
  export function registerAllTools(server, notion) {
27
29
  // Page operations
@@ -36,8 +38,11 @@ export function registerAllTools(server, notion) {
36
38
  registerCreateDatabase(server, notion);
37
39
  registerUpdateDatabase(server, notion);
38
40
  registerArchiveDatabase(server, notion);
39
- registerQueryDatabase(server, notion);
40
41
  registerRetrieveDatabase(server, notion);
42
+ // Data Source operations (API 2025-09-03)
43
+ registerRetrieveDataSource(server, notion);
44
+ registerQueryDataSource(server, notion);
45
+ registerUpdateDataSource(server, notion);
41
46
  // Search
42
47
  registerSearch(server, notion);
43
48
  // Block operations
@@ -56,4 +61,4 @@ export function registerAllTools(server, notion) {
56
61
  registerRetrieveUser(server, notion);
57
62
  registerRetrieveBotUser(server, notion);
58
63
  }
59
- export { registerRetrievePage, registerCreatePage, registerCreatePageSimple, registerUpdatePage, registerArchivePage, registerRetrievePageProperty, registerMovePage, registerCreateDatabase, registerUpdateDatabase, registerArchiveDatabase, registerQueryDatabase, registerRetrieveDatabase, registerSearch, registerGetBlockChildren, registerAppendBlockChildren, registerAppendBlocksSimple, registerRetrieveBlock, registerUpdateBlock, registerUpdateBlockSimple, registerDeleteBlock, registerCreateComment, registerListComments, registerListUsers, registerRetrieveUser, registerRetrieveBotUser, };
64
+ export { registerRetrievePage, registerCreatePage, registerCreatePageSimple, registerUpdatePage, registerArchivePage, registerRetrievePageProperty, registerMovePage, registerCreateDatabase, registerUpdateDatabase, registerArchiveDatabase, registerRetrieveDatabase, registerRetrieveDataSource, registerQueryDataSource, registerUpdateDataSource, registerSearch, registerGetBlockChildren, registerAppendBlockChildren, registerAppendBlocksSimple, registerRetrieveBlock, registerUpdateBlock, registerUpdateBlockSimple, registerDeleteBlock, registerCreateComment, registerListComments, registerListUsers, registerRetrieveUser, registerRetrieveBotUser, };
@@ -1 +1 @@
1
- {"version":3,"file":"move-page.d.ts","sourceRoot":"","sources":["../../../src/tools/move-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAavD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAsC9E"}
1
+ {"version":3,"file":"move-page.d.ts","sourceRoot":"","sources":["../../../src/tools/move-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAavD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAuC9E"}
@@ -5,23 +5,24 @@ const inputSchema = {
5
5
  parent: z
6
6
  .object({
7
7
  page_id: z.string().optional().describe('Target parent page ID'),
8
- database_id: z.string().optional().describe('Target database ID'),
8
+ data_source_id: z.string().optional().describe('Target data source ID'),
9
9
  })
10
- .describe('New parent (provide either page_id or database_id)'),
10
+ .describe('New parent (provide either page_id or data_source_id)'),
11
11
  };
12
12
  export function registerMovePage(server, notion) {
13
13
  server.registerTool('move-page', {
14
- description: 'Move a page to a new parent (page or database). ' +
15
- 'Provide either page_id or database_id as the new parent.',
14
+ description: 'Move a page to a new parent (page or data source). ' +
15
+ 'Provide either page_id or data_source_id as the new parent. ' +
16
+ '(API version 2025-09-03)',
16
17
  inputSchema,
17
18
  }, async ({ page_id, parent }) => {
18
19
  try {
19
- if (!parent.page_id && !parent.database_id) {
20
+ if (!parent.page_id && !parent.data_source_id) {
20
21
  return {
21
22
  content: [
22
23
  {
23
24
  type: 'text',
24
- text: 'Error: Parent must have either page_id or database_id.',
25
+ text: 'Error: Parent must have either page_id or data_source_id.',
25
26
  },
26
27
  ],
27
28
  isError: true,
@@ -29,7 +30,7 @@ export function registerMovePage(server, notion) {
29
30
  }
30
31
  const parentParam = parent.page_id
31
32
  ? { page_id: parent.page_id }
32
- : { database_id: parent.database_id };
33
+ : { data_source_id: parent.data_source_id };
33
34
  const response = await notion.pages.move({
34
35
  page_id,
35
36
  parent: parentParam,
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { NotionClient } from '../notion-client.js';
3
+ export declare function registerQueryDataSource(server: McpServer, notion: NotionClient): void;
4
+ //# sourceMappingURL=query-data-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-data-source.d.ts","sourceRoot":"","sources":["../../../src/tools/query-data-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AA8BvD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAsDrF"}
@@ -3,20 +3,22 @@ import { pagesToSimple } from '../converters/index.js';
3
3
  import { formatPaginatedResponse, formatSimplePaginatedResponse, handleError, } from '../utils/index.js';
4
4
  // Minimal schema for MCP (full validation by Notion API)
5
5
  const inputSchema = {
6
- database_id: z.string().describe('Database ID'),
6
+ data_source_id: z.string().describe('Data source ID'),
7
7
  filter: z.any().optional().describe('Filter conditions'),
8
8
  sorts: z.array(z.any()).optional().describe('Sort conditions'),
9
9
  start_cursor: z.string().optional().describe('Pagination cursor'),
10
10
  page_size: z.number().optional().describe('Results per page (1-100)'),
11
11
  format: z.enum(['json', 'simple']).optional().describe('Output format (default: simple)'),
12
12
  };
13
- export function registerQueryDatabase(server, notion) {
14
- server.registerTool('query-database', {
15
- description: "Query a Notion database with optional filters and sorts. Returns paginated results. Use format='simple' (default) for human-readable output with reduced token usage.",
13
+ export function registerQueryDataSource(server, notion) {
14
+ server.registerTool('query-data-source', {
15
+ description: 'Query a Notion data source with optional filters and sorts. Returns paginated results. ' +
16
+ "Use format='simple' (default) for human-readable output with reduced token usage. " +
17
+ '(API version 2025-09-03)',
16
18
  inputSchema,
17
- }, async ({ database_id, filter, sorts, start_cursor, page_size, format }) => {
19
+ }, async ({ data_source_id, filter, sorts, start_cursor, page_size, format }) => {
18
20
  try {
19
- const params = { database_id };
21
+ const params = { data_source_id };
20
22
  if (filter) {
21
23
  params.filter = filter;
22
24
  }
@@ -30,7 +32,7 @@ export function registerQueryDatabase(server, notion) {
30
32
  params.page_size = page_size;
31
33
  }
32
34
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
- const response = await notion.databases.query(params);
35
+ const response = await notion.dataSources.query(params);
34
36
  if (format === 'simple') {
35
37
  const simplePages = pagesToSimple(response.results);
36
38
  return formatSimplePaginatedResponse(simplePages, response.has_more, response.next_cursor);
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { NotionClient } from '../notion-client.js';
3
+ export declare function registerRetrieveDataSource(server: McpServer, notion: NotionClient): void;
4
+ //# sourceMappingURL=retrieve-data-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retrieve-data-source.d.ts","sourceRoot":"","sources":["../../../src/tools/retrieve-data-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AA2BvD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAwDxF"}
@@ -0,0 +1,55 @@
1
+ import { z } from 'zod';
2
+ import { formatResponse, formatSimpleResponse, handleError } from '../utils/index.js';
3
+ const inputSchema = {
4
+ data_source_id: z.string().describe('Data source ID'),
5
+ format: z
6
+ .enum(['json', 'simple'])
7
+ .optional()
8
+ .describe("Output format: 'simple' (default) or 'json'"),
9
+ };
10
+ export function registerRetrieveDataSource(server, notion) {
11
+ server.registerTool('retrieve-data-source', {
12
+ description: 'Retrieve a data source schema by its ID. Returns data source properties (columns) and their types. ' +
13
+ "Use format='simple' (default) for reduced token usage, 'json' for full Notion API response. " +
14
+ '(API version 2025-09-03)',
15
+ inputSchema,
16
+ }, async ({ data_source_id, format = 'simple' }) => {
17
+ try {
18
+ const response = await notion.dataSources.retrieve({ data_source_id });
19
+ if (format === 'json') {
20
+ return formatResponse(response);
21
+ }
22
+ // Simple format: extract essential info
23
+ const simpleProperties = {};
24
+ for (const [name, prop] of Object.entries(response.properties)) {
25
+ const simpleProp = {
26
+ id: prop.id,
27
+ type: prop.type,
28
+ };
29
+ // Include options for select/multi_select/status
30
+ if (prop.type === 'select' && prop.select) {
31
+ const selectProp = prop.select;
32
+ simpleProp.options = selectProp.options;
33
+ }
34
+ else if (prop.type === 'multi_select' && prop.multi_select) {
35
+ const multiSelectProp = prop.multi_select;
36
+ simpleProp.options = multiSelectProp.options;
37
+ }
38
+ else if (prop.type === 'status' && prop.status) {
39
+ const statusProp = prop.status;
40
+ simpleProp.options = statusProp.options;
41
+ }
42
+ simpleProperties[name] = simpleProp;
43
+ }
44
+ const simpleResponse = {
45
+ id: response.id,
46
+ parent_database_id: response.parent.database_id,
47
+ properties: simpleProperties,
48
+ };
49
+ return formatSimpleResponse(simpleResponse);
50
+ }
51
+ catch (error) {
52
+ return handleError(error);
53
+ }
54
+ });
55
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"retrieve-database.d.ts","sourceRoot":"","sources":["../../../src/tools/retrieve-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AA8BvD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA2DtF"}
1
+ {"version":3,"file":"retrieve-database.d.ts","sourceRoot":"","sources":["../../../src/tools/retrieve-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AA+BvD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAsCtF"}
@@ -9,7 +9,8 @@ const inputSchema = {
9
9
  };
10
10
  export function registerRetrieveDatabase(server, notion) {
11
11
  server.registerTool('retrieve-database', {
12
- description: 'Retrieve a database schema by its ID. Returns database properties (columns) and their types. ' +
12
+ description: 'Retrieve a database container by its ID. Returns database metadata and associated data sources. ' +
13
+ 'Note: In API 2025-09-03, database properties/schema are retrieved via retrieve-data-source using data_source_id. ' +
13
14
  "Use format='simple' (default) for reduced token usage, 'json' for full Notion API response.",
14
15
  inputSchema,
15
16
  }, async ({ database_id, format = 'simple' }) => {
@@ -19,35 +20,17 @@ export function registerRetrieveDatabase(server, notion) {
19
20
  return formatResponse(response);
20
21
  }
21
22
  // Simple format: extract essential info
22
- const simpleProperties = {};
23
- for (const [name, prop] of Object.entries(response.properties)) {
24
- const simpleProp = {
25
- id: prop.id,
26
- type: prop.type,
27
- };
28
- // Include options for select/multi_select/status
29
- if (prop.type === 'select' && prop.select) {
30
- const selectProp = prop.select;
31
- simpleProp.options = selectProp.options;
32
- }
33
- else if (prop.type === 'multi_select' && prop.multi_select) {
34
- const multiSelectProp = prop.multi_select;
35
- simpleProp.options = multiSelectProp.options;
36
- }
37
- else if (prop.type === 'status' && prop.status) {
38
- const statusProp = prop.status;
39
- simpleProp.options = statusProp.options;
40
- }
41
- simpleProperties[name] = simpleProp;
42
- }
43
23
  const simpleResponse = {
44
24
  id: response.id,
45
25
  title: response.title.map((t) => t.plain_text).join(''),
46
26
  description: response.description.map((t) => t.plain_text).join(''),
47
27
  url: response.url,
48
- properties: simpleProperties,
49
28
  is_inline: response.is_inline,
50
- archived: response.archived,
29
+ in_trash: response.in_trash,
30
+ data_sources: response.data_sources,
31
+ icon: response.icon,
32
+ created_time: response.created_time,
33
+ last_edited_time: response.last_edited_time,
51
34
  };
52
35
  return formatSimpleResponse(simpleResponse);
53
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/tools/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AA8CvD,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAgD5E"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/tools/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AA8CvD,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAiD5E"}
@@ -4,11 +4,11 @@ const inputSchema = {
4
4
  query: z.string().optional().describe('Text to search for in page titles and content'),
5
5
  filter: z
6
6
  .object({
7
- value: z.enum(['page', 'database']),
7
+ value: z.enum(['page', 'data_source']),
8
8
  property: z.literal('object'),
9
9
  })
10
10
  .optional()
11
- .describe('Filter to limit results to pages or databases. ' +
11
+ .describe('Filter to limit results to pages or data sources. ' +
12
12
  'Example: { "value": "page", "property": "object" }'),
13
13
  sort: z
14
14
  .object({
@@ -31,10 +31,11 @@ const inputSchema = {
31
31
  };
32
32
  export function registerSearch(server, notion) {
33
33
  server.registerTool('search', {
34
- description: 'Search across all pages and databases in the workspace by title and content. ' +
35
- 'Filter results by type (page or database) and sort by last edited time. ' +
34
+ description: 'Search across all pages and data sources in the workspace by title and content. ' +
35
+ 'Filter results by type (page or data_source) and sort by last edited time. ' +
36
36
  'Returns paginated results. ' +
37
- 'For querying a specific database with filters, use query-database instead.',
37
+ 'For querying a specific data source with filters, use query-data-source instead. ' +
38
+ '(API version 2025-09-03)',
38
39
  inputSchema,
39
40
  }, async ({ query, filter, sort, start_cursor, page_size }) => {
40
41
  try {
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { NotionClient } from '../notion-client.js';
3
+ export declare function registerUpdateDataSource(server: McpServer, notion: NotionClient): void;
4
+ //# sourceMappingURL=update-data-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-data-source.d.ts","sourceRoot":"","sources":["../../../src/tools/update-data-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAYvD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA6BtF"}
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ import { formatResponse, handleError } from '../utils/index.js';
3
+ // Minimal schema for MCP (full validation by Notion API)
4
+ const inputSchema = {
5
+ data_source_id: z.string().describe('Data source ID'),
6
+ properties: z
7
+ .record(z.string(), z.any())
8
+ .optional()
9
+ .describe('Properties to add/update/delete (set to null to delete)'),
10
+ };
11
+ export function registerUpdateDataSource(server, notion) {
12
+ server.registerTool('update-data-source', {
13
+ description: 'Update a data source schema (properties/columns). ' +
14
+ 'Use this to add, update, or delete properties. Set a property to null to delete it. ' +
15
+ '(API version 2025-09-03)',
16
+ inputSchema,
17
+ }, async ({ data_source_id, properties }) => {
18
+ try {
19
+ const params = { data_source_id };
20
+ if (properties !== undefined) {
21
+ params.properties = properties;
22
+ }
23
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
+ const response = await notion.dataSources.update(params);
25
+ return formatResponse(response);
26
+ }
27
+ catch (error) {
28
+ return handleError(error);
29
+ }
30
+ });
31
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"update-database.d.ts","sourceRoot":"","sources":["../../../src/tools/update-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAevD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA4DpF"}
1
+ {"version":3,"file":"update-database.d.ts","sourceRoot":"","sources":["../../../src/tools/update-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAgBvD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA4DpF"}
@@ -1,22 +1,23 @@
1
1
  import { z } from 'zod';
2
2
  import { formatResponse, handleError } from '../utils/index.js';
3
3
  // Minimal schema for MCP (full validation by Notion API)
4
+ // Note: Properties (schema) updates should use update-data-source in API 2025-09-03
4
5
  const inputSchema = {
5
6
  database_id: z.string().describe('Database ID'),
6
7
  title: z.array(z.any()).optional().describe('New title'),
7
8
  description: z.array(z.any()).optional().describe('New description'),
8
- properties: z.record(z.string(), z.any()).optional().describe('Properties to add/update/delete'),
9
- icon: z.any().optional().describe('Icon (null to remove)'),
9
+ icon: z.any().optional().describe('Icon object { type: "emoji", emoji: "📝" } or null to remove. Emoji must be an actual emoji character.'),
10
10
  cover: z.any().optional().describe('Cover (null to remove)'),
11
11
  is_inline: z.boolean().optional().describe('Inline database'),
12
12
  archived: z.boolean().optional().describe('Archive status'),
13
+ is_locked: z.boolean().optional().describe('Lock the database to prevent edits in the UI. Set to true to lock, false to unlock.'),
13
14
  };
14
15
  export function registerUpdateDatabase(server, notion) {
15
16
  server.registerTool('update-database', {
16
- description: 'Update an existing Notion database. Can modify title, description, properties (add/update/delete columns), icon, cover, inline status, and archive status. ' +
17
- 'Returns the updated database object.',
17
+ description: 'Update a Notion database container. Can modify title, description, icon, cover, inline status, archive status, and lock status. ' +
18
+ 'For schema (properties/columns) updates, use update-data-source instead. (API version 2025-09-03)',
18
19
  inputSchema,
19
- }, async ({ database_id, title, description, properties, icon, cover, is_inline, archived }) => {
20
+ }, async ({ database_id, title, description, icon, cover, is_inline, archived, is_locked }) => {
20
21
  try {
21
22
  const params = {
22
23
  database_id,
@@ -27,9 +28,6 @@ export function registerUpdateDatabase(server, notion) {
27
28
  if (description !== undefined) {
28
29
  params.description = description;
29
30
  }
30
- if (properties !== undefined) {
31
- params.properties = properties;
32
- }
33
31
  if (icon !== undefined) {
34
32
  params.icon = icon;
35
33
  }
@@ -42,6 +40,9 @@ export function registerUpdateDatabase(server, notion) {
42
40
  if (archived !== undefined) {
43
41
  params.archived = archived;
44
42
  }
43
+ if (is_locked !== undefined) {
44
+ params.is_locked = is_locked;
45
+ }
45
46
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
46
47
  const response = await notion.databases.update(params);
47
48
  return formatResponse(response);
@@ -1 +1 @@
1
- {"version":3,"file":"update-page.d.ts","sourceRoot":"","sources":["../../../src/tools/update-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAiBvD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA4ChF"}
1
+ {"version":3,"file":"update-page.d.ts","sourceRoot":"","sources":["../../../src/tools/update-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAkBvD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAkDhF"}
@@ -5,17 +5,19 @@ const inputSchema = {
5
5
  page_id: z.string().describe('Page ID'),
6
6
  properties: z.record(z.string(), z.any()).optional().describe('Properties to update'),
7
7
  archived: z.boolean().optional().describe('Archive the page'),
8
- icon: z.any().optional().describe('Page icon (null to remove)'),
8
+ icon: z.any().optional().describe('Page icon { type: "emoji", emoji: "📝" } or { type: "external", external: { url: "..." } }, or null to remove. Emoji must be an actual emoji character.'),
9
9
  cover: z.any().optional().describe('Cover image (null to remove)'),
10
+ is_locked: z.boolean().optional().describe('Lock the page to prevent edits in the UI. Set to true to lock, false to unlock.'),
10
11
  };
11
12
  export function registerUpdatePage(server, notion) {
12
13
  server.registerTool('update-page', {
13
- description: "Update a Notion page's properties, icon, cover, or archive status. " +
14
+ description: "Update a Notion page's properties, icon, cover, archive status, or lock status. " +
14
15
  'Partial updates are supported - only provide the fields you want to change. ' +
15
16
  'Set icon or cover to null to remove them. ' +
16
- 'Set archived to true to move the page to trash.',
17
+ 'Set archived to true to move the page to trash. ' +
18
+ 'Set is_locked to true to lock the page in the UI.',
17
19
  inputSchema,
18
- }, async ({ page_id, properties, archived, icon, cover }) => {
20
+ }, async ({ page_id, properties, archived, icon, cover, is_locked }) => {
19
21
  try {
20
22
  const params = { page_id };
21
23
  if (properties !== undefined) {
@@ -30,6 +32,9 @@ export function registerUpdatePage(server, notion) {
30
32
  if (cover !== undefined) {
31
33
  params.cover = cover;
32
34
  }
35
+ if (is_locked !== undefined) {
36
+ params.is_locked = is_locked;
37
+ }
33
38
  const response = await notion.pages.update(params);
34
39
  return formatResponse(response);
35
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atikk-co-jp/notion-mcp-server",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "description": "MCP server for Notion API - Create, read, update pages and databases",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,4 +0,0 @@
1
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import type { NotionClient } from '../notion-client.js';
3
- export declare function registerQueryDatabase(server: McpServer, notion: NotionClient): void;
4
- //# sourceMappingURL=query-database.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"query-database.d.ts","sourceRoot":"","sources":["../../../src/tools/query-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AA8BvD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAoDnF"}