Commit 1be339c
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
- scripts
- src/openapi-mcp-server
- client
- __tests__
- mcp
- __tests__
- openapi
- __tests__
- __snapshots__
| 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