5.2 KiB
5.2 KiB
Notion MCP Server - Tools Summary
Overview
Successfully built 43 MCP tools across 6 categories for comprehensive Notion API coverage.
Tool Categories
1. Pages (7 tools) - src/tools/pages.ts
notion_get_page- Retrieve page by IDnotion_create_page- Create page in database or as child pagenotion_update_page- Update page properties/metadatanotion_archive_page- Archive a pagenotion_restore_page- Restore archived pagenotion_get_page_property- Get specific property from page
2. Databases (5 tools) - src/tools/databases.ts
notion_get_database- Retrieve database schemanotion_create_database- Create new databasenotion_update_database- Update database schema/metadatanotion_query_database- Query with filters and sorts (paginated)notion_query_database_all- Query all results (auto-pagination)
3. Blocks (23 tools) - src/tools/blocks.ts
Core Block Operations:
notion_get_block- Retrieve block by IDnotion_get_block_children- Get child blocks (paginated)notion_get_block_children_all- Get all children (auto-pagination)notion_append_block_children- Append blocks to parentnotion_update_block- Update block contentnotion_delete_block- Delete/archive block
Block Creation Helpers (17 types):
notion_create_paragraph- Paragraph blocknotion_create_heading- Heading (H1/H2/H3)notion_create_todo- To-do checkbox itemnotion_create_bulleted_list_item- Bulleted listnotion_create_numbered_list_item- Numbered listnotion_create_toggle- Toggle/collapsible blocknotion_create_code- Code block with syntax highlightingnotion_create_quote- Quote blocknotion_create_callout- Callout with iconnotion_create_divider- Horizontal dividernotion_create_bookmark- Bookmark URLnotion_create_image- Image from URLnotion_create_video- Video embednotion_create_embed- Generic embednotion_create_table- Table with rows/columns
4. Users (4 tools) - src/tools/users.ts
notion_get_user- Retrieve user by IDnotion_list_users- List workspace users (paginated)notion_list_users_all- List all users (auto-pagination)notion_get_me- Get bot/integration user info
5. Comments (3 tools) - src/tools/comments.ts
notion_create_comment- Add comment to page/blocknotion_list_comments- List comments (paginated)notion_list_comments_all- List all comments (auto-pagination)
6. Search (4 tools) - src/tools/search.ts
notion_search- Full-text search with filters/sorting (paginated)notion_search_all- Search all results (auto-pagination)notion_search_pages- Search pages onlynotion_search_databases- Search databases only
Architecture
Input Validation
- All tools use Zod schemas for type-safe input validation
- Schemas defined inline with tool handlers
- Runtime validation with helpful error messages
Naming Convention
- All tools follow
notion_verb_nounpattern - Clear, consistent naming for discoverability
- Examples:
notion_create_page,notion_query_database,notion_append_block_children
File Structure
src/tools/
├── index.ts # Barrel export + central routing
├── pages.ts # Page operations (7 tools)
├── databases.ts # Database operations (5 tools)
├── blocks.ts # Block operations (23 tools)
├── users.ts # User operations (4 tools)
├── comments.ts # Comment operations (3 tools)
└── search.ts # Search operations (4 tools)
Each file exports:
getTools(client: NotionClient): Tool[]- Tool definitionshandle[Category]Tool(toolName, args, client)- Execution handler
Central Routing
src/tools/index.ts provides:
getAllTools(client)- Returns all 43 toolshandleToolCall(toolName, args, client)- Routes to appropriate handler
Notion API Features Covered
Rich Text Support
- All text fields support Notion's rich_text format
- Helper function
textToRichText()for simple text conversion - Supports colors, formatting, links
Property Types
- Full support for all Notion property types
- Database schema creation/updates
- Page property manipulation
Filters & Sorts
- Compound filters (and/or)
- Property filters for all types
- Sorting by property or timestamp
Block Types
- 25+ block types supported
- Nested blocks (children)
- Block-specific properties (color, checkboxes, language, etc.)
Pagination
- Manual pagination tools (start_cursor support)
- Auto-pagination tools (
*_allvariants) - Configurable page_size (max 100)
TypeScript Compilation
✅ All files compile successfully with tsc --noEmit
✅ Full type safety with Notion types from src/types/index.ts
✅ No TypeScript errors
Next Steps
To integrate these tools into the server:
- Import in
src/server.ts:import { getAllTools, handleToolCall } from './tools/index.js'; - Replace inline tools in
ListToolsRequestSchemahandler withgetAllTools(this.client) - Replace switch statement in
CallToolRequestSchemawithhandleToolCall(name, args, this.client)
Tool Count Summary
- Total Tools: 43
- Target Range: 35-50 ✅
- Categories: 6
- Lines of Code: ~57,000 bytes across tool files