Skip to content

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

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

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

@putramkti putramkti commented May 22, 2026

Copy link
Copy Markdown

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.
@Kludex

Kludex commented Jun 2, 2026

Copy link
Copy Markdown
Member

I don't think this adds much. Thanks for the PR anyway.

@Kludex Kludex closed this Jun 2, 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.

2 participants