feat(rmcp): add optional _meta to CallToolResult, EmbeddedResource, and ResourceContents (#386)
* feat(rmcp): support optional _meta on EmbeddedResource and ResourceContents - Add optional _meta to RawEmbeddedResource and ResourceContents (text/blob) - Update constructors/usages to set meta: None by default - Add tests to lock behavior (embedded text/blob + CallToolResult) - Update JSON Schemas to include optional _meta fields * style(rmcp): rustfmt after _meta changes and tests
This commit is contained in:
parent
1a20f8a0d1
commit
7d46b39b49
4 changed files with 311 additions and 3 deletions
|
|
@ -892,6 +892,13 @@
|
|||
"RawEmbeddedResource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"resource": {
|
||||
"$ref": "#/definitions/ResourceContents"
|
||||
}
|
||||
|
|
@ -1252,6 +1259,13 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"mimeType": {
|
||||
"type": [
|
||||
"string",
|
||||
|
|
@ -1273,6 +1287,13 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"blob": {
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -892,6 +892,13 @@
|
|||
"RawEmbeddedResource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"resource": {
|
||||
"$ref": "#/definitions/ResourceContents"
|
||||
}
|
||||
|
|
@ -1252,6 +1259,13 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"mimeType": {
|
||||
"type": [
|
||||
"string",
|
||||
|
|
@ -1273,6 +1287,13 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"blob": {
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -181,6 +181,13 @@
|
|||
"Annotated3": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"annotations": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
|
@ -319,6 +326,14 @@
|
|||
"description": "The result of a tool call operation.\n\nContains the content returned by the tool execution and an optional\nflag indicating whether the operation resulted in an error.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"description": "Optional protocol-level metadata for this result",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"content": {
|
||||
"description": "The content returned by the tool (text, images, etc.)",
|
||||
"type": "array",
|
||||
|
|
@ -1380,6 +1395,13 @@
|
|||
"RawEmbeddedResource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"resource": {
|
||||
"$ref": "#/definitions/ResourceContents"
|
||||
}
|
||||
|
|
@ -1531,6 +1553,13 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"mimeType": {
|
||||
"type": [
|
||||
"string",
|
||||
|
|
@ -1552,6 +1581,13 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"blob": {
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -181,6 +181,13 @@
|
|||
"Annotated3": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"annotations": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
|
@ -319,6 +326,14 @@
|
|||
"description": "The result of a tool call operation.\n\nContains the content returned by the tool execution and an optional\nflag indicating whether the operation resulted in an error.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"description": "Optional protocol-level metadata for this result",
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"content": {
|
||||
"description": "The content returned by the tool (text, images, etc.)",
|
||||
"type": "array",
|
||||
|
|
@ -1380,6 +1395,13 @@
|
|||
"RawEmbeddedResource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"resource": {
|
||||
"$ref": "#/definitions/ResourceContents"
|
||||
}
|
||||
|
|
@ -1531,6 +1553,13 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"mimeType": {
|
||||
"type": [
|
||||
"string",
|
||||
|
|
@ -1552,6 +1581,13 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_meta": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"blob": {
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue