Skip to content

Commit 24f1f39

Browse files
committed
docs: fix stale examples in migration guide
- Remove stray backtick in RequestParamsMeta section - Update 'After (v2)' example to use new handler pattern instead of removed @server.call_tool() decorator and server.request_context
1 parent aa6d861 commit 24f1f39

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/migration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ The nested `RequestParams.Meta` Pydantic model class has been replaced with a to
351351
- `RequestParams.Meta` (Pydantic model) → `RequestParamsMeta` (TypedDict)
352352
- Attribute access (`meta.progress_token`) → Dictionary access (`meta.get("progress_token")`)
353353
- `progress_token` field changed from `ProgressToken | None = None` to `NotRequired[ProgressToken]`
354-
`
355354

356355
**In request context handlers:**
357356

@@ -364,11 +363,12 @@ async def handle_tool(name: str, arguments: dict) -> list[TextContent]:
364363
await ctx.session.send_progress_notification(ctx.meta.progress_token, 0.5, 100)
365364

366365
# After (v2)
367-
@server.call_tool()
368-
async def handle_tool(name: str, arguments: dict) -> list[TextContent]:
369-
ctx = server.request_context
366+
async def handle_call_tool(
367+
ctx: RequestContext, params: CallToolRequestParams
368+
) -> CallToolResult:
370369
if ctx.meta and "progress_token" in ctx.meta:
371370
await ctx.session.send_progress_notification(ctx.meta["progress_token"], 0.5, 100)
371+
...
372372
```
373373

374374
### Resource URI type changed from `AnyUrl` to `str`

0 commit comments

Comments
 (0)