Skip to content

docs: clarify client tool cancellation guidance#2706

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

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
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

1 participant