Skip to content

Commit e8adf03

Browse files
committed
fix: update JSON schema
1 parent aa2202f commit e8adf03

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",
@@ -808,61 +871,16 @@
808871
]
809872
},
810873
"IntegerSchema": {
811-
"description": "Schema definition for integer properties.\n\nSupports range validation, multiples, and enum values.",
874+
"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.",
812875
"type": "object",
813876
"properties": {
814-
"default": {
815-
"description": "Default value",
816-
"type": [
817-
"integer",
818-
"null"
819-
],
820-
"format": "int64"
821-
},
822877
"description": {
823878
"description": "Human-readable description",
824879
"type": [
825880
"string",
826881
"null"
827882
]
828883
},
829-
"enum": {
830-
"description": "Allowed integer values (when used as enum)",
831-
"type": [
832-
"array",
833-
"null"
834-
],
835-
"items": {
836-
"type": "integer",
837-
"format": "int64"
838-
}
839-
},
840-
"enumNames": {
841-
"description": "Optional human-readable names for each enum value",
842-
"type": [
843-
"array",
844-
"null"
845-
],
846-
"items": {
847-
"type": "string"
848-
}
849-
},
850-
"exclusiveMaximum": {
851-
"description": "Maximum value (exclusive)",
852-
"type": [
853-
"integer",
854-
"null"
855-
],
856-
"format": "int64"
857-
},
858-
"exclusiveMinimum": {
859-
"description": "Minimum value (exclusive)",
860-
"type": [
861-
"integer",
862-
"null"
863-
],
864-
"format": "int64"
865-
},
866884
"maximum": {
867885
"description": "Maximum value (inclusive)",
868886
"type": [
@@ -879,13 +897,12 @@
879897
],
880898
"format": "int64"
881899
},
882-
"multipleOf": {
883-
"description": "Value must be a multiple of this number",
900+
"title": {
901+
"description": "Optional title for the schema",
884902
"type": [
885-
"integer",
903+
"string",
886904
"null"
887-
],
888-
"format": "int64"
905+
]
889906
},
890907
"type": {
891908
"description": "Type discriminator",
@@ -1300,61 +1317,16 @@
13001317
]
13011318
},
13021319
"NumberSchema": {
1303-
"description": "Schema definition for number properties (floating-point).\n\nSupports range validation, multiples, and enum values.",
1320+
"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.",
13041321
"type": "object",
13051322
"properties": {
1306-
"default": {
1307-
"description": "Default value",
1308-
"type": [
1309-
"number",
1310-
"null"
1311-
],
1312-
"format": "double"
1313-
},
13141323
"description": {
13151324
"description": "Human-readable description",
13161325
"type": [
13171326
"string",
13181327
"null"
13191328
]
13201329
},
1321-
"enum": {
1322-
"description": "Allowed number values (when used as enum)",
1323-
"type": [
1324-
"array",
1325-
"null"
1326-
],
1327-
"items": {
1328-
"type": "number",
1329-
"format": "double"
1330-
}
1331-
},
1332-
"enumNames": {
1333-
"description": "Optional human-readable names for each enum value",
1334-
"type": [
1335-
"array",
1336-
"null"
1337-
],
1338-
"items": {
1339-
"type": "string"
1340-
}
1341-
},
1342-
"exclusiveMaximum": {
1343-
"description": "Maximum value (exclusive)",
1344-
"type": [
1345-
"number",
1346-
"null"
1347-
],
1348-
"format": "double"
1349-
},
1350-
"exclusiveMinimum": {
1351-
"description": "Minimum value (exclusive)",
1352-
"type": [
1353-
"number",
1354-
"null"
1355-
],
1356-
"format": "double"
1357-
},
13581330
"maximum": {
13591331
"description": "Maximum value (inclusive)",
13601332
"type": [
@@ -1371,13 +1343,12 @@
13711343
],
13721344
"format": "double"
13731345
},
1374-
"multipleOf": {
1375-
"description": "Value must be a multiple of this number",
1346+
"title": {
1347+
"description": "Optional title for the schema",
13761348
"type": [
1377-
"number",
1349+
"string",
13781350
"null"
1379-
],
1380-
"format": "double"
1351+
]
13811352
},
13821353
"type": {
13831354
"description": "Type discriminator",
@@ -1408,7 +1379,7 @@
14081379
"const": "ping"
14091380
},
14101381
"PrimitiveSchema": {
1411-
"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).",
1382+
"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).",
14121383
"anyOf": [
14131384
{
14141385
"description": "String property (with optional enum constraint)",
@@ -1441,6 +1412,14 @@
14411412
"$ref": "#/definitions/BooleanSchema"
14421413
}
14431414
]
1415+
},
1416+
{
1417+
"description": "Enum property (explicit enum schema)",
1418+
"allOf": [
1419+
{
1420+
"$ref": "#/definitions/EnumSchema"
1421+
}
1422+
]
14441423
}
14451424
]
14461425
},
@@ -2220,45 +2199,18 @@
22202199
]
22212200
},
22222201
"StringSchema": {
2223-
"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.",
2202+
"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\"",
22242203
"type": "object",
22252204
"properties": {
2226-
"default": {
2227-
"description": "Default value",
2228-
"type": [
2229-
"string",
2230-
"null"
2231-
]
2232-
},
22332205
"description": {
22342206
"description": "Human-readable description",
22352207
"type": [
22362208
"string",
22372209
"null"
22382210
]
22392211
},
2240-
"enum": {
2241-
"description": "Allowed string values (when used as enum)",
2242-
"type": [
2243-
"array",
2244-
"null"
2245-
],
2246-
"items": {
2247-
"type": "string"
2248-
}
2249-
},
2250-
"enumNames": {
2251-
"description": "Optional human-readable names for each enum value",
2252-
"type": [
2253-
"array",
2254-
"null"
2255-
],
2256-
"items": {
2257-
"type": "string"
2258-
}
2259-
},
22602212
"format": {
2261-
"description": "String format (e.g., \"email\", \"uri\", \"date-time\")",
2213+
"description": "String format - limited to: \"email\", \"uri\", \"date\", \"date-time\"",
22622214
"type": [
22632215
"string",
22642216
"null"
@@ -2282,8 +2234,8 @@
22822234
"format": "uint32",
22832235
"minimum": 0
22842236
},
2285-
"pattern": {
2286-
"description": "Regular expression pattern",
2237+
"title": {
2238+
"description": "Optional title for the schema",
22872239
"type": [
22882240
"string",
22892241
"null"

0 commit comments

Comments
 (0)