Commit da1bdc9
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
- scripts
- src/openapi-mcp-server
- client
- __tests__
- mcp
- __tests__
- openapi
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
72 | 83 | | |
73 | 84 | | |
74 | 85 | | |
| |||
0 commit comments