Skip to content

docs(experimental): add docstrings to default task handler functions#2661

Open
putramkti wants to merge 1 commit into
modelcontextprotocol:mainfrom
putramkti:docs/add-docstrings-experimental-task-handlers
Open

docs(experimental): add docstrings to default task handler functions#2661
putramkti wants to merge 1 commit into
modelcontextprotocol:mainfrom
putramkti:docs/add-docstrings-experimental-task-handlers

Conversation

@putramkti
Copy link
Copy Markdown

@putramkti putramkti commented May 22, 2026

Summary

Six public async functions in src/mcp/client/experimental/task_handlers.py were missing docstrings, while the surrounding module docstrings and CONTRIBUTING.md ("Include docstrings for public APIs") establish the convention.

Functions fixed:

  • default_get_task_handler
  • default_get_task_result_handler
  • default_list_tasks_handler
  • default_cancel_task_handler
  • default_task_augmented_sampling
  • default_task_augmented_elicitation

Each docstring describes the function's purpose and the error code it returns by default, consistent with the style used elsewhere in the same file.

Changes

  • src/mcp/client/experimental/task_handlers.py: +6 one-line docstrings, no logic changes

Checklist

  • Change is trivial (docs-only, no logic change)
  • ruff check passes
  • ruff format --check passes
  • pyright passes (0 errors)
  • pytest tests/client/ passes (200 passed, 1 xfailed)
  • No breaking changes

Six public async functions in task_handlers.py lacked docstrings,
violating the project's requirement that public APIs have docstrings
(AGENTS.md, CONTRIBUTING.md). Each docstring describes the function's
purpose and the error code it returns by default.
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.

1 participant