Skip to content

Commit 97b6790

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 a7a0efc commit 97b6790

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
@@ -303,7 +303,6 @@ The nested `RequestParams.Meta` Pydantic model class has been replaced with a to
303303
- `RequestParams.Meta` (Pydantic model) → `RequestParamsMeta` (TypedDict)
304304
- Attribute access (`meta.progress_token`) → Dictionary access (`meta.get("progress_token")`)
305305
- `progress_token` field changed from `ProgressToken | None = None` to `NotRequired[ProgressToken]`
306-
`
307306

308307
**In request context handlers:**
309308

@@ -316,11 +315,12 @@ async def handle_tool(name: str, arguments: dict) -> list[TextContent]:
316315
await ctx.session.send_progress_notification(ctx.meta.progress_token, 0.5, 100)
317316

318317
# After (v2)
319-
@server.call_tool()
320-
async def handle_tool(name: str, arguments: dict) -> list[TextContent]:
321-
ctx = server.request_context
318+
async def handle_call_tool(
319+
ctx: RequestContext, params: CallToolRequestParams
320+
) -> CallToolResult:
322321
if ctx.meta and "progress_token" in ctx.meta:
323322
await ctx.session.send_progress_notification(ctx.meta["progress_token"], 0.5, 100)
323+
...
324324
```
325325

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

0 commit comments

Comments
 (0)