Skip to content

Commit 085bf78

Browse files
committed
upd json rpc message schema
1 parent 174af7e commit 085bf78

File tree

2 files changed

+153
-0
lines changed

2 files changed

+153
-0
lines changed

crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,17 @@
257257
"description": "```rust\n# use rmcp::model::ClientCapabilities;\nlet cap = ClientCapabilities::builder()\n .enable_experimental()\n .enable_roots()\n .enable_roots_list_changed()\n .build();\n```",
258258
"type": "object",
259259
"properties": {
260+
"elicitation": {
261+
"description": "Capability to handle elicitation requests from servers for interactive user input",
262+
"anyOf": [
263+
{
264+
"$ref": "#/definitions/ElicitationCapability"
265+
},
266+
{
267+
"type": "null"
268+
}
269+
]
270+
},
260271
"experimental": {
261272
"type": [
262273
"object",
@@ -294,6 +305,9 @@
294305
{
295306
"$ref": "#/definitions/ListRootsResult"
296307
},
308+
{
309+
"$ref": "#/definitions/CreateElicitationResult"
310+
},
297311
{
298312
"$ref": "#/definitions/EmptyObject"
299313
}
@@ -319,6 +333,26 @@
319333
"argument"
320334
]
321335
},
336+
"CreateElicitationResult": {
337+
"description": "The result returned by a client in response to an elicitation request.\n\nContains the user's decision (accept/decline/cancel) and optionally their input data\nif they chose to accept the request.",
338+
"type": "object",
339+
"properties": {
340+
"action": {
341+
"description": "The user's decision on how to handle the elicitation request",
342+
"allOf": [
343+
{
344+
"$ref": "#/definitions/ElicitationAction"
345+
}
346+
]
347+
},
348+
"content": {
349+
"description": "The actual data provided by the user, if they accepted the request.\nMust conform to the JSON schema specified in the original request.\nOnly present when action is Accept."
350+
}
351+
},
352+
"required": [
353+
"action"
354+
]
355+
},
322356
"CreateMessageResult": {
323357
"description": "The result of a sampling/createMessage request containing the generated response.\n\nThis structure contains the generated message along with metadata about\nhow the generation was performed and why it stopped.",
324358
"type": "object",
@@ -357,6 +391,39 @@
357391
"content"
358392
]
359393
},
394+
"ElicitationAction": {
395+
"description": "Represents the possible actions a user can take in response to an elicitation request.\n\nWhen a server requests user input through elicitation, the user can:\n- Accept: Provide the requested information and continue\n- Decline: Refuse to provide the information but continue the operation\n- Cancel: Stop the entire operation",
396+
"oneOf": [
397+
{
398+
"description": "User accepts the request and provides the requested information",
399+
"type": "string",
400+
"const": "accept"
401+
},
402+
{
403+
"description": "User declines to provide the information but allows the operation to continue",
404+
"type": "string",
405+
"const": "decline"
406+
},
407+
{
408+
"description": "User cancels the entire operation",
409+
"type": "string",
410+
"const": "cancel"
411+
}
412+
]
413+
},
414+
"ElicitationCapability": {
415+
"description": "Capability for handling elicitation requests from servers.\n\nElicitation allows servers to request interactive input from users during tool execution.\nThis capability indicates that a client can handle elicitation requests and present\nappropriate UI to users for collecting the requested information.",
416+
"type": "object",
417+
"properties": {
418+
"schemaValidation": {
419+
"description": "Whether the client supports JSON Schema validation for elicitation responses.\nWhen true, the client will validate user input against the requested_schema\nbefore sending the response back to the server.",
420+
"type": [
421+
"boolean",
422+
"null"
423+
]
424+
}
425+
}
426+
},
360427
"EmptyObject": {
361428
"description": "This is commonly used for representing empty objects in MCP messages.\n\nwithout returning any specific data.",
362429
"type": "object"

crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,45 @@
402402
}
403403
]
404404
},
405+
"CreateElicitationRequestParam": {
406+
"description": "Parameters for creating an elicitation request to gather user input.\n\nThis structure contains everything needed to request interactive input from a user:\n- A human-readable message explaining what information is needed\n- A JSON schema defining the expected structure of the response",
407+
"type": "object",
408+
"properties": {
409+
"message": {
410+
"description": "Human-readable message explaining what input is needed from the user.\nThis should be clear and provide sufficient context for the user to understand\nwhat information they need to provide.",
411+
"type": "string"
412+
},
413+
"requestedSchema": {
414+
"description": "JSON Schema defining the expected structure and validation rules for the user's response.\nThis allows clients to validate input and provide appropriate UI controls.\nMust be a valid JSON Schema Draft 2020-12 object.",
415+
"type": "object",
416+
"additionalProperties": true
417+
}
418+
},
419+
"required": [
420+
"message",
421+
"requestedSchema"
422+
]
423+
},
424+
"CreateElicitationResult": {
425+
"description": "The result returned by a client in response to an elicitation request.\n\nContains the user's decision (accept/decline/cancel) and optionally their input data\nif they chose to accept the request.",
426+
"type": "object",
427+
"properties": {
428+
"action": {
429+
"description": "The user's decision on how to handle the elicitation request",
430+
"allOf": [
431+
{
432+
"$ref": "#/definitions/ElicitationAction"
433+
}
434+
]
435+
},
436+
"content": {
437+
"description": "The actual data provided by the user, if they accepted the request.\nMust conform to the JSON schema specified in the original request.\nOnly present when action is Accept."
438+
}
439+
},
440+
"required": [
441+
"action"
442+
]
443+
},
405444
"CreateMessageRequestMethod": {
406445
"type": "string",
407446
"format": "const",
@@ -480,6 +519,31 @@
480519
"maxTokens"
481520
]
482521
},
522+
"ElicitationAction": {
523+
"description": "Represents the possible actions a user can take in response to an elicitation request.\n\nWhen a server requests user input through elicitation, the user can:\n- Accept: Provide the requested information and continue\n- Decline: Refuse to provide the information but continue the operation\n- Cancel: Stop the entire operation",
524+
"oneOf": [
525+
{
526+
"description": "User accepts the request and provides the requested information",
527+
"type": "string",
528+
"const": "accept"
529+
},
530+
{
531+
"description": "User declines to provide the information but allows the operation to continue",
532+
"type": "string",
533+
"const": "decline"
534+
},
535+
{
536+
"description": "User cancels the entire operation",
537+
"type": "string",
538+
"const": "cancel"
539+
}
540+
]
541+
},
542+
"ElicitationCreateRequestMethod": {
543+
"type": "string",
544+
"format": "const",
545+
"const": "elicitation/create"
546+
},
483547
"EmptyObject": {
484548
"description": "This is commonly used for representing empty objects in MCP messages.\n\nwithout returning any specific data.",
485549
"type": "object"
@@ -683,6 +747,9 @@
683747
},
684748
{
685749
"$ref": "#/definitions/RequestNoParam2"
750+
},
751+
{
752+
"$ref": "#/definitions/Request2"
686753
}
687754
],
688755
"required": [
@@ -1306,6 +1373,22 @@
13061373
"params"
13071374
]
13081375
},
1376+
"Request2": {
1377+
"description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing:\n- `method`: The name of the method being called\n- `params`: The parameters for the method\n- `extensions`: Additional context data (similar to HTTP headers)",
1378+
"type": "object",
1379+
"properties": {
1380+
"method": {
1381+
"$ref": "#/definitions/ElicitationCreateRequestMethod"
1382+
},
1383+
"params": {
1384+
"$ref": "#/definitions/CreateElicitationRequestParam"
1385+
}
1386+
},
1387+
"required": [
1388+
"method",
1389+
"params"
1390+
]
1391+
},
13091392
"RequestNoParam": {
13101393
"type": "object",
13111394
"properties": {
@@ -1545,6 +1628,9 @@
15451628
{
15461629
"$ref": "#/definitions/ListToolsResult"
15471630
},
1631+
{
1632+
"$ref": "#/definitions/CreateElicitationResult"
1633+
},
15481634
{
15491635
"$ref": "#/definitions/EmptyObject"
15501636
}

0 commit comments

Comments
 (0)