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

Function ResourceNotFoundError

mcp/resource.go:42–48  ·  view source on GitHub ↗

ResourceNotFoundError returns an error indicating that a resource being read could not be found.

(uri string)

Source from the content-addressed store, hash-verified

40// ResourceNotFoundError returns an error indicating that a resource being read could
41// not be found.
42func ResourceNotFoundError(uri string) error {
43 return &jsonrpc.Error{
44 Code: CodeResourceNotFound,
45 Message: "Resource not found",
46 Data: json.RawMessage(fmt.Sprintf(`{"uri":%q}`, uri)),
47 }
48}
49
50// readFileResource reads from the filesystem at a URI relative to dirFilepath, respecting
51// the roots.

Callers 4

Example_resourcesFunction · 0.92
readResourceMethod · 0.85
TestServerErrorsFunction · 0.85
readFileResourceFunction · 0.85

Calls

no outgoing calls

Tested by 2

Example_resourcesFunction · 0.74
TestServerErrorsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…