feat!: add MRTR model types (SEP-2322) (#915)

* feat!: add SEP-2322 MRTR model types

* feat!: remove URLElicitationRequiredError (SEP-2322)
This commit is contained in:
Dale Seo 2026-07-08 14:03:33 -04:00 • committed by GitHub
commit f4ff56b81d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 969 additions and 255 deletions

View file

@ -143,10 +143,25 @@
],
"additionalProperties": true
},
"inputResponses": {
"description": "Client responses to server-initiated input requests from a previous\n[`InputRequiredResult`]. Present only when retrying after an incomplete result.",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"name": {
"description": "The name of the tool to call",
"type": "string"
},
"requestState": {
"description": "Opaque request state echoed back from a previous [`InputRequiredResult`].\nClients MUST return this value exactly as received.",
"type": [
"string",
"null"
]
},
"task": {
"description": "Task metadata for async task management (SEP-1319)",
"anyOf": [
@ -726,8 +741,23 @@
],
"additionalProperties": true
},
"inputResponses": {
"description": "Client responses to server-initiated input requests from a previous\n[`InputRequiredResult`].",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"name": {
"type": "string"
},
"requestState": {
"description": "Opaque request state echoed back from a previous [`InputRequiredResult`].",
"type": [
"string",
"null"
]
}
},
"required": [
@ -1374,6 +1404,21 @@
],
"additionalProperties": true
},
"inputResponses": {
"description": "Client responses to server-initiated input requests from a previous\n[`InputRequiredResult`].",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"requestState": {
"description": "Opaque request state echoed back from a previous [`InputRequiredResult`].",
"type": [
"string",
"null"
]
},
"uri": {
"description": "The URI of the resource to read",
"type": "string"

View file

@ -143,10 +143,25 @@
],
"additionalProperties": true
},
"inputResponses": {
"description": "Client responses to server-initiated input requests from a previous\n[`InputRequiredResult`]. Present only when retrying after an incomplete result.",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"name": {
"description": "The name of the tool to call",
"type": "string"
},
"requestState": {
"description": "Opaque request state echoed back from a previous [`InputRequiredResult`].\nClients MUST return this value exactly as received.",
"type": [
"string",
"null"
]
},
"task": {
"description": "Task metadata for async task management (SEP-1319)",
"anyOf": [
@ -726,8 +741,23 @@
],
"additionalProperties": true
},
"inputResponses": {
"description": "Client responses to server-initiated input requests from a previous\n[`InputRequiredResult`].",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"name": {
"type": "string"
},
"requestState": {
"description": "Opaque request state echoed back from a previous [`InputRequiredResult`].",
"type": [
"string",
"null"
]
}
},
"required": [
@ -1374,6 +1404,21 @@
],
"additionalProperties": true
},
"inputResponses": {
"description": "Client responses to server-initiated input requests from a previous\n[`InputRequiredResult`].",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"requestState": {
"description": "Opaque request state echoed back from a previous [`InputRequiredResult`].",
"type": [
"string",
"null"
]
},
"uri": {
"description": "The URI of the resource to read",
"type": "string"

View file

@ -178,6 +178,15 @@
"null"
]
},
"resultType": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
},
"structuredContent": {
"description": "An optional JSON object that represents the structured result of the tool call"
}
@ -292,6 +301,15 @@
},
"completion": {
"$ref": "#/definitions/CompletionInfo"
},
"resultType": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
}
},
"required": [
@ -752,35 +770,11 @@
}
]
},
"ElicitationCompletionNotificationMethod": {
"type": "string",
"format": "const",
"const": "notifications/elicitation/complete"
},
"ElicitationCreateRequestMethod": {
"type": "string",
"format": "const",
"const": "elicitation/create"
},
"ElicitationResponseNotificationParam": {
"description": "Notification parameters for an url elicitation completion notification.",
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
},
"elicitationId": {
"type": "string"
}
},
"required": [
"elicitationId"
]
},
"ElicitationSchema": {
"description": "Type-safe elicitation schema for requesting structured user input.\n\nThis enforces the MCP 2025-06-18 specification that elicitation schemas\nmust be objects with primitive-typed properties.\n\n# Example\n\n```rust\nuse rmcp::model::*;\n\nlet schema = ElicitationSchema::builder()\n .required_email(\"email\")\n .required_integer(\"age\", 0, 150)\n .optional_bool(\"newsletter\", false)\n .build();\n```",
"type": "object",
@ -948,6 +942,15 @@
"items": {
"$ref": "#/definitions/PromptMessage"
}
},
"resultType": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
}
},
"required": [
@ -1205,6 +1208,77 @@
"serverInfo"
]
},
"InputRequest": {
"description": "A server-initiated request that can appear inside [`InputRequests`].\n\nPer the MCP spec, only `CreateMessageRequest` (sampling),\n`ElicitRequest` (elicitation), and `ListRootsRequest` (roots)\nare allowed. This is modeled as an untagged enum rather than a\n`ServerRequest` alias to prevent `PingRequest` or `CustomRequest` from\nbeing included.",
"anyOf": [
{
"description": "A `sampling/createMessage` request.",
"allOf": [
{
"$ref": "#/definitions/Request"
}
]
},
{
"description": "An `elicitation/create` request.",
"allOf": [
{
"$ref": "#/definitions/Request2"
}
]
},
{
"description": "A `roots/list` request.",
"allOf": [
{
"$ref": "#/definitions/RequestNoParam2"
}
]
}
]
},
"InputRequiredResult": {
"description": "A result indicating that additional input is needed before the request\ncan be completed.\n\nAt least one of [`input_requests`](Self::input_requests) or\n[`request_state`](Self::request_state) MUST be present.\n\nServers MAY send this in response to `tools/call`, `prompts/get`, or\n`resources/read`. Servers MUST NOT send this for any other request.\n\n# Examples\n\n```\nuse rmcp::model::InputRequiredResult;\n\nlet result = InputRequiredResult::from_request_state(\"opaque-server-state\");\nassert!(result.input_requests.is_none());\nassert_eq!(result.request_state.as_deref(), Some(\"opaque-server-state\"));\n```",
"type": "object",
"properties": {
"_meta": {
"description": "Optional protocol-level metadata.",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"inputRequests": {
"description": "Server-initiated requests that the client must fulfill before retrying.",
"type": [
"object",
"null"
],
"additionalProperties": {
"$ref": "#/definitions/InputRequest"
}
},
"requestState": {
"description": "Opaque request state to be echoed back by the client on retry.\nClients MUST NOT inspect, parse, modify, or make any assumptions\nabout the contents.",
"type": [
"string",
"null"
]
},
"resultType": {
"description": "Always `\"input_required\"` for this result type.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
]
}
},
"required": [
"resultType"
]
},
"IntegerSchema": {
"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.",
"type": "object",
@ -1322,9 +1396,6 @@
{
"$ref": "#/definitions/Notification5"
},
{
"$ref": "#/definitions/Notification6"
},
{
"$ref": "#/definitions/CustomNotification"
}
@ -1456,6 +1527,15 @@
"items": {
"$ref": "#/definitions/Prompt"
}
},
"resultType": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
}
},
"required": [
@ -1483,6 +1563,15 @@
"items": {
"$ref": "#/definitions/ResourceTemplate"
}
},
"resultType": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
}
},
"required": [
@ -1510,6 +1599,15 @@
"items": {
"$ref": "#/definitions/Resource"
}
},
"resultType": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
}
},
"required": [
@ -1564,6 +1662,15 @@
"null"
]
},
"resultType": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
},
"tools": {
"type": "array",
"items": {
@ -1758,21 +1865,6 @@
]
},
"Notification5": {
"type": "object",
"properties": {
"method": {
"$ref": "#/definitions/ElicitationCompletionNotificationMethod"
},
"params": {
"$ref": "#/definitions/ElicitationResponseNotificationParam"
}
},
"required": [
"method",
"params"
]
},
"Notification6": {
"type": "object",
"properties": {
"method": {
@ -2129,6 +2221,15 @@
"items": {
"$ref": "#/definitions/ResourceContents"
}
},
"result_type": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
}
},
"required": [
@ -2442,6 +2543,10 @@
}
}
},
"ResultType": {
"description": "Indicates the type of a result object, allowing the client to\ndetermine how to parse the response.\n\nThe spec defines this as an open string (`\"complete\" | \"input_required\" | string`),\nso unknown values are preserved rather than rejected. Servers implementing this\nprotocol version MUST include `resultType` in every result. For backward\ncompatibility, clients MUST treat an absent field as `\"complete\"`.",
"type": "string"
},
"Role": {
"description": "Represents the role of a participant in a conversation or message exchange.\n\nUsed in sampling and chat contexts to distinguish between different\ntypes of message senders in the conversation flow.",
"oneOf": [
@ -2738,6 +2843,9 @@
{
"$ref": "#/definitions/CallToolResult"
},
{
"$ref": "#/definitions/InputRequiredResult"
},
{
"$ref": "#/definitions/GetTaskPayloadResult"
},

View file

@ -178,6 +178,15 @@
"null"
]
},
"resultType": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
},
"structuredContent": {
"description": "An optional JSON object that represents the structured result of the tool call"
}
@ -292,6 +301,15 @@
},
"completion": {
"$ref": "#/definitions/CompletionInfo"
},
"resultType": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
}
},
"required": [
@ -752,35 +770,11 @@
}
]
},
"ElicitationCompletionNotificationMethod": {
"type": "string",
"format": "const",
"const": "notifications/elicitation/complete"
},
"ElicitationCreateRequestMethod": {
"type": "string",
"format": "const",
"const": "elicitation/create"
},
"ElicitationResponseNotificationParam": {
"description": "Notification parameters for an url elicitation completion notification.",
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
},
"elicitationId": {
"type": "string"
}
},
"required": [
"elicitationId"
]
},
"ElicitationSchema": {
"description": "Type-safe elicitation schema for requesting structured user input.\n\nThis enforces the MCP 2025-06-18 specification that elicitation schemas\nmust be objects with primitive-typed properties.\n\n# Example\n\n```rust\nuse rmcp::model::*;\n\nlet schema = ElicitationSchema::builder()\n .required_email(\"email\")\n .required_integer(\"age\", 0, 150)\n .optional_bool(\"newsletter\", false)\n .build();\n```",
"type": "object",
@ -948,6 +942,15 @@
"items": {
"$ref": "#/definitions/PromptMessage"
}
},
"resultType": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
}
},
"required": [
@ -1205,6 +1208,77 @@
"serverInfo"
]
},
"InputRequest": {
"description": "A server-initiated request that can appear inside [`InputRequests`].\n\nPer the MCP spec, only `CreateMessageRequest` (sampling),\n`ElicitRequest` (elicitation), and `ListRootsRequest` (roots)\nare allowed. This is modeled as an untagged enum rather than a\n`ServerRequest` alias to prevent `PingRequest` or `CustomRequest` from\nbeing included.",
"anyOf": [
{
"description": "A `sampling/createMessage` request.",
"allOf": [
{
"$ref": "#/definitions/Request"
}
]
},
{
"description": "An `elicitation/create` request.",
"allOf": [
{
"$ref": "#/definitions/Request2"
}
]
},
{
"description": "A `roots/list` request.",
"allOf": [
{
"$ref": "#/definitions/RequestNoParam2"
}
]
}
]
},
"InputRequiredResult": {
"description": "A result indicating that additional input is needed before the request\ncan be completed.\n\nAt least one of [`input_requests`](Self::input_requests) or\n[`request_state`](Self::request_state) MUST be present.\n\nServers MAY send this in response to `tools/call`, `prompts/get`, or\n`resources/read`. Servers MUST NOT send this for any other request.\n\n# Examples\n\n```\nuse rmcp::model::InputRequiredResult;\n\nlet result = InputRequiredResult::from_request_state(\"opaque-server-state\");\nassert!(result.input_requests.is_none());\nassert_eq!(result.request_state.as_deref(), Some(\"opaque-server-state\"));\n```",
"type": "object",
"properties": {
"_meta": {
"description": "Optional protocol-level metadata.",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"inputRequests": {
"description": "Server-initiated requests that the client must fulfill before retrying.",
"type": [
"object",
"null"
],
"additionalProperties": {
"$ref": "#/definitions/InputRequest"
}
},
"requestState": {
"description": "Opaque request state to be echoed back by the client on retry.\nClients MUST NOT inspect, parse, modify, or make any assumptions\nabout the contents.",
"type": [
"string",
"null"
]
},
"resultType": {
"description": "Always `\"input_required\"` for this result type.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
]
}
},
"required": [
"resultType"
]
},
"IntegerSchema": {
"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.",
"type": "object",
@ -1322,9 +1396,6 @@
{
"$ref": "#/definitions/Notification5"
},
{
"$ref": "#/definitions/Notification6"
},
{
"$ref": "#/definitions/CustomNotification"
}
@ -1456,6 +1527,15 @@
"items": {
"$ref": "#/definitions/Prompt"
}
},
"resultType": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
}
},
"required": [
@ -1483,6 +1563,15 @@
"items": {
"$ref": "#/definitions/ResourceTemplate"
}
},
"resultType": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
}
},
"required": [
@ -1510,6 +1599,15 @@
"items": {
"$ref": "#/definitions/Resource"
}
},
"resultType": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
}
},
"required": [
@ -1564,6 +1662,15 @@
"null"
]
},
"resultType": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
},
"tools": {
"type": "array",
"items": {
@ -1758,21 +1865,6 @@
]
},
"Notification5": {
"type": "object",
"properties": {
"method": {
"$ref": "#/definitions/ElicitationCompletionNotificationMethod"
},
"params": {
"$ref": "#/definitions/ElicitationResponseNotificationParam"
}
},
"required": [
"method",
"params"
]
},
"Notification6": {
"type": "object",
"properties": {
"method": {
@ -2129,6 +2221,15 @@
"items": {
"$ref": "#/definitions/ResourceContents"
}
},
"result_type": {
"description": "Result type discriminator. Absent values deserialize as `\"complete\"`.",
"allOf": [
{
"$ref": "#/definitions/ResultType"
}
],
"default": "complete"
}
},
"required": [
@ -2442,6 +2543,10 @@
}
}
},
"ResultType": {
"description": "Indicates the type of a result object, allowing the client to\ndetermine how to parse the response.\n\nThe spec defines this as an open string (`\"complete\" | \"input_required\" | string`),\nso unknown values are preserved rather than rejected. Servers implementing this\nprotocol version MUST include `resultType` in every result. For backward\ncompatibility, clients MUST treat an absent field as `\"complete\"`.",
"type": "string"
},
"Role": {
"description": "Represents the role of a participant in a conversation or message exchange.\n\nUsed in sampling and chat contexts to distinguish between different\ntypes of message senders in the conversation flow.",
"oneOf": [
@ -2738,6 +2843,9 @@
{
"$ref": "#/definitions/CallToolResult"
},
{
"$ref": "#/definitions/InputRequiredResult"
},
{
"$ref": "#/definitions/GetTaskPayloadResult"
},