Skip to content

Python: Allow optional MCP task tools through plain calls - #9746

Merged
Jose Alvarez (jpalvarezl) merged 1 commit into
mainfrom
jpalvarezl-mcp-extensions-status
Oct 27, 2026
Merged

Jose Alvarez (jpalvarezl) merged 1 commit into
mainfrom
jpalvarezl-mcp-extensions-status

Conversation

@jpalvarezl

Copy link
Copy Markdown
Member

Motivation & Context

The MCP 2.x migration currently excludes tools whose execution.taskSupport is either "required" or "optional". The MCP Tasks specification permits optional tools to be invoked through an ordinary tools/call, so this removes working Foundry Toolbox, Power BI, and knowledge-base tools from agents even though no task augmentation is requested.

This change restores those optional tools without adding or emulating Tasks-extension support. Tools that require task augmentation remain unavailable until the client supports the extension.

Description & Review Guide

  • What are the major changes? Skip only tools with taskSupport == "required"; allow optional tools through the existing plain tools/call path; update regression coverage to verify loading, metadata retention, invocation, and warning behavior; make the warning version-neutral; and clarify the Tasks boundary in ADR 0045 and the core package guidance.
  • What is the impact of these changes? Optional-task tools are available again and behave like ordinary MCP tools. Required-task, forbidden-task, and task-free behavior remains unchanged.
  • What do you want reviewers to focus on? Confirm that the ordinary-call behavior matches the MCP optional-task contract and that the documentation consistently distinguishes optional support from required task augmentation. The complete MCP core test file passed (465 passed, 2 skipped), and uv run poe syntax -P core passed.

Related Issue

Fixes #9675

#9690 contains the same core predicate correction and focused test update. This maintainer-owned PR additionally removes the stale SDK-version diagnostic and synchronizes ADR 0045 and the core contributor guidance with the intended behavior. The existing community PR will be handled separately by the maintainer.

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

AI assistance details: GitHub Copilot assisted with issue and specification analysis, implementation, regression-test updates, documentation clarification, validation, and this PR description.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after a language prefix such as Python: or .NET: — workflows keep the label and title prefix in sync automatically.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The narrow filtering correction preserves required-task exclusion and is supported by focused regression coverage and consistent documentation.

No open issues 🎉

What changed in this PR

Restores optional-task MCP tools to Python agents through ordinary tools/call, addressing #9675 without adding Tasks-extension support.

Changes:

  • Excludes only tools that require task augmentation and makes the warning version-neutral.
  • Updates regression coverage for optional-tool loading, metadata retention, invocation, and required-tool warnings.
  • Aligns the lifecycle ADR and core contributor guidance with the supported Tasks boundary.
File Description
python/​packages/​core/​tests/​core/​test_mcp.py Verifies optional tools remain available while required tools are skipped.
python/​packages/​core/​AGENTS.md Clarifies client limitations and updates the Tasks tracking issue.
python/​packages/​core/​agent_framework/​_mcp.py Limits filtering to required-task tools and updates the warning.
docs/​decisions/​0045-python-mcp-v2-client-lifecycle.md Documents ordinary calls for optional-task tools.

Review effort: Balanced

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAF Automated Review — Iteration 1

Result: No findings
Scope: full PR (1 commit(s)): fada4953d5c7
Model: gpt-5.6-sol

Overview

The PR narrows MCP discovery filtering so tools with optional Tasks support use the existing ordinary tools/call path, while tools that require the unsupported extension remain hidden. The required-tool check runs before metadata and function publication, and existing allow-list, approval, argument-filtering, atomic-refresh, and lifecycle guards continue to apply. Focused regression coverage verifies discovery, metadata retention, warning behavior, and invocation, with no supported Critical, High, or Medium residual risk.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.

@github-code-quality

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: Python

Python / code-coverage/python

main 1168c00 jpalvarezl-mcp-exten... fada495 +/-
92% 92% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

@jpalvarezl
Jose Alvarez (jpalvarezl) added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit b1a4c94 Oct 27, 2026
60 of 61 checks passed
@jpalvarezl
Jose Alvarez (jpalvarezl) deleted the jpalvarezl-mcp-extensions-status branch October 27, 2026 09:01

This branch was previously deployed

1 inactive deployment
github-app-auth — fada4953 Deployed Oct 27, 2026 by jpalvarezl via team_check #7630
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: MCP tools with execution.taskSupport "optional" are skipped, although they can be called without Tasks

3 participants