Skip to content

Commit 1be339c

Browse files
ksinderclaude
andcommitted
Add page-as-Markdown tools; source Notion-Version per operation
Adds two tools from the public Notion API that fit 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) They read/write page content as enhanced Markdown instead of block JSON, which is far more token-efficient for LLMs. These endpoints require Notion-Version 2026-03-11 while the rest of the API stays on 2025-09-03, so Notion-Version is now sourced per operation from the OpenAPI spec: HttpClient applies each operation's header-param default (resolving $refs), an explicitly-configured Notion-Version still wins, the proxy no longer hardcodes it, and the parser no longer exposes header params as model-visible tool inputs. Also hardens the server-based integration tests against flakiness (root cause, not retries): a shared startTestServer/stopTestServer helper binds an ephemeral port (0), awaits the `listening` event before issuing requests, awaits full shutdown, and uses 127.0.0.1 to avoid localhost IPv4/IPv6 mismatch. This removes the intermittent ECONNRESET / "socket hang up" failures from random-port collisions and request-before-bind races. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 10e4530 commit 1be339c

11 files changed

Lines changed: 839 additions & 38 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)