Skip to content

docs: clarify client tool cancellation guidance#2706

Closed
anhtnt90dev wants to merge 2 commits into
modelcontextprotocol:mainfrom
anhtnt90dev:docs-call-tool-cancellation-1410
Closed

docs: clarify client tool cancellation guidance#2706
anhtnt90dev wants to merge 2 commits into
modelcontextprotocol:mainfrom
anhtnt90dev:docs-call-tool-cancellation-1410

Conversation

@anhtnt90dev

Copy link
Copy Markdown

Summary

  • Clarify that server-side ctx.request_id is for correlation/protocol handlers, not a public cancellation handle for regular session.call_tool() calls.
  • Point long-running cancellable client workflows to task-based cancellation with session.experimental.call_tool_as_task() and cancel_task().
  • Note that protocol-level CancelledNotification is for low-level clients that track their own in-flight request IDs.

Closes #1410.

Verification

  • uv run --frozen mkdocs build --strict
  • uv run --frozen python scripts/update_readme_snippets.py --check --readme README.v2.md
  • pre-commit run markdownlint --files README.v2.md
  • git diff --check

@anhtnt90dev
anhtnt90dev force-pushed the docs-call-tool-cancellation-1410 branch from 610452c to 2424438 Compare May 28, 2026 11:16
@maxisbey

Copy link
Copy Markdown
Contributor

Thanks for the PR. The v2 rework changed the code this targets, so it no longer applies as-is. Closing this as part of a wider backlog cleanup around the v2 release. If it's still relevant, feel free to reopen.

AI Disclaimer

@maxisbey maxisbey closed this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cancelling a Call Tool Request from Client

2 participants