Server Configuration
Describes the environment variables required to run the server.
Name | Required | Description | Default |
---|---|---|---|
NOTION_API_TOKEN | No | Your Notion API token (secret_your_notion_token_here) |
Schema
Prompts
Interactive templates invoked by user choice
Name | Description |
---|---|
No prompts |
Resources
Contextual data attached and managed by the client
Name | Description |
---|---|
No resources |
Tools
Functions exposed to the LLM to take actions
Name | Description |
---|---|
upload_file_to_notion | Upload a file to Notion using the Notion API.
Args:
file_path: Path to the file to upload
notion_token: Notion API token for authentication (optional if NOTION_API_TOKEN env var is set)
file_name: Optional custom filename (defaults to original filename)
Returns:
The file upload ID from Notion (use upload_and_attach_file_to_page for URL)
Raises:
Exception: If file doesn't exist, exceeds size limit, or API call fails |
upload_and_attach_file_to_page | Upload a file to Notion and attach it to a specific page, returning download URL.
This function performs the complete workflow:
1. Upload file to Notion
2. Create file block and attach to specified page
3. Extract and return download URL with metadata
Args:
file_path: Path to the file to upload
page_id: Notion page ID to attach the file to (with or without dashes)
notion_token: Notion API token for authentication (optional if NOTION_API_TOKEN env var is set)
file_name: Optional custom filename (defaults to original filename)
caption: Optional caption for the file block
Returns:
Dictionary containing:
- file_upload_id: The uploaded file ID
- file_block_id: The created file block ID
- download_url: Temporary download URL (expires in 1 hour)
- expiry_time: ISO timestamp when download URL expires
- filename: Name of the file
- content_type: MIME type of the file
- file_size: Size of the file in bytes
Raises:
Exception: If file doesn't exist, exceeds size limit, or API call fails
Example:
result = await upload_and_attach_file_to_page(
"document.pdf",
"2785bbc0e5c281f48dfae9a48f53f6a6",
notion_token="ntn_xxx"
)
download_url = result["download_url"] |