@atikk-co-jp/notion-mcp-server 0.8.1 → 0.9.1
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.
- package/README.ja.md +41 -38
- package/README.md +40 -38
- package/dist/src/converters/__tests__/page-to-markdown.test.js +103 -0
- package/dist/src/converters/page-to-markdown.d.ts +6 -3
- package/dist/src/converters/page-to-markdown.d.ts.map +1 -1
- package/dist/src/converters/page-to-markdown.js +12 -5
- package/dist/src/notion-client.d.ts +1 -2
- package/dist/src/notion-client.d.ts.map +1 -1
- package/dist/src/schemas/descriptions/fields.d.ts +3 -0
- package/dist/src/schemas/descriptions/fields.d.ts.map +1 -1
- package/dist/src/schemas/descriptions/fields.js +3 -0
- package/dist/src/tools/append-block-children.d.ts.map +1 -1
- package/dist/src/tools/append-block-children.js +6 -3
- package/dist/src/tools/append-blocks-simple.d.ts.map +1 -1
- package/dist/src/tools/append-blocks-simple.js +7 -3
- package/dist/src/tools/archive-database.d.ts.map +1 -1
- package/dist/src/tools/archive-database.js +6 -3
- package/dist/src/tools/archive-page.d.ts.map +1 -1
- package/dist/src/tools/archive-page.js +6 -3
- package/dist/src/tools/create-comment-simple.d.ts.map +1 -1
- package/dist/src/tools/create-comment-simple.js +6 -3
- package/dist/src/tools/create-comment.d.ts.map +1 -1
- package/dist/src/tools/create-comment.js +6 -3
- package/dist/src/tools/create-database.d.ts.map +1 -1
- package/dist/src/tools/create-database.js +8 -3
- package/dist/src/tools/create-page-simple.d.ts.map +1 -1
- package/dist/src/tools/create-page-simple.js +6 -2
- package/dist/src/tools/create-page.d.ts.map +1 -1
- package/dist/src/tools/create-page.js +7 -3
- package/dist/src/tools/delete-block.d.ts.map +1 -1
- package/dist/src/tools/delete-block.js +6 -3
- package/dist/src/tools/move-page.d.ts.map +1 -1
- package/dist/src/tools/move-page.js +7 -3
- package/dist/src/tools/query-data-source.d.ts.map +1 -1
- package/dist/src/tools/query-data-source.js +6 -3
- package/dist/src/tools/retrieve-data-source.js +5 -5
- package/dist/src/tools/retrieve-database.js +1 -1
- package/dist/src/tools/search.d.ts +1 -1
- package/dist/src/tools/search.d.ts.map +1 -1
- package/dist/src/tools/search.js +34 -2
- package/dist/src/tools/update-block-simple.d.ts.map +1 -1
- package/dist/src/tools/update-block-simple.js +5 -2
- package/dist/src/tools/update-block.d.ts.map +1 -1
- package/dist/src/tools/update-block.js +7 -3
- package/dist/src/tools/update-data-source.d.ts.map +1 -1
- package/dist/src/tools/update-data-source.js +6 -3
- package/dist/src/tools/update-database.d.ts.map +1 -1
- package/dist/src/tools/update-database.js +8 -3
- package/dist/src/tools/update-page.d.ts.map +1 -1
- package/dist/src/tools/update-page.js +8 -3
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -21,44 +21,47 @@ Notion API用のMCP(Model Context Protocol)サーバー。AIアシスタン
|
|
|
21
21
|
|
|
22
22
|
## API対応表
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
| | |
|
|
29
|
-
|
|
30
|
-
| |
|
|
31
|
-
| | [
|
|
32
|
-
| |
|
|
33
|
-
| | [
|
|
34
|
-
|
|
|
35
|
-
| | [
|
|
36
|
-
| | [
|
|
37
|
-
| | [
|
|
38
|
-
| |
|
|
39
|
-
|
|
|
40
|
-
| | [Retrieve
|
|
41
|
-
| | [
|
|
42
|
-
| | [
|
|
43
|
-
|
|
|
44
|
-
| | [Retrieve
|
|
45
|
-
| | [
|
|
46
|
-
| | | `update-
|
|
47
|
-
| |
|
|
48
|
-
| | [Retrieve block
|
|
49
|
-
| | [
|
|
50
|
-
| | | `
|
|
51
|
-
|
|
|
52
|
-
| | [
|
|
53
|
-
| | [
|
|
54
|
-
|
|
|
55
|
-
| |
|
|
56
|
-
| | [
|
|
57
|
-
| |
|
|
58
|
-
|
|
|
59
|
-
| |
|
|
60
|
-
|
|
61
|
-
|
|
24
|
+
> ⭐ = Markdown入力対応(入力トークン約80%削減)
|
|
25
|
+
>
|
|
26
|
+
> 📤 = 最小レスポンス(id/urlのみ)- 出力トークン約90%削減
|
|
27
|
+
|
|
28
|
+
| カテゴリ | Notion API | MCPツール | 入力 | 出力(デフォルト) |
|
|
29
|
+
|---------|-----------|----------|------|-------------------|
|
|
30
|
+
| **ページ** | | | | |
|
|
31
|
+
| | [Create page](https://developers.notion.com/reference/post-page) | `create-page` 📤 | JSON | `{id, url}` |
|
|
32
|
+
| | | `create-page-simple` ⭐📤 | Markdown | `{id, url}` |
|
|
33
|
+
| | [Retrieve page](https://developers.notion.com/reference/retrieve-a-page) | `retrieve-page` | JSON | **simple**/json |
|
|
34
|
+
| | [Update page](https://developers.notion.com/reference/patch-page) | `update-page` 📤 | JSON | `{id, url}` |
|
|
35
|
+
| | [Retrieve page property](https://developers.notion.com/reference/retrieve-a-page-property-item) | `retrieve-page-property` | JSON | json |
|
|
36
|
+
| | [Move page](https://developers.notion.com/reference/post-page-move) | `move-page` 📤 | JSON | `{id, url}` |
|
|
37
|
+
| | [Archive page](https://developers.notion.com/reference/patch-page) | `archive-page` 📤 | JSON | `{id}` |
|
|
38
|
+
| **データベース** | | | | |
|
|
39
|
+
| | [Create database](https://developers.notion.com/reference/create-a-database) | `create-database` 📤 | JSON | `{id, url}` |
|
|
40
|
+
| | [Retrieve database](https://developers.notion.com/reference/retrieve-a-database) | `retrieve-database` | JSON | **simple**/json |
|
|
41
|
+
| | [Update database](https://developers.notion.com/reference/update-a-database) | `update-database` 📤 | JSON | `{id, url}` |
|
|
42
|
+
| | [Archive database](https://developers.notion.com/reference/update-a-database) | `archive-database` 📤 | JSON | `{id}` |
|
|
43
|
+
| **データソース** | | | | |
|
|
44
|
+
| | [Retrieve data source](https://developers.notion.com/reference/retrieve-a-data-source) | `retrieve-data-source` | JSON | **simple**/json |
|
|
45
|
+
| | [Query data source](https://developers.notion.com/reference/post-data-source-query) | `query-data-source` | JSON | **simple**/json |
|
|
46
|
+
| | [Update data source](https://developers.notion.com/reference/patch-data-source) | `update-data-source` 📤 | JSON | `{id}` |
|
|
47
|
+
| **ブロック** | | | | |
|
|
48
|
+
| | [Retrieve block](https://developers.notion.com/reference/retrieve-a-block) | `retrieve-block` | JSON | **markdown**/json |
|
|
49
|
+
| | [Update block](https://developers.notion.com/reference/update-a-block) | `update-block` 📤 | JSON | `{id}` |
|
|
50
|
+
| | | `update-block-simple` ⭐📤 | Markdown | `{id}` |
|
|
51
|
+
| | [Delete block](https://developers.notion.com/reference/delete-a-block) | `delete-block` 📤 | JSON | `{id}` |
|
|
52
|
+
| | [Retrieve block children](https://developers.notion.com/reference/get-block-children) | `get-block-children` | JSON | **markdown**/json |
|
|
53
|
+
| | [Append block children](https://developers.notion.com/reference/patch-block-children) | `append-block-children` 📤 | JSON | `{block_ids}` |
|
|
54
|
+
| | | `append-blocks-simple` ⭐📤 | Markdown | `{block_ids}` |
|
|
55
|
+
| **コメント** | | | | |
|
|
56
|
+
| | [Create comment](https://developers.notion.com/reference/create-a-comment) | `create-comment` 📤 | JSON | `{id}` |
|
|
57
|
+
| | | `create-comment-simple` ⭐📤 | Markdown | `{id}` |
|
|
58
|
+
| | [List comments](https://developers.notion.com/reference/retrieve-comments) | `list-comments` | JSON | json |
|
|
59
|
+
| **ユーザー** | | | | |
|
|
60
|
+
| | [List users](https://developers.notion.com/reference/get-users) | `list-users` | JSON | json |
|
|
61
|
+
| | [Retrieve user](https://developers.notion.com/reference/get-user) | `retrieve-user` | JSON | json |
|
|
62
|
+
| | [Retrieve bot user](https://developers.notion.com/reference/get-self) | `retrieve-bot-user` | JSON | json |
|
|
63
|
+
| **検索** | | | | |
|
|
64
|
+
| | [Search](https://developers.notion.com/reference/post-search) | `search` | JSON | **simple**/json |
|
|
62
65
|
|
|
63
66
|
## インストール
|
|
64
67
|
|
package/README.md
CHANGED
|
@@ -22,44 +22,46 @@ MCP (Model Context Protocol) server for Notion API. Enables AI assistants to int
|
|
|
22
22
|
## API Coverage
|
|
23
23
|
|
|
24
24
|
> ⭐ = Markdown input supported (reduces input tokens by ~80%)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
|
29
|
-
|
|
30
|
-
| | |
|
|
31
|
-
| | [
|
|
32
|
-
| |
|
|
33
|
-
| | [Retrieve page
|
|
34
|
-
| | [
|
|
35
|
-
| | [
|
|
36
|
-
|
|
|
37
|
-
| | [
|
|
38
|
-
| |
|
|
39
|
-
| | [
|
|
40
|
-
| | [
|
|
41
|
-
|
|
|
42
|
-
| | [
|
|
43
|
-
|
|
|
44
|
-
| | [
|
|
45
|
-
|
|
|
46
|
-
| | [
|
|
47
|
-
| |
|
|
48
|
-
| | | `
|
|
49
|
-
| | [
|
|
50
|
-
| |
|
|
51
|
-
| | [
|
|
52
|
-
| | | `
|
|
53
|
-
|
|
|
54
|
-
| |
|
|
55
|
-
| | |
|
|
56
|
-
| | [
|
|
57
|
-
|
|
|
58
|
-
| | [List
|
|
59
|
-
| |
|
|
60
|
-
| | [
|
|
61
|
-
|
|
|
62
|
-
| | [
|
|
25
|
+
>
|
|
26
|
+
> 📤 = Minimal response (id/url only) - reduces output tokens by ~90%
|
|
27
|
+
|
|
28
|
+
| Category | Notion API | MCP Tool | Input | Output (default) |
|
|
29
|
+
|----------|-----------|----------|-------|------------------|
|
|
30
|
+
| **Pages** | | | | |
|
|
31
|
+
| | [Create page](https://developers.notion.com/reference/post-page) | `create-page` 📤 | JSON | `{id, url}` |
|
|
32
|
+
| | | `create-page-simple` ⭐📤 | Markdown | `{id, url}` |
|
|
33
|
+
| | [Retrieve page](https://developers.notion.com/reference/retrieve-a-page) | `retrieve-page` | JSON | **simple**/json |
|
|
34
|
+
| | [Update page](https://developers.notion.com/reference/patch-page) | `update-page` 📤 | JSON | `{id, url}` |
|
|
35
|
+
| | [Retrieve page property](https://developers.notion.com/reference/retrieve-a-page-property-item) | `retrieve-page-property` | JSON | json |
|
|
36
|
+
| | [Move page](https://developers.notion.com/reference/post-page-move) | `move-page` 📤 | JSON | `{id, url}` |
|
|
37
|
+
| | [Archive page](https://developers.notion.com/reference/patch-page) | `archive-page` 📤 | JSON | `{id}` |
|
|
38
|
+
| **Databases** | | | | |
|
|
39
|
+
| | [Create database](https://developers.notion.com/reference/create-a-database) | `create-database` 📤 | JSON | `{id, url}` |
|
|
40
|
+
| | [Retrieve database](https://developers.notion.com/reference/retrieve-a-database) | `retrieve-database` | JSON | **simple**/json |
|
|
41
|
+
| | [Update database](https://developers.notion.com/reference/update-a-database) | `update-database` 📤 | JSON | `{id, url}` |
|
|
42
|
+
| | [Archive database](https://developers.notion.com/reference/update-a-database) | `archive-database` 📤 | JSON | `{id}` |
|
|
43
|
+
| **Data Sources** | | | | |
|
|
44
|
+
| | [Retrieve data source](https://developers.notion.com/reference/retrieve-a-data-source) | `retrieve-data-source` | JSON | **simple**/json |
|
|
45
|
+
| | [Query data source](https://developers.notion.com/reference/post-data-source-query) | `query-data-source` | JSON | **simple**/json |
|
|
46
|
+
| | [Update data source](https://developers.notion.com/reference/patch-data-source) | `update-data-source` 📤 | JSON | `{id}` |
|
|
47
|
+
| **Blocks** | | | | |
|
|
48
|
+
| | [Retrieve block](https://developers.notion.com/reference/retrieve-a-block) | `retrieve-block` | JSON | **markdown**/json |
|
|
49
|
+
| | [Update block](https://developers.notion.com/reference/update-a-block) | `update-block` 📤 | JSON | `{id}` |
|
|
50
|
+
| | | `update-block-simple` ⭐📤 | Markdown | `{id}` |
|
|
51
|
+
| | [Delete block](https://developers.notion.com/reference/delete-a-block) | `delete-block` 📤 | JSON | `{id}` |
|
|
52
|
+
| | [Retrieve block children](https://developers.notion.com/reference/get-block-children) | `get-block-children` | JSON | **markdown**/json |
|
|
53
|
+
| | [Append block children](https://developers.notion.com/reference/patch-block-children) | `append-block-children` 📤 | JSON | `{block_ids}` |
|
|
54
|
+
| | | `append-blocks-simple` ⭐📤 | Markdown | `{block_ids}` |
|
|
55
|
+
| **Comments** | | | | |
|
|
56
|
+
| | [Create comment](https://developers.notion.com/reference/create-a-comment) | `create-comment` 📤 | JSON | `{id}` |
|
|
57
|
+
| | | `create-comment-simple` ⭐📤 | Markdown | `{id}` |
|
|
58
|
+
| | [List comments](https://developers.notion.com/reference/retrieve-comments) | `list-comments` | JSON | json |
|
|
59
|
+
| **Users** | | | | |
|
|
60
|
+
| | [List users](https://developers.notion.com/reference/get-users) | `list-users` | JSON | json |
|
|
61
|
+
| | [Retrieve user](https://developers.notion.com/reference/get-user) | `retrieve-user` | JSON | json |
|
|
62
|
+
| | [Retrieve bot user](https://developers.notion.com/reference/get-self) | `retrieve-bot-user` | JSON | json |
|
|
63
|
+
| **Search** | | | | |
|
|
64
|
+
| | [Search](https://developers.notion.com/reference/post-search) | `search` | JSON | **simple**/json |
|
|
63
65
|
|
|
64
66
|
## Installation
|
|
65
67
|
|
|
@@ -445,6 +445,55 @@ describe('pageToSimple', () => {
|
|
|
445
445
|
const result = pageToSimple(page);
|
|
446
446
|
expect(result.url).toBe('');
|
|
447
447
|
});
|
|
448
|
+
it('filters properties with fields parameter', () => {
|
|
449
|
+
const page = asPage({
|
|
450
|
+
id: 'page-123',
|
|
451
|
+
url: 'https://notion.so/page-123',
|
|
452
|
+
properties: {
|
|
453
|
+
Name: {
|
|
454
|
+
type: 'title',
|
|
455
|
+
title: [{ type: 'text', text: { content: 'My Page' }, plain_text: 'My Page' }],
|
|
456
|
+
},
|
|
457
|
+
Status: {
|
|
458
|
+
type: 'select',
|
|
459
|
+
select: { id: '1', name: 'Active', color: 'green' },
|
|
460
|
+
},
|
|
461
|
+
Priority: {
|
|
462
|
+
type: 'select',
|
|
463
|
+
select: { id: '2', name: 'High', color: 'red' },
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
});
|
|
467
|
+
const result = pageToSimple(page, ['Name', 'Status']);
|
|
468
|
+
expect(result).toEqual({
|
|
469
|
+
id: 'page-123',
|
|
470
|
+
url: 'https://notion.so/page-123',
|
|
471
|
+
properties: {
|
|
472
|
+
Name: 'My Page',
|
|
473
|
+
Status: 'Active',
|
|
474
|
+
},
|
|
475
|
+
});
|
|
476
|
+
expect(result.properties).not.toHaveProperty('Priority');
|
|
477
|
+
});
|
|
478
|
+
it('returns all properties when fields is empty array', () => {
|
|
479
|
+
const page = asPage({
|
|
480
|
+
id: 'page-123',
|
|
481
|
+
url: 'https://notion.so/page-123',
|
|
482
|
+
properties: {
|
|
483
|
+
Name: {
|
|
484
|
+
type: 'title',
|
|
485
|
+
title: [{ type: 'text', text: { content: 'My Page' }, plain_text: 'My Page' }],
|
|
486
|
+
},
|
|
487
|
+
Status: {
|
|
488
|
+
type: 'select',
|
|
489
|
+
select: { id: '1', name: 'Active', color: 'green' },
|
|
490
|
+
},
|
|
491
|
+
},
|
|
492
|
+
});
|
|
493
|
+
const result = pageToSimple(page, []);
|
|
494
|
+
expect(result.properties).toHaveProperty('Name');
|
|
495
|
+
expect(result.properties).toHaveProperty('Status');
|
|
496
|
+
});
|
|
448
497
|
});
|
|
449
498
|
describe('pagesToSimple', () => {
|
|
450
499
|
it('converts array of pages to simple format', () => {
|
|
@@ -489,6 +538,60 @@ describe('pagesToSimple', () => {
|
|
|
489
538
|
it('handles undefined input', () => {
|
|
490
539
|
expect(pagesToSimple(undefined)).toEqual([]);
|
|
491
540
|
});
|
|
541
|
+
it('filters properties with fields parameter', () => {
|
|
542
|
+
const pages = asPages([
|
|
543
|
+
{
|
|
544
|
+
id: 'page-1',
|
|
545
|
+
url: 'https://notion.so/page-1',
|
|
546
|
+
properties: {
|
|
547
|
+
Name: {
|
|
548
|
+
type: 'title',
|
|
549
|
+
title: [{ type: 'text', text: { content: 'Page 1' }, plain_text: 'Page 1' }],
|
|
550
|
+
},
|
|
551
|
+
Status: {
|
|
552
|
+
type: 'select',
|
|
553
|
+
select: { id: '1', name: 'Active', color: 'green' },
|
|
554
|
+
},
|
|
555
|
+
Priority: {
|
|
556
|
+
type: 'select',
|
|
557
|
+
select: { id: '2', name: 'High', color: 'red' },
|
|
558
|
+
},
|
|
559
|
+
},
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
id: 'page-2',
|
|
563
|
+
url: 'https://notion.so/page-2',
|
|
564
|
+
properties: {
|
|
565
|
+
Name: {
|
|
566
|
+
type: 'title',
|
|
567
|
+
title: [{ type: 'text', text: { content: 'Page 2' }, plain_text: 'Page 2' }],
|
|
568
|
+
},
|
|
569
|
+
Status: {
|
|
570
|
+
type: 'select',
|
|
571
|
+
select: { id: '1', name: 'Done', color: 'blue' },
|
|
572
|
+
},
|
|
573
|
+
Priority: {
|
|
574
|
+
type: 'select',
|
|
575
|
+
select: { id: '2', name: 'Low', color: 'gray' },
|
|
576
|
+
},
|
|
577
|
+
},
|
|
578
|
+
},
|
|
579
|
+
]);
|
|
580
|
+
const result = pagesToSimple(pages, ['Name', 'Status']);
|
|
581
|
+
expect(result).toHaveLength(2);
|
|
582
|
+
expect(result[0]).toEqual({
|
|
583
|
+
id: 'page-1',
|
|
584
|
+
url: 'https://notion.so/page-1',
|
|
585
|
+
properties: { Name: 'Page 1', Status: 'Active' },
|
|
586
|
+
});
|
|
587
|
+
expect(result[1]).toEqual({
|
|
588
|
+
id: 'page-2',
|
|
589
|
+
url: 'https://notion.so/page-2',
|
|
590
|
+
properties: { Name: 'Page 2', Status: 'Done' },
|
|
591
|
+
});
|
|
592
|
+
expect(result[0].properties).not.toHaveProperty('Priority');
|
|
593
|
+
expect(result[1].properties).not.toHaveProperty('Priority');
|
|
594
|
+
});
|
|
492
595
|
});
|
|
493
596
|
describe('real world data', () => {
|
|
494
597
|
it('converts actual Notion page properties', () => {
|
|
@@ -23,9 +23,10 @@ export declare function pagePropertiesToSimple(properties: PageObjectResponse['p
|
|
|
23
23
|
/**
|
|
24
24
|
* ページプロパティをオブジェクト形式に変換(キー: プロパティ名、値: 値)
|
|
25
25
|
* @param properties - Notion APIから取得したプロパティオブジェクト
|
|
26
|
+
* @param fields - 取得するプロパティ名の配列(指定しない場合は全プロパティ)
|
|
26
27
|
* @returns シンプル化されたプロパティオブジェクト
|
|
27
28
|
*/
|
|
28
|
-
export declare function pagePropertiesToObject(properties: PageObjectResponse['properties']): Record<string, PropertyValue>;
|
|
29
|
+
export declare function pagePropertiesToObject(properties: PageObjectResponse['properties'], fields?: string[]): Record<string, PropertyValue>;
|
|
29
30
|
/**
|
|
30
31
|
* シンプル化されたページオブジェクトの型
|
|
31
32
|
*/
|
|
@@ -37,13 +38,15 @@ export interface SimplePage {
|
|
|
37
38
|
/**
|
|
38
39
|
* ページオブジェクトをシンプルな形式に変換
|
|
39
40
|
* @param page - Notion APIから取得したページオブジェクト
|
|
41
|
+
* @param fields - 取得するプロパティ名の配列(指定しない場合は全プロパティ)
|
|
40
42
|
* @returns シンプル化されたページオブジェクト
|
|
41
43
|
*/
|
|
42
|
-
export declare function pageToSimple(page: PageObjectResponse): SimplePage;
|
|
44
|
+
export declare function pageToSimple(page: PageObjectResponse, fields?: string[]): SimplePage;
|
|
43
45
|
/**
|
|
44
46
|
* ページ配列をシンプルな形式に変換
|
|
45
47
|
* @param pages - Notion APIから取得したページ配列
|
|
48
|
+
* @param fields - 取得するプロパティ名の配列(指定しない場合は全プロパティ)
|
|
46
49
|
* @returns シンプル化されたページ配列
|
|
47
50
|
*/
|
|
48
|
-
export declare function pagesToSimple(pages: PageObjectResponse[]): SimplePage[];
|
|
51
|
+
export declare function pagesToSimple(pages: PageObjectResponse[], fields?: string[]): SimplePage[];
|
|
49
52
|
//# sourceMappingURL=page-to-markdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-to-markdown.d.ts","sourceRoot":"","sources":["../../../src/converters/page-to-markdown.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAwB,MAAM,qBAAqB,CAAA;AAGnF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,aAAa,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AA4KjG;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,kBAAkB,CAAC,YAAY,CAAC,GAC3C,cAAc,EAAE,CAUlB;AAED
|
|
1
|
+
{"version":3,"file":"page-to-markdown.d.ts","sourceRoot":"","sources":["../../../src/converters/page-to-markdown.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAwB,MAAM,qBAAqB,CAAA;AAGnF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,aAAa,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AA4KjG;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,kBAAkB,CAAC,YAAY,CAAC,GAC3C,cAAc,EAAE,CAUlB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,kBAAkB,CAAC,YAAY,CAAC,EAC5C,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAc/B;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;CAC1C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,kBAAkB,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,CAMpF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,CAK1F"}
|
|
@@ -162,14 +162,19 @@ export function pagePropertiesToSimple(properties) {
|
|
|
162
162
|
/**
|
|
163
163
|
* ページプロパティをオブジェクト形式に変換(キー: プロパティ名、値: 値)
|
|
164
164
|
* @param properties - Notion APIから取得したプロパティオブジェクト
|
|
165
|
+
* @param fields - 取得するプロパティ名の配列(指定しない場合は全プロパティ)
|
|
165
166
|
* @returns シンプル化されたプロパティオブジェクト
|
|
166
167
|
*/
|
|
167
|
-
export function pagePropertiesToObject(properties) {
|
|
168
|
+
export function pagePropertiesToObject(properties, fields) {
|
|
168
169
|
if (!properties) {
|
|
169
170
|
return {};
|
|
170
171
|
}
|
|
171
172
|
const result = {};
|
|
172
173
|
for (const [name, prop] of Object.entries(properties)) {
|
|
174
|
+
// fieldsが指定されている場合は、指定されたプロパティのみを含める
|
|
175
|
+
if (fields && fields.length > 0 && !fields.includes(name)) {
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
173
178
|
result[name] = extractPropertyValue(prop);
|
|
174
179
|
}
|
|
175
180
|
return result;
|
|
@@ -177,23 +182,25 @@ export function pagePropertiesToObject(properties) {
|
|
|
177
182
|
/**
|
|
178
183
|
* ページオブジェクトをシンプルな形式に変換
|
|
179
184
|
* @param page - Notion APIから取得したページオブジェクト
|
|
185
|
+
* @param fields - 取得するプロパティ名の配列(指定しない場合は全プロパティ)
|
|
180
186
|
* @returns シンプル化されたページオブジェクト
|
|
181
187
|
*/
|
|
182
|
-
export function pageToSimple(page) {
|
|
188
|
+
export function pageToSimple(page, fields) {
|
|
183
189
|
return {
|
|
184
190
|
id: page.id,
|
|
185
191
|
url: page.url ?? '',
|
|
186
|
-
properties: pagePropertiesToObject(page.properties),
|
|
192
|
+
properties: pagePropertiesToObject(page.properties, fields),
|
|
187
193
|
};
|
|
188
194
|
}
|
|
189
195
|
/**
|
|
190
196
|
* ページ配列をシンプルな形式に変換
|
|
191
197
|
* @param pages - Notion APIから取得したページ配列
|
|
198
|
+
* @param fields - 取得するプロパティ名の配列(指定しない場合は全プロパティ)
|
|
192
199
|
* @returns シンプル化されたページ配列
|
|
193
200
|
*/
|
|
194
|
-
export function pagesToSimple(pages) {
|
|
201
|
+
export function pagesToSimple(pages, fields) {
|
|
195
202
|
if (!pages) {
|
|
196
203
|
return [];
|
|
197
204
|
}
|
|
198
|
-
return pages.map(pageToSimple);
|
|
205
|
+
return pages.map((page) => pageToSimple(page, fields));
|
|
199
206
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Client } from '@notionhq/client';
|
|
2
|
-
export type { AppendBlockChildrenParameters, AppendBlockChildrenResponse, BlockObjectRequest, BlockObjectResponse, BotUserObjectResponse, CommentObjectResponse, CreateCommentParameters, CreateCommentResponse, CreateDatabaseParameters, CreateDatabaseResponse, CreateDataSourceParameters, CreateDataSourceResponse, CreatePageParameters, CreatePageResponse, DatabaseObjectResponse, DataSourceObjectResponse, DeleteBlockParameters, DeleteBlockResponse, EquationRichTextItemResponse, GetBlockParameters, GetBlockResponse, GetDatabaseParameters, GetDatabaseResponse, GetDataSourceParameters, GetDataSourceResponse, GetPageParameters, GetPagePropertyParameters, GetPagePropertyResponse, GetPageResponse, GetSelfParameters, GetSelfResponse, GetUserParameters, GetUserResponse, ListBlockChildrenParameters, ListBlockChildrenResponse, ListCommentsParameters, ListCommentsResponse, ListUsersParameters, ListUsersResponse, MentionRichTextItemResponse, MovePageParameters, MovePageResponse, PageObjectResponse, PartialBlockObjectResponse, PartialCommentObjectResponse, PartialDatabaseObjectResponse, PartialDataSourceObjectResponse, PartialPageObjectResponse, PartialUserObjectResponse, PersonUserObjectResponse, PropertyItemListResponse, PropertyItemObjectResponse, QueryDataSourceParameters, QueryDataSourceResponse, RichTextItemResponse, SearchParameters, SearchResponse, TextRichTextItemResponse, UpdateBlockParameters, UpdateBlockResponse, UpdateDatabaseParameters, UpdateDatabaseResponse, UpdateDataSourceParameters, UpdateDataSourceResponse, UpdatePageParameters, UpdatePageResponse, UserObjectResponse, } from '@notionhq/client';
|
|
2
|
+
export type { AppendBlockChildrenParameters, AppendBlockChildrenResponse, BlockObjectRequest, BlockObjectResponse, BotUserObjectResponse, CommentObjectResponse, CreateCommentParameters, CreateCommentResponse, CreateDatabaseParameters, CreateDatabaseResponse, CreateDataSourceParameters, CreateDataSourceResponse, CreatePageParameters, CreatePageResponse, DatabaseObjectResponse, DataSourceObjectResponse, DeleteBlockParameters, DeleteBlockResponse, EquationRichTextItemResponse, GetBlockParameters, GetBlockResponse, GetDatabaseParameters, GetDatabaseResponse, GetDataSourceParameters, GetDataSourceResponse, GetPageParameters, GetPagePropertyParameters, GetPagePropertyResponse, GetPageResponse, GetSelfParameters, GetSelfResponse, GetUserParameters, GetUserResponse, ListBlockChildrenParameters, ListBlockChildrenResponse, ListCommentsParameters, ListCommentsResponse, ListUsersParameters, ListUsersResponse, MentionRichTextItemResponse, MovePageParameters, MovePageResponse, NotionClientError, PageObjectResponse, PartialBlockObjectResponse, PartialCommentObjectResponse, PartialDatabaseObjectResponse, PartialDataSourceObjectResponse, PartialPageObjectResponse, PartialUserObjectResponse, PersonUserObjectResponse, PropertyItemListResponse, PropertyItemObjectResponse, QueryDataSourceParameters, QueryDataSourceResponse, RichTextItemResponse, SearchParameters, SearchResponse, TextRichTextItemResponse, UpdateBlockParameters, UpdateBlockResponse, UpdateDatabaseParameters, UpdateDatabaseResponse, UpdateDataSourceParameters, UpdateDataSourceResponse, UpdatePageParameters, UpdatePageResponse, UserObjectResponse, } from '@notionhq/client';
|
|
3
3
|
export { APIResponseError, Client as NotionClient, collectPaginatedAPI, isFullBlock, isFullComment, isFullDatabase, isFullDataSource, isFullPage, isFullUser, isNotionClientError, iteratePaginatedAPI, } from '@notionhq/client';
|
|
4
|
-
export type { NotionClientError } from '@notionhq/client';
|
|
5
4
|
export interface NotionClientOptions {
|
|
6
5
|
token: string;
|
|
7
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notion-client.d.ts","sourceRoot":"","sources":["../../src/notion-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"notion-client.d.ts","sourceRoot":"","sources":["../../src/notion-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAKzC,YAAY,EACV,6BAA6B,EAC7B,2BAA2B,EAC3B,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EAErB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAElB,sBAAsB,EAEtB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,4BAA4B,EAC5B,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,2BAA2B,EAC3B,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,2BAA2B,EAC3B,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAEjB,kBAAkB,EAClB,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,+BAA+B,EAC/B,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EAExB,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,EAEvB,oBAAoB,EAEpB,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAElB,kBAAkB,GACnB,MAAM,kBAAkB,CAAA;AAIzB,OAAO,EACL,gBAAgB,EAChB,MAAM,IAAI,YAAY,EACtB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,kBAAkB,CAAA;AAEzB,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAS3C"}
|
|
@@ -93,6 +93,9 @@ export declare const Fields: {
|
|
|
93
93
|
readonly sorts: {
|
|
94
94
|
readonly desc: "Sort array. Example: [{\"property\":\"Date\",\"direction\":\"descending\"}]";
|
|
95
95
|
};
|
|
96
|
+
readonly fields: {
|
|
97
|
+
readonly desc: "Property names to include in response (simple format only). Example: [\"Name\", \"Status\", \"Date\"]";
|
|
98
|
+
};
|
|
96
99
|
readonly children: {
|
|
97
100
|
readonly desc: "Block objects array";
|
|
98
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../../../src/schemas/descriptions/fields.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CAC9D;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../../../src/schemas/descriptions/fields.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CAC9D;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsK2B,CAAA;AAE9C;;;;;;;GAOG;AACH,eAAO,MAAM,CAAC,EAgBN,GAAG,CAAC,IAAI,MAAM,OAAO,MAAM,GAAG,MAAM,GAAE,GAAG;IAE/C,cAAc,EAAE,MAAM,CAAA;IACtB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,iBAAiB,EAAE,MAAM,CAAA;IACzB,iBAAiB,EAAE,MAAM,CAAA;IACzB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA"}
|
|
@@ -107,6 +107,9 @@ export const Fields = {
|
|
|
107
107
|
sorts: {
|
|
108
108
|
desc: 'Sort array. Example: [{"property":"Date","direction":"descending"}]',
|
|
109
109
|
},
|
|
110
|
+
fields: {
|
|
111
|
+
desc: 'Property names to include in response (simple format only). Example: ["Name", "Status", "Date"]',
|
|
112
|
+
},
|
|
110
113
|
// ============================================
|
|
111
114
|
// Blocks
|
|
112
115
|
// ============================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"append-block-children.d.ts","sourceRoot":"","sources":["../../../src/tools/append-block-children.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAevD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"append-block-children.d.ts","sourceRoot":"","sources":["../../../src/tools/append-block-children.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAevD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAuCzF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { F } from '../schemas/descriptions/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { formatSimpleResponse, handleErrorWithContext } from '../utils/index.js';
|
|
4
4
|
// Minimal schema for MCP (full validation by Notion API)
|
|
5
5
|
const inputSchema = {
|
|
6
6
|
block_id: z.string().describe(F.block_id),
|
|
@@ -11,7 +11,7 @@ export function registerAppendBlockChildren(server, notion) {
|
|
|
11
11
|
server.registerTool('append-block-children', {
|
|
12
12
|
description: 'Append new blocks as children to a block or page. ' +
|
|
13
13
|
'Supports all block types: paragraph, headings, lists, code, images, etc. ' +
|
|
14
|
-
'Returns the created
|
|
14
|
+
'Returns the created block IDs. ' +
|
|
15
15
|
'Use the "after" parameter to insert blocks at a specific position.',
|
|
16
16
|
inputSchema,
|
|
17
17
|
}, async ({ block_id, children, after }) => {
|
|
@@ -24,7 +24,10 @@ export function registerAppendBlockChildren(server, notion) {
|
|
|
24
24
|
params.after = after;
|
|
25
25
|
}
|
|
26
26
|
const response = await notion.blocks.children.append(params);
|
|
27
|
-
|
|
27
|
+
// Return minimal response (block_ids only)
|
|
28
|
+
return formatSimpleResponse({
|
|
29
|
+
block_ids: response.results.map((block) => block.id),
|
|
30
|
+
});
|
|
28
31
|
}
|
|
29
32
|
catch (error) {
|
|
30
33
|
return handleErrorWithContext(error, notion, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"append-blocks-simple.d.ts","sourceRoot":"","sources":["../../../src/tools/append-blocks-simple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAIxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAWvD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"append-blocks-simple.d.ts","sourceRoot":"","sources":["../../../src/tools/append-blocks-simple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAIxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAWvD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA+BxF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { markdownToBlocks } from '../converters/index.js';
|
|
3
3
|
import { F } from '../schemas/descriptions/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { formatSimpleResponse, handleError } from '../utils/index.js';
|
|
5
5
|
// Minimal schema for MCP
|
|
6
6
|
const inputSchema = {
|
|
7
7
|
block_id: z.string().describe(F.block_id),
|
|
@@ -12,7 +12,8 @@ export function registerAppendBlocksSimple(server, notion) {
|
|
|
12
12
|
server.registerTool('append-blocks-simple', {
|
|
13
13
|
description: 'Append blocks to a page using Markdown. ' +
|
|
14
14
|
'Simpler than append-block-children: just provide markdown text. ' +
|
|
15
|
-
'Supports: headings (#), lists (- or 1.), checkboxes (- [ ]), code blocks (```), quotes (>), tables (| |), images (![]()), bold (**), italic (*), links ([]()), etc.'
|
|
15
|
+
'Supports: headings (#), lists (- or 1.), checkboxes (- [ ]), code blocks (```), quotes (>), tables (| |), images (![]()), bold (**), italic (*), links ([]()), etc. ' +
|
|
16
|
+
'Returns created block IDs.',
|
|
16
17
|
inputSchema,
|
|
17
18
|
}, async ({ block_id, content, after }) => {
|
|
18
19
|
try {
|
|
@@ -23,7 +24,10 @@ export function registerAppendBlocksSimple(server, notion) {
|
|
|
23
24
|
children,
|
|
24
25
|
...(after && { after }),
|
|
25
26
|
});
|
|
26
|
-
|
|
27
|
+
// Return minimal response (block_ids only)
|
|
28
|
+
return formatSimpleResponse({
|
|
29
|
+
block_ids: response.results.map((block) => block.id),
|
|
30
|
+
});
|
|
27
31
|
}
|
|
28
32
|
catch (error) {
|
|
29
33
|
return handleError(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive-database.d.ts","sourceRoot":"","sources":["../../../src/tools/archive-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAQvD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"archive-database.d.ts","sourceRoot":"","sources":["../../../src/tools/archive-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAQvD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAwBrF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { F } from '../schemas/descriptions/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { formatSimpleResponse, handleError } from '../utils/index.js';
|
|
4
4
|
const inputSchema = {
|
|
5
5
|
database_id: z.string().describe(F.database_id),
|
|
6
6
|
};
|
|
7
7
|
export function registerArchiveDatabase(server, notion) {
|
|
8
8
|
server.registerTool('archive-database', {
|
|
9
|
-
description: 'Move a database to trash. Recoverable for 30 days via Notion UI.',
|
|
9
|
+
description: 'Move a database to trash. Recoverable for 30 days via Notion UI. Returns database ID.',
|
|
10
10
|
inputSchema,
|
|
11
11
|
}, async ({ database_id }) => {
|
|
12
12
|
try {
|
|
@@ -14,7 +14,10 @@ export function registerArchiveDatabase(server, notion) {
|
|
|
14
14
|
database_id,
|
|
15
15
|
in_trash: true,
|
|
16
16
|
});
|
|
17
|
-
|
|
17
|
+
// Return minimal response (id only)
|
|
18
|
+
return formatSimpleResponse({
|
|
19
|
+
id: response.id,
|
|
20
|
+
});
|
|
18
21
|
}
|
|
19
22
|
catch (error) {
|
|
20
23
|
return handleError(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive-page.d.ts","sourceRoot":"","sources":["../../../src/tools/archive-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAQvD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"archive-page.d.ts","sourceRoot":"","sources":["../../../src/tools/archive-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAQvD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAuBjF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { F } from '../schemas/descriptions/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { formatSimpleResponse, handleError } from '../utils/index.js';
|
|
4
4
|
const inputSchema = {
|
|
5
5
|
page_id: z.string().describe(F.page_id),
|
|
6
6
|
};
|
|
7
7
|
export function registerArchivePage(server, notion) {
|
|
8
8
|
server.registerTool('archive-page', {
|
|
9
|
-
description: 'Move a page to trash. Recoverable for 30 days via Notion UI.',
|
|
9
|
+
description: 'Move a page to trash. Recoverable for 30 days via Notion UI. Returns page ID.',
|
|
10
10
|
inputSchema,
|
|
11
11
|
}, async ({ page_id }) => {
|
|
12
12
|
try {
|
|
@@ -14,7 +14,10 @@ export function registerArchivePage(server, notion) {
|
|
|
14
14
|
page_id,
|
|
15
15
|
archived: true,
|
|
16
16
|
});
|
|
17
|
-
|
|
17
|
+
// Return minimal response (id only)
|
|
18
|
+
return formatSimpleResponse({
|
|
19
|
+
id: response.id,
|
|
20
|
+
});
|
|
18
21
|
}
|
|
19
22
|
catch (error) {
|
|
20
23
|
return handleError(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-comment-simple.d.ts","sourceRoot":"","sources":["../../../src/tools/create-comment-simple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAWvD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"create-comment-simple.d.ts","sourceRoot":"","sources":["../../../src/tools/create-comment-simple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAWvD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAuDzF"}
|