Skip to content

Commit da1bdc9

Browse files
ksinderclaude
andcommitted
Add page-markdown tools; source Notion-Version per operation
Adds two tools from the public Notion API that are a natural fit for agentic clients and were missing from the spec: - retrieve-page-markdown (GET /v1/pages/{page_id}/markdown) - update-page-markdown (PATCH /v1/pages/{page_id}/markdown) These endpoints read/write page content as enhanced Markdown instead of block JSON, which is far more token-efficient for LLMs. They require Notion-Version 2026-03-11, but the rest of the API stays on 2025-09-03. To support that without a breaking global version bump, the Notion-Version header is now sourced per operation from the OpenAPI spec: - HttpClient applies each operation's header-parameter `default` as a request header (resolving $ref'd params), so each endpoint pins the version it needs. An explicitly-configured Notion-Version (via OPENAPI_MCP_HEADERS) still wins. - The proxy no longer hardcodes Notion-Version for the NOTION_TOKEN path; it comes from the spec. - The parser no longer exposes header params (e.g. Notion-Version) as model-visible tool inputs — they were inert noise on 21/22 tools. Tests: per-operation header injection + user-override precedence (http-client.headers.test.ts), and markdown tool generation + no Notion-Version leakage against the real spec (notion-markdown-tools.test.ts). Full suite: 86 passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent e79f35f commit da1bdc9

8 files changed

Lines changed: 748 additions & 4 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ If you have hardcoded tool names or prompts that reference the old database tool
6969

7070
---
7171

72+
## Page content as Markdown
73+
74+
The server exposes two tools for working with page content as enhanced Markdown instead of block JSON, which is significantly more token-efficient for AI agents:
75+
76+
- `retrieve-page-markdown` — Read a page's full content as Markdown (`GET /v1/pages/{page_id}/markdown`). Pass `include_transcript: true` to inline meeting-note transcripts.
77+
- `update-page-markdown` — Edit a page's content with Markdown (`PATCH /v1/pages/{page_id}/markdown`). Prefer `replace_content` to overwrite the whole page, or `update_content` for targeted find-and-replace edits.
78+
79+
These endpoints require Notion API version `2026-03-11`. The server now sources the `Notion-Version` header **per operation** from the OpenAPI spec, so these tools use `2026-03-11` while the rest of the API continues to use `2025-09-03` — no configuration needed. If you set `Notion-Version` yourself via `OPENAPI_MCP_HEADERS`, your value takes precedence for every tool.
80+
81+
---
82+
7283
### Installation
7384

7485
#### 1. Setting up integration in Notion

0 commit comments

Comments
 (0)