You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The server automatically matches URIs to templates
256
+
userID:=extractIDFromURI(request.Params.URI)
259
257
260
258
profile, err:=getUserProfile(userID) // Your DB/API call here
261
259
if err != nil {
262
260
returnnil, err
263
261
}
264
262
265
-
return []interface{}{
263
+
return []mcp.ResourceContents{
266
264
mcp.TextResourceContents{
267
-
ResourceContents: mcp.ResourceContents{
268
-
URI: fmt.Sprintf("users://%s/profile", userID),
269
-
MIMEType: "application/json",
270
-
},
271
-
Text: profile,
265
+
URI: request.Params.URI,
266
+
MIMEType: "application/json",
267
+
Text: profile,
272
268
},
273
269
}, nil
274
270
})
275
271
```
276
272
277
-
The examples are simple but demonstrate the core concepts. Resources can be much more sophisticated - serving multiple contents, using annotations, integrating with databases or external APIs, etc.
273
+
The examples are simple but demonstrate the core concepts. Resources can be much more sophisticated - serving multiple contents, integrating with databases or external APIs, etc.
0 commit comments