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

Function NewCall

internal/jsonrpc2/messages.go:103–106  ·  view source on GitHub ↗

NewCall constructs a new Call message for the supplied ID, method and parameters.

(id ID, method string, params any)

Source from the content-addressed store, hash-verified

101// NewCall constructs a new Call message for the supplied ID, method and
102// parameters.
103func NewCall(id ID, method string, params any) (*Request, error) {
104 p, merr := marshalToRaw(params)
105 return &Request{ID: id, Method: method, Params: p}, merr
106}
107
108func (msg *Request) IsCall() bool { return msg.ID.IsValid() }
109

Callers 3

newCallFunction · 0.92
CallMethod · 0.85

Calls 1

marshalToRawFunction · 0.85

Tested by 2

newCallFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…