JsonRpcMessages
Namespace: Vercel.AI.Mcp
public static class JsonRpcMessagesChecks JSON-RPC 2.0 requests, notifications, results, and errors.
Inheritance: object
Methods
Section titled “Methods”Parse(string)
Section titled “Parse(string)”public static JsonElement Parse(string text)Parses one JSON-RPC message. Prototype-pollution keys are rejected.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string |
Returns: JsonElement
Validate(JsonElement)
Section titled “Validate(JsonElement)”public static void Validate(JsonElement message)Throws AiSdkException when <code class=“paramref”>message</code> is not a JSON-RPC 2.0 message.
Parameters
| Name | Type | Description |
|---|---|---|
message |
JsonElement |
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product