Commit cf32308
Add OutputSchema property to McpServerToolCreateOptions and McpServerToolAttribute
Adds support for specifying the output schema type independently of the return
type for tools returning CallToolResult. This allows developers to advertise
a meaningful OutputSchema in tools/list while still having full control over
the CallToolResult response (Meta, IsError, StructuredContent).
- Add `JsonElement? OutputSchema` property to McpServerToolCreateOptions
- Add `Type? OutputSchema` property to McpServerToolAttribute
- DeriveOptions converts the attribute's Type to a JSON schema
- CreateOutputSchema uses explicit OutputSchema over AIFunction's return schema
- Add 13 comprehensive tests covering all variations
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>1 parent cdf6b4b commit cf32308
5 files changed
Lines changed: 5785 additions & 1 deletion
File tree
- src/ModelContextProtocol.Core/Server
- tests/ModelContextProtocol.Tests/Server
0 commit comments