Skip to content

Commit f958a0e

Browse files
Copilotstephentoub
andcommitted
Rename McpServerToolAttribute.OutputSchema to OutputSchemaType
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent 7e47551 commit f958a0e

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/ModelContextProtocol.Core/Server/AIFunctionMcpServerTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ private static McpServerToolCreateOptions DeriveOptions(MethodInfo method, McpSe
206206

207207
newOptions.UseStructuredContent = toolAttr.UseStructuredContent;
208208

209-
if (toolAttr.OutputSchema is Type outputSchemaType)
209+
if (toolAttr.OutputSchemaType is Type outputSchemaType)
210210
{
211211
newOptions.OutputSchema ??= AIJsonUtilities.CreateJsonSchema(outputSchemaType,
212212
serializerOptions: newOptions.SerializerOptions ?? McpJsonUtilities.DefaultOptions,

src/ModelContextProtocol.Core/Server/McpServerToolAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ public bool ReadOnly
284284
/// <see cref="UseStructuredContent"/> must also be set to <see langword="true"/> for this property to take effect.
285285
/// </para>
286286
/// </remarks>
287-
public Type? OutputSchema { get; set; }
287+
public Type? OutputSchemaType { get; set; }
288288

289289
/// <summary>
290290
/// Gets or sets the source URI for the tool's icon.

tests/ModelContextProtocol.Tests/Server/McpServerToolTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ public async Task OutputSchema_Options_OverridesReturnTypeSchema_InvokeAndValida
780780
AssertMatchesJsonSchema(tool.ProtocolTool.OutputSchema.Value, result.StructuredContent);
781781
}
782782

783-
[McpServerTool(UseStructuredContent = true, OutputSchema = typeof(Person))]
783+
[McpServerTool(UseStructuredContent = true, OutputSchemaType = typeof(Person))]
784784
private static CallToolResult ToolWithOutputSchemaAttribute()
785785
{
786786
var person = new Person("John", 27);
@@ -791,7 +791,7 @@ private static CallToolResult ToolWithOutputSchemaAttribute()
791791
};
792792
}
793793

794-
[McpServerTool(UseStructuredContent = false, OutputSchema = typeof(Person))]
794+
[McpServerTool(UseStructuredContent = false, OutputSchemaType = typeof(Person))]
795795
private static CallToolResult ToolWithOutputSchemaButNoStructuredContent()
796796
{
797797
return new CallToolResult()

0 commit comments

Comments
 (0)