Skip to content

Fix legacy output schemas for delegating server tools - #1928

Open
Oxygen56 wants to merge 1 commit into
modelcontextprotocol:mainfrom
Oxygen56:fix/1916-delegating-tool-output-schema
Open

Oxygen56 wants to merge 1 commit into
modelcontextprotocol:mainfrom
Oxygen56:fix/1916-delegating-tool-output-schema

Conversation

@Oxygen56

Copy link
Copy Markdown

Fixes #1916

Summary

Tools wrapped in DelegatingMcpServerTool now advertise an output schema matching their structured content to clients on the 2025-06-18 and 2025-11-25 protocols.

Unwrap the delegation chain only to identify SDK-created tools, then apply the existing legacy schema transform to the outer tool's ProtocolTool. Wrapper descriptions and schema constraints are preserved. Custom tools and 2026-07-28 clients retain their existing behavior. No public API is added.

Verification

Validated with the original .NET project/MSBuild and xUnit/VSTest entries, using the prepared local dependencies without restore or downloads. Builds retained warnings-as-errors and included the referenced analyzers, hosting/task/app libraries, and test-server prerequisites.

  • Built tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj with --no-restore --framework net10.0 --configuration Debug: passed with zero warnings/errors on both baseline and repaired sources.
  • Ran the same focused regression through dotnet test against the selected baseline (3338e88) and repaired sources. The baseline produced 10 expected schema failures and 28 passes; the repair passed all 38 cases. The actual baseline production files were used with the added tests backported temporarily; repaired source bytes were restored before the after-fix build.
  • Ran the broader server/protocol suites through the project test entry: 1,333 passed, zero failed/skipped.
  • git diff --check: passed; the contribution worktree is clean.

Focused test filter:
FullyQualifiedName~DelegatingToolOutputSchemaTests|FullyQualifiedName~DelegatingMcpServerToolTests|FullyQualifiedName~Sep2106ListToolsBackCompatTests

Tests used --no-build --no-restore --framework net10.0 --configuration Debug, the existing blame/crash handling and 7-minute hang budget, TRX output, and XPlat coverage collection. Coverage includes nested wrappers, wrapper overrides, nullable object and absent schemas, custom tools, both legacy protocols, and modern-client controls.

The complete platform/framework/configuration matrix, npm-backed integrations, packaging/API validation, AOT, documentation, and combined coverage workflows remain for CI. They were not run in this offline validation. A separate independent review is still required before publication.

AI assistance was used in preparing this contribution.

This branch has not been deployed

No deployments
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.

A tool behind DelegatingMcpServerTool advertises a non-object outputSchema to pre-2026-07-28 clients (regression from 1.4.1)

1 participant