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

Function EncodeMessage

jsonrpc/jsonrpc.go:33–35  ·  view source on GitHub ↗

EncodeMessage serializes a JSON-RPC message to its wire format.

(msg Message)

Source from the content-addressed store, hash-verified

31
32// EncodeMessage serializes a JSON-RPC message to its wire format.
33func EncodeMessage(msg Message) ([]byte, error) {
34 return jsonrpc2.EncodeMessage(msg)
35}
36
37// DecodeMessage deserializes JSON-RPC wire format data into a Message.
38// It returns either a Request or Response based on the message content.

Callers 2

WriteMethod · 0.92
WriteMethod · 0.92

Calls 1

EncodeMessageFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…