Repository navigation
Python: Allow optional MCP task tools through plain calls - #9746
Conversation
There was a problem hiding this comment.
🟢 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
There was a problem hiding this comment.
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.
Motivation & Context
The MCP 2.x migration currently excludes tools whose
execution.taskSupportis either"required"or"optional". The MCP Tasks specification permits optional tools to be invoked through an ordinarytools/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
taskSupport == "required"; allow optional tools through the existing plaintools/callpath; 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.465 passed, 2 skipped), anduv run poe syntax -P corepassed.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
AI assistance details: GitHub Copilot assisted with issue and specification analysis, implementation, regression-test updates, documentation clarification, validation, and this PR description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after a language prefix such asPython:or.NET:— workflows keep the label and title prefix in sync automatically.