Skip to content

Commit 3c6a263

Browse files
committed
fix: update JSON schema
1 parent 843c7ba commit 3c6a263

File tree

2 files changed

+172
-268
lines changed

2 files changed

+172
-268
lines changed

crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json

Lines changed: 86 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,13 @@
325325
"null"
326326
]
327327
},
328+
"title": {
329+
"description": "Optional title for the schema",
330+
"type": [
331+
"string",
332+
"null"
333+
]
334+
},
328335
"type": {
329336
"description": "Type discriminator",
330337
"allOf": [
@@ -631,6 +638,13 @@
631638
"type": "string"
632639
}
633640
},
641+
"title": {
642+
"description": "Optional title for the schema",
643+
"type": [
644+
"string",
645+
"null"
646+
]
647+
},
634648
"type": {
635649
"description": "Always \"object\" for elicitation schemas",
636650
"allOf": [
@@ -649,6 +663,55 @@
649663
"description": "This is commonly used for representing empty objects in MCP messages.\n\nwithout returning any specific data.",
650664
"type": "object"
651665
},
666+
"EnumSchema": {
667+
"description": "Schema definition for enum properties.\n\nCompliant with MCP 2025-06-18 specification for elicitation schemas.\nEnums must have string type and can optionally include human-readable names.",
668+
"type": "object",
669+
"properties": {
670+
"description": {
671+
"description": "Human-readable description",
672+
"type": [
673+
"string",
674+
"null"
675+
]
676+
},
677+
"enum": {
678+
"description": "Allowed enum values (string values only per MCP spec)",
679+
"type": "array",
680+
"items": {
681+
"type": "string"
682+
}
683+
},
684+
"enumNames": {
685+
"description": "Optional human-readable names for each enum value",
686+
"type": [
687+
"array",
688+
"null"
689+
],
690+
"items": {
691+
"type": "string"
692+
}
693+
},
694+
"title": {
695+
"description": "Optional title for the schema",
696+
"type": [
697+
"string",
698+
"null"
699+
]
700+
},
701+
"type": {
702+
"description": "Type discriminator (always \"string\" for enums)",
703+
"allOf": [
704+
{
705+
"$ref": "#/definitions/StringTypeConst"
706+
}
707+
]
708+
}
709+
},
710+
"required": [
711+
"type",
712+
"enum"
713+
]
714+
},
652715
"ErrorCode": {
653716
"description": "Standard JSON-RPC error codes used throughout the MCP protocol.\n\nThese codes follow the JSON-RPC 2.0 specification and provide\nstandardized error reporting across all MCP implementations.",
654717
"type": "integer",
@@ -805,61 +868,16 @@
805868
]
806869
},
807870
"IntegerSchema": {
808-
"description": "Schema definition for integer properties.\n\nSupports range validation, multiples, and enum values.",
871+
"description": "Schema definition for integer properties.\n\nCompliant with MCP 2025-06-18 specification for elicitation schemas.\nSupports only the fields allowed by the MCP spec.",
809872
"type": "object",
810873
"properties": {
811-
"default": {
812-
"description": "Default value",
813-
"type": [
814-
"integer",
815-
"null"
816-
],
817-
"format": "int64"
818-
},
819874
"description": {
820875
"description": "Human-readable description",
821876
"type": [
822877
"string",
823878
"null"
824879
]
825880
},
826-
"enum": {
827-
"description": "Allowed integer values (when used as enum)",
828-
"type": [
829-
"array",
830-
"null"
831-
],
832-
"items": {
833-
"type": "integer",
834-
"format": "int64"
835-
}
836-
},
837-
"enumNames": {
838-
"description": "Optional human-readable names for each enum value",
839-
"type": [
840-
"array",
841-
"null"
842-
],
843-
"items": {
844-
"type": "string"
845-
}
846-
},
847-
"exclusiveMaximum": {
848-
"description": "Maximum value (exclusive)",
849-
"type": [
850-
"integer",
851-
"null"
852-
],
853-
"format": "int64"
854-
},
855-
"exclusiveMinimum": {
856-
"description": "Minimum value (exclusive)",
857-
"type": [
858-
"integer",
859-
"null"
860-
],
861-
"format": "int64"
862-
},
863881
"maximum": {
864882
"description": "Maximum value (inclusive)",
865883
"type": [
@@ -876,13 +894,12 @@
876894
],
877895
"format": "int64"
878896
},
879-
"multipleOf": {
880-
"description": "Value must be a multiple of this number",
897+
"title": {
898+
"description": "Optional title for the schema",
881899
"type": [
882-
"integer",
900+
"string",
883901
"null"
884-
],
885-
"format": "int64"
902+
]
886903
},
887904
"type": {
888905
"description": "Type discriminator",
@@ -1297,61 +1314,16 @@
12971314
]
12981315
},
12991316
"NumberSchema": {
1300-
"description": "Schema definition for number properties (floating-point).\n\nSupports range validation, multiples, and enum values.",
1317+
"description": "Schema definition for number properties (floating-point).\n\nCompliant with MCP 2025-06-18 specification for elicitation schemas.\nSupports only the fields allowed by the MCP spec.",
13011318
"type": "object",
13021319
"properties": {
1303-
"default": {
1304-
"description": "Default value",
1305-
"type": [
1306-
"number",
1307-
"null"
1308-
],
1309-
"format": "double"
1310-
},
13111320
"description": {
13121321
"description": "Human-readable description",
13131322
"type": [
13141323
"string",
13151324
"null"
13161325
]
13171326
},
1318-
"enum": {
1319-
"description": "Allowed number values (when used as enum)",
1320-
"type": [
1321-
"array",
1322-
"null"
1323-
],
1324-
"items": {
1325-
"type": "number",
1326-
"format": "double"
1327-
}
1328-
},
1329-
"enumNames": {
1330-
"description": "Optional human-readable names for each enum value",
1331-
"type": [
1332-
"array",
1333-
"null"
1334-
],
1335-
"items": {
1336-
"type": "string"
1337-
}
1338-
},
1339-
"exclusiveMaximum": {
1340-
"description": "Maximum value (exclusive)",
1341-
"type": [
1342-
"number",
1343-
"null"
1344-
],
1345-
"format": "double"
1346-
},
1347-
"exclusiveMinimum": {
1348-
"description": "Minimum value (exclusive)",
1349-
"type": [
1350-
"number",
1351-
"null"
1352-
],
1353-
"format": "double"
1354-
},
13551327
"maximum": {
13561328
"description": "Maximum value (inclusive)",
13571329
"type": [
@@ -1368,13 +1340,12 @@
13681340
],
13691341
"format": "double"
13701342
},
1371-
"multipleOf": {
1372-
"description": "Value must be a multiple of this number",
1343+
"title": {
1344+
"description": "Optional title for the schema",
13731345
"type": [
1374-
"number",
1346+
"string",
13751347
"null"
1376-
],
1377-
"format": "double"
1348+
]
13781349
},
13791350
"type": {
13801351
"description": "Type discriminator",
@@ -1405,7 +1376,7 @@
14051376
"const": "ping"
14061377
},
14071378
"PrimitiveSchema": {
1408-
"description": "Primitive schema definition for elicitation properties.\n\nAccording to MCP 2025-06-18 specification, elicitation schemas must have\nproperties of primitive types only (string, number, integer, boolean).",
1379+
"description": "Primitive schema definition for elicitation properties.\n\nAccording to MCP 2025-06-18 specification, elicitation schemas must have\nproperties of primitive types only (string, number, integer, boolean, enum).",
14091380
"anyOf": [
14101381
{
14111382
"description": "String property (with optional enum constraint)",
@@ -1438,6 +1409,14 @@
14381409
"$ref": "#/definitions/BooleanSchema"
14391410
}
14401411
]
1412+
},
1413+
{
1414+
"description": "Enum property (explicit enum schema)",
1415+
"allOf": [
1416+
{
1417+
"$ref": "#/definitions/EnumSchema"
1418+
}
1419+
]
14411420
}
14421421
]
14431422
},
@@ -2217,45 +2196,18 @@
22172196
]
22182197
},
22192198
"StringSchema": {
2220-
"description": "Schema definition for string properties.\n\nSupports validation constraints like length, pattern matching, format, and enum values.\nAll fields are private to ensure validation - use builder methods to construct.",
2199+
"description": "Schema definition for string properties.\n\nCompliant with MCP 2025-06-18 specification for elicitation schemas.\nSupports only the fields allowed by the MCP spec:\n- format limited to: \"email\", \"uri\", \"date\", \"date-time\"",
22212200
"type": "object",
22222201
"properties": {
2223-
"default": {
2224-
"description": "Default value",
2225-
"type": [
2226-
"string",
2227-
"null"
2228-
]
2229-
},
22302202
"description": {
22312203
"description": "Human-readable description",
22322204
"type": [
22332205
"string",
22342206
"null"
22352207
]
22362208
},
2237-
"enum": {
2238-
"description": "Allowed string values (when used as enum)",
2239-
"type": [
2240-
"array",
2241-
"null"
2242-
],
2243-
"items": {
2244-
"type": "string"
2245-
}
2246-
},
2247-
"enumNames": {
2248-
"description": "Optional human-readable names for each enum value",
2249-
"type": [
2250-
"array",
2251-
"null"
2252-
],
2253-
"items": {
2254-
"type": "string"
2255-
}
2256-
},
22572209
"format": {
2258-
"description": "String format (e.g., \"email\", \"uri\", \"date-time\")",
2210+
"description": "String format - limited to: \"email\", \"uri\", \"date\", \"date-time\"",
22592211
"type": [
22602212
"string",
22612213
"null"
@@ -2279,8 +2231,8 @@
22792231
"format": "uint32",
22802232
"minimum": 0
22812233
},
2282-
"pattern": {
2283-
"description": "Regular expression pattern",
2234+
"title": {
2235+
"description": "Optional title for the schema",
22842236
"type": [
22852237
"string",
22862238
"null"

0 commit comments

Comments
 (0)