File tree Expand file tree Collapse file tree
src/ModelContextProtocol.Core/Protocol
tests/ModelContextProtocol.Tests/Protocol Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ public sealed class Tool : IBaseMetadata
6464 /// </para>
6565 /// </remarks>
6666 [ JsonPropertyName ( "inputSchema" ) ]
67+ [ JsonRequired ]
6768 public JsonElement InputSchema
6869 {
6970 get => field ;
Original file line number Diff line number Diff line change @@ -105,6 +105,14 @@ public static void ToolInputSchema_HasValidDefaultSchema()
105105 Assert . Equal ( "object" , typeElement . GetString ( ) ) ;
106106 }
107107
108+ [ Fact ]
109+ public static void ToolInputSchema_DeserializationRejectsMissingInputSchema ( )
110+ {
111+ const string json = """{"name":"test"}""" ;
112+
113+ Assert . Throws < JsonException > ( ( ) => JsonSerializer . Deserialize < Tool > ( json , McpJsonUtilities . DefaultOptions ) ) ;
114+ }
115+
108116 [ Theory ]
109117 [ InlineData ( "null" ) ]
110118 [ InlineData ( "false" ) ]
You can’t perform that action at this time.
0 commit comments