UNPKG

semem

Version:

Semantic Memory for Intelligent Agents

1,186 lines 89.4 kB
{ "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "Annotations": { "description": "Optional annotations for the client. The client can use annotations to inform how objects are used or displayed", "properties": { "audience": { "description": "Describes who the intended customer of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., `[\"user\", \"assistant\"]`).", "items": { "$ref": "#/definitions/Role" }, "type": "array" }, "priority": { "description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.", "maximum": 1, "minimum": 0, "type": "number" } }, "type": "object" }, "AudioContent": { "description": "Audio provided to or from an LLM.", "properties": { "annotations": { "$ref": "#/definitions/Annotations", "description": "Optional annotations for the client." }, "data": { "description": "The base64-encoded audio data.", "format": "byte", "type": "string" }, "mimeType": { "description": "The MIME type of the audio. Different providers may support different audio types.", "type": "string" }, "type": { "const": "audio", "type": "string" } }, "required": [ "data", "mimeType", "type" ], "type": "object" }, "BlobResourceContents": { "properties": { "blob": { "description": "A base64-encoded string representing the binary data of the item.", "format": "byte", "type": "string" }, "mimeType": { "description": "The MIME type of this resource, if known.", "type": "string" }, "uri": { "description": "The URI of this resource.", "format": "uri", "type": "string" } }, "required": [ "blob", "uri" ], "type": "object" }, "CallToolRequest": { "description": "Used by the client to invoke a tool provided by the server.", "properties": { "method": { "const": "tools/call", "type": "string" }, "params": { "properties": { "arguments": { "additionalProperties": {}, "type": "object" }, "name": { "type": "string" } }, "required": [ "name" ], "type": "object" } }, "required": [ "method", "params" ], "type": "object" }, "CallToolResult": { "description": "The server's response to a tool call.\n\nAny errors that originate from the tool SHOULD be reported inside the result\nobject, with `isError` set to true, _not_ as an MCP protocol-level error\nresponse. Otherwise, the LLM would not be able to see that an error occurred\nand self-correct.\n\nHowever, any errors in _finding_ the tool, an error indicating that the\nserver does not support tool calls, or any other exceptional conditions,\nshould be reported as an MCP error response.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "content": { "items": { "anyOf": [ { "$ref": "#/definitions/TextContent" }, { "$ref": "#/definitions/ImageContent" }, { "$ref": "#/definitions/AudioContent" }, { "$ref": "#/definitions/EmbeddedResource" } ] }, "type": "array" }, "isError": { "description": "Whether the tool call ended in an error.\n\nIf not set, this is assumed to be false (the call was successful).", "type": "boolean" } }, "required": [ "content" ], "type": "object" }, "CancelledNotification": { "description": "This notification can be sent by either side to indicate that it is cancelling a previously-issued request.\n\nThe request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.\n\nThis notification indicates that the result will be unused, so any associated processing SHOULD cease.\n\nA client MUST NOT attempt to cancel its `initialize` request.", "properties": { "method": { "const": "notifications/cancelled", "type": "string" }, "params": { "properties": { "reason": { "description": "An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.", "type": "string" }, "requestId": { "$ref": "#/definitions/RequestId", "description": "The ID of the request to cancel.\n\nThis MUST correspond to the ID of a request previously issued in the same direction." } }, "required": [ "requestId" ], "type": "object" } }, "required": [ "method", "params" ], "type": "object" }, "ClientCapabilities": { "description": "Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.", "properties": { "experimental": { "additionalProperties": { "additionalProperties": true, "properties": {}, "type": "object" }, "description": "Experimental, non-standard capabilities that the client supports.", "type": "object" }, "roots": { "description": "Present if the client supports listing roots.", "properties": { "listChanged": { "description": "Whether the client supports notifications for changes to the roots list.", "type": "boolean" } }, "type": "object" }, "sampling": { "additionalProperties": true, "description": "Present if the client supports sampling from an LLM.", "properties": {}, "type": "object" } }, "type": "object" }, "ClientNotification": { "anyOf": [ { "$ref": "#/definitions/CancelledNotification" }, { "$ref": "#/definitions/InitializedNotification" }, { "$ref": "#/definitions/ProgressNotification" }, { "$ref": "#/definitions/RootsListChangedNotification" } ] }, "ClientRequest": { "anyOf": [ { "$ref": "#/definitions/InitializeRequest" }, { "$ref": "#/definitions/PingRequest" }, { "$ref": "#/definitions/ListResourcesRequest" }, { "$ref": "#/definitions/ListResourceTemplatesRequest" }, { "$ref": "#/definitions/ReadResourceRequest" }, { "$ref": "#/definitions/SubscribeRequest" }, { "$ref": "#/definitions/UnsubscribeRequest" }, { "$ref": "#/definitions/ListPromptsRequest" }, { "$ref": "#/definitions/GetPromptRequest" }, { "$ref": "#/definitions/ListToolsRequest" }, { "$ref": "#/definitions/CallToolRequest" }, { "$ref": "#/definitions/SetLevelRequest" }, { "$ref": "#/definitions/CompleteRequest" } ] }, "ClientResult": { "anyOf": [ { "$ref": "#/definitions/Result" }, { "$ref": "#/definitions/CreateMessageResult" }, { "$ref": "#/definitions/ListRootsResult" } ] }, "CompleteRequest": { "description": "A request from the client to the server, to ask for completion options.", "properties": { "method": { "const": "completion/complete", "type": "string" }, "params": { "properties": { "argument": { "description": "The argument's information", "properties": { "name": { "description": "The name of the argument", "type": "string" }, "value": { "description": "The value of the argument to use for completion matching.", "type": "string" } }, "required": [ "name", "value" ], "type": "object" }, "ref": { "anyOf": [ { "$ref": "#/definitions/PromptReference" }, { "$ref": "#/definitions/ResourceReference" } ] } }, "required": [ "argument", "ref" ], "type": "object" } }, "required": [ "method", "params" ], "type": "object" }, "CompleteResult": { "description": "The server's response to a completion/complete request", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "completion": { "properties": { "hasMore": { "description": "Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.", "type": "boolean" }, "total": { "description": "The total number of completion options available. This can exceed the number of values actually sent in the response.", "type": "integer" }, "values": { "description": "An array of completion values. Must not exceed 100 items.", "items": { "type": "string" }, "type": "array" } }, "required": [ "values" ], "type": "object" } }, "required": [ "completion" ], "type": "object" }, "CreateMessageRequest": { "description": "A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.", "properties": { "method": { "const": "sampling/createMessage", "type": "string" }, "params": { "properties": { "includeContext": { "description": "A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.", "enum": [ "allServers", "none", "thisServer" ], "type": "string" }, "maxTokens": { "description": "The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested.", "type": "integer" }, "messages": { "items": { "$ref": "#/definitions/SamplingMessage" }, "type": "array" }, "metadata": { "additionalProperties": true, "description": "Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.", "properties": {}, "type": "object" }, "modelPreferences": { "$ref": "#/definitions/ModelPreferences", "description": "The server's preferences for which model to select. The client MAY ignore these preferences." }, "stopSequences": { "items": { "type": "string" }, "type": "array" }, "systemPrompt": { "description": "An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.", "type": "string" }, "temperature": { "type": "number" } }, "required": [ "maxTokens", "messages" ], "type": "object" } }, "required": [ "method", "params" ], "type": "object" }, "CreateMessageResult": { "description": "The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "content": { "anyOf": [ { "$ref": "#/definitions/TextContent" }, { "$ref": "#/definitions/ImageContent" }, { "$ref": "#/definitions/AudioContent" } ] }, "model": { "description": "The name of the model that generated the message.", "type": "string" }, "role": { "$ref": "#/definitions/Role" }, "stopReason": { "description": "The reason why sampling stopped, if known.", "type": "string" } }, "required": [ "content", "model", "role" ], "type": "object" }, "Cursor": { "description": "An opaque token used to represent a cursor for pagination.", "type": "string" }, "EmbeddedResource": { "description": "The contents of a resource, embedded into a prompt or tool call result.\n\nIt is up to the client how best to render embedded resources for the benefit\nof the LLM and/or the user.", "properties": { "annotations": { "$ref": "#/definitions/Annotations", "description": "Optional annotations for the client." }, "resource": { "anyOf": [ { "$ref": "#/definitions/TextResourceContents" }, { "$ref": "#/definitions/BlobResourceContents" } ] }, "type": { "const": "resource", "type": "string" } }, "required": [ "resource", "type" ], "type": "object" }, "EmptyResult": { "$ref": "#/definitions/Result" }, "GetPromptRequest": { "description": "Used by the client to get a prompt provided by the server.", "properties": { "method": { "const": "prompts/get", "type": "string" }, "params": { "properties": { "arguments": { "additionalProperties": { "type": "string" }, "description": "Arguments to use for templating the prompt.", "type": "object" }, "name": { "description": "The name of the prompt or prompt template.", "type": "string" } }, "required": [ "name" ], "type": "object" } }, "required": [ "method", "params" ], "type": "object" }, "GetPromptResult": { "description": "The server's response to a prompts/get request from the client.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "description": { "description": "An optional description for the prompt.", "type": "string" }, "messages": { "items": { "$ref": "#/definitions/PromptMessage" }, "type": "array" } }, "required": [ "messages" ], "type": "object" }, "ImageContent": { "description": "An image provided to or from an LLM.", "properties": { "annotations": { "$ref": "#/definitions/Annotations", "description": "Optional annotations for the client." }, "data": { "description": "The base64-encoded image data.", "format": "byte", "type": "string" }, "mimeType": { "description": "The MIME type of the image. Different providers may support different image types.", "type": "string" }, "type": { "const": "image", "type": "string" } }, "required": [ "data", "mimeType", "type" ], "type": "object" }, "Implementation": { "description": "Describes the name and version of an MCP implementation.", "properties": { "name": { "type": "string" }, "version": { "type": "string" } }, "required": [ "name", "version" ], "type": "object" }, "InitializeRequest": { "description": "This request is sent from the client to the server when it first connects, asking it to begin initialization.", "properties": { "method": { "const": "initialize", "type": "string" }, "params": { "properties": { "capabilities": { "$ref": "#/definitions/ClientCapabilities" }, "clientInfo": { "$ref": "#/definitions/Implementation" }, "protocolVersion": { "description": "The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.", "type": "string" } }, "required": [ "capabilities", "clientInfo", "protocolVersion" ], "type": "object" } }, "required": [ "method", "params" ], "type": "object" }, "InitializeResult": { "description": "After receiving an initialize request from the client, the server sends this response.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "capabilities": { "$ref": "#/definitions/ServerCapabilities" }, "instructions": { "description": "Instructions describing how to use the server and its features.\n\nThis can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a \"hint\" to the model. For example, this information MAY be added to the system prompt.", "type": "string" }, "protocolVersion": { "description": "The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.", "type": "string" }, "serverInfo": { "$ref": "#/definitions/Implementation" } }, "required": [ "capabilities", "protocolVersion", "serverInfo" ], "type": "object" }, "InitializedNotification": { "description": "This notification is sent from the client to the server after initialization has finished.", "properties": { "method": { "const": "notifications/initialized", "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "additionalProperties": {}, "description": "This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.", "type": "object" } }, "type": "object" } }, "required": [ "method" ], "type": "object" }, "JSONRPCBatchRequest": { "description": "A JSON-RPC batch request, as described in https://www.jsonrpc.org/specification#batch.", "items": { "anyOf": [ { "$ref": "#/definitions/JSONRPCRequest" }, { "$ref": "#/definitions/JSONRPCNotification" } ] }, "type": "array" }, "JSONRPCBatchResponse": { "description": "A JSON-RPC batch response, as described in https://www.jsonrpc.org/specification#batch.", "items": { "anyOf": [ { "$ref": "#/definitions/JSONRPCResponse" }, { "$ref": "#/definitions/JSONRPCError" } ] }, "type": "array" }, "JSONRPCError": { "description": "A response to a request that indicates an error occurred.", "properties": { "error": { "properties": { "code": { "description": "The error type that occurred.", "type": "integer" }, "data": { "description": "Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.)." }, "message": { "description": "A short description of the error. The message SHOULD be limited to a concise single sentence.", "type": "string" } }, "required": [ "code", "message" ], "type": "object" }, "id": { "$ref": "#/definitions/RequestId" }, "jsonrpc": { "const": "2.0", "type": "string" } }, "required": [ "error", "id", "jsonrpc" ], "type": "object" }, "JSONRPCMessage": { "anyOf": [ { "$ref": "#/definitions/JSONRPCRequest" }, { "$ref": "#/definitions/JSONRPCNotification" }, { "description": "A JSON-RPC batch request, as described in https://www.jsonrpc.org/specification#batch.", "items": { "anyOf": [ { "$ref": "#/definitions/JSONRPCRequest" }, { "$ref": "#/definitions/JSONRPCNotification" } ] }, "type": "array" }, { "$ref": "#/definitions/JSONRPCResponse" }, { "$ref": "#/definitions/JSONRPCError" }, { "description": "A JSON-RPC batch response, as described in https://www.jsonrpc.org/specification#batch.", "items": { "anyOf": [ { "$ref": "#/definitions/JSONRPCResponse" }, { "$ref": "#/definitions/JSONRPCError" } ] }, "type": "array" } ], "description": "Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent." }, "JSONRPCNotification": { "description": "A notification which does not expect a response.", "properties": { "jsonrpc": { "const": "2.0", "type": "string" }, "method": { "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "additionalProperties": {}, "description": "This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.", "type": "object" } }, "type": "object" } }, "required": [ "jsonrpc", "method" ], "type": "object" }, "JSONRPCRequest": { "description": "A request that expects a response.", "properties": { "id": { "$ref": "#/definitions/RequestId" }, "jsonrpc": { "const": "2.0", "type": "string" }, "method": { "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "properties": { "progressToken": { "$ref": "#/definitions/ProgressToken", "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications." } }, "type": "object" } }, "type": "object" } }, "required": [ "id", "jsonrpc", "method" ], "type": "object" }, "JSONRPCResponse": { "description": "A successful (non-error) response to a request.", "properties": { "id": { "$ref": "#/definitions/RequestId" }, "jsonrpc": { "const": "2.0", "type": "string" }, "result": { "$ref": "#/definitions/Result" } }, "required": [ "id", "jsonrpc", "result" ], "type": "object" }, "ListPromptsRequest": { "description": "Sent from the client to request a list of prompts and prompt templates the server has.", "properties": { "method": { "const": "prompts/list", "type": "string" }, "params": { "properties": { "cursor": { "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.", "type": "string" } }, "type": "object" } }, "required": [ "method" ], "type": "object" }, "ListPromptsResult": { "description": "The server's response to a prompts/list request from the client.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "nextCursor": { "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.", "type": "string" }, "prompts": { "items": { "$ref": "#/definitions/Prompt" }, "type": "array" } }, "required": [ "prompts" ], "type": "object" }, "ListResourceTemplatesRequest": { "description": "Sent from the client to request a list of resource templates the server has.", "properties": { "method": { "const": "resources/templates/list", "type": "string" }, "params": { "properties": { "cursor": { "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.", "type": "string" } }, "type": "object" } }, "required": [ "method" ], "type": "object" }, "ListResourceTemplatesResult": { "description": "The server's response to a resources/templates/list request from the client.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "nextCursor": { "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.", "type": "string" }, "resourceTemplates": { "items": { "$ref": "#/definitions/ResourceTemplate" }, "type": "array" } }, "required": [ "resourceTemplates" ], "type": "object" }, "ListResourcesRequest": { "description": "Sent from the client to request a list of resources the server has.", "properties": { "method": { "const": "resources/list", "type": "string" }, "params": { "properties": { "cursor": { "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.", "type": "string" } }, "type": "object" } }, "required": [ "method" ], "type": "object" }, "ListResourcesResult": { "description": "The server's response to a resources/list request from the client.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "nextCursor": { "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.", "type": "string" }, "resources": { "items": { "$ref": "#/definitions/Resource" }, "type": "array" } }, "required": [ "resources" ], "type": "object" }, "ListRootsRequest": { "description": "Sent from the server to request a list of root URIs from the client. Roots allow\nservers to ask for specific directories or files to operate on. A common example\nfor roots is providing a set of repositories or directories a server should operate\non.\n\nThis request is typically used when the server needs to understand the file system\nstructure or access specific locations that the client has permission to read from.", "properties": { "method": { "const": "roots/list", "type": "string" }, "params": { "additionalProperties": {}, "properties": { "_meta": { "properties": { "progressToken": { "$ref": "#/definitions/ProgressToken", "description": "If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications." } }, "type": "object" } }, "type": "object" } }, "required": [ "method" ], "type": "object" }, "ListRootsResult": { "description": "The client's response to a roots/list request from the server.\nThis result contains an array of Root objects, each representing a root directory\nor file that the server can operate on.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "roots": { "items": { "$ref": "#/definitions/Root" }, "type": "array" } }, "required": [ "roots" ], "type": "object" }, "ListToolsRequest": { "description": "Sent from the client to request a list of tools the server has.", "properties": { "method": { "const": "tools/list", "type": "string" }, "params": { "properties": { "cursor": { "description": "An opaque token representing the current pagination position.\nIf provided, the server should return results starting after this cursor.", "type": "string" } }, "type": "object" } }, "required": [ "method" ], "type": "object" }, "ListToolsResult": { "description": "The server's response to a tools/list request from the client.", "properties": { "_meta": { "additionalProperties": {}, "description": "This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.", "type": "object" }, "nextCursor": { "description": "An opaque token representing the pagination position after the last returned result.\nIf present, there may be more results available.", "type": "string" }, "tools": { "items": { "$ref": "#/definitions/Tool" }, "type": "array" } }, "required": [ "tools" ], "type": "object" }, "LoggingLevel": { "description": "The severity of a log message.\n\nThese map to syslog message severities, as specified in RFC-5424:\nhttps://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1", "enum": [ "alert", "critical", "debug", "emergency", "error", "info", "notice", "warning" ], "type": "string" }, "LoggingMessageNotification": { "description": "Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.", "properties": { "method": { "const": "notifications/message", "type": "string" }, "params": { "properties": { "data": { "description": "The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here." }, "level": { "$ref": "#/definitions/LoggingLevel", "description": "The severity of this log message." }, "logger": { "description": "An optional name of the logger issuing this message.", "type": "string" } }, "required": [ "data", "level" ], "type": "object" } }, "required": [ "method", "params" ], "type": "object" }, "ModelHint": { "description": "Hints to use for model selection.\n\nKeys not declared here are currently left unspecified by the spec and are up\nto the client to interpret.", "properties": { "name": { "description": "A hint for a model name.\n\nThe client SHOULD treat this as a substring of a model name; for example:\n - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022`\n - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc.\n - `claude` should match any Claude model\n\nThe client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example:\n - `gemini-1.5-flash` could match `claude-3-haiku-20240307`", "type": "string" } }, "type": "object" }, "ModelPreferences": { "description": "The server's preferences for model selection, requested of the client during sampling.\n\nBecause LLMs can vary along multiple dimensions, choosing the \"best\" model is\nrarely straightforward. Different models excel in different areas—some are\nfaster but less capable, others are more capable but more expensive, and so\non. This interface allows servers to express their priorities across multiple\ndimensions to help clients make an appropriate selection for their use case.\n\nThese preferences are always advisory. The client MAY ignore them. It is also\nup to the client to decide how to interpret these preferences and how to\nbalance them against other considerations.", "properties": { "costPriority": { "description": "How much to prioritize cost when selecting a model. A value of 0 means cost\nis not important, while a value of 1 means cost is the most important\nfactor.", "maximum": 1, "minimum": 0, "type": "number" }, "hints": { "description": "Optional hints to use for mo