MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / DecodeMessage

Function DecodeMessage

jsonrpc/jsonrpc.go:39–41  ·  view source on GitHub ↗

DecodeMessage deserializes JSON-RPC wire format data into a Message. It returns either a Request or Response based on the message content.

(data []byte)

Source from the content-addressed store, hash-verified

37// DecodeMessage deserializes JSON-RPC wire format data into a Message.
38// It returns either a Request or Response based on the message content.
39func DecodeMessage(data []byte) (Message, error) {
40 return jsonrpc2.DecodeMessage(data)
41}
42
43// Standard JSON-RPC 2.0 error codes.
44// See https://www.jsonrpc.org/specification#error_object

Callers 5

handleJSONMethod · 0.92
processStreamMethod · 0.92
ServeHTTPMethod · 0.92
ReadMethod · 0.92

Calls 1

DecodeMessageFunction · 0.92

Tested by 2

ServeHTTPMethod · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…