Resources Reference

MCP Resources for direct read-only access to snippets via URIs.

MCP Resources provide direct, read-only access to snippets via URI patterns. Resources are cacheable by MCP clients.

Available Resources

URIDescription
snippets://indexList all snippets (summaries)
snippets://{id}Full content of a specific snippet

snippets://index

Returns a JSON array of all snippet summaries, similar to list_snippets but without filtering options.

Request

{
  "method": "resources/read",
  "params": {
    "uri": "snippets://index"
  }
}

Response

{
  "contents": [
    {
      "uri": "snippets://index",
      "mimeType": "application/json",
      "text": "[{\"id\":\"abc123\",\"description\":\"String helpers #go\",\"tags\":[\"go\"],\"files\":[\"strings.go\"],\"public\":false,\"updated_at\":\"2025-01-15T10:00:00Z\"},{\"id\":\"def456\",\"description\":\"HTTP client #go #http\",\"tags\":[\"go\",\"http\"],\"files\":[\"client.go\"],\"public\":false,\"updated_at\":\"2025-01-14T08:00:00Z\"}]"
    }
  ]
}

snippets://{id}

Returns the full content of a specific snippet, including all file contents.

Request

{
  "method": "resources/read",
  "params": {
    "uri": "snippets://abc123"
  }
}

Response

{
  "contents": [
    {
      "uri": "snippets://abc123",
      "mimeType": "application/json",
      "text": "{\"id\":\"abc123\",\"description\":\"String helpers #go\",\"public\":false,\"files\":[{\"filename\":\"strings.go\",\"language\":\"Go\",\"content\":\"package strings\\n\\nfunc Reverse(s string) string {...}\",\"size\":256}],\"html_url\":\"https://gist.github.com/user/abc123\",\"created_at\":\"2025-01-10T08:00:00Z\",\"updated_at\":\"2025-01-15T10:00:00Z\"}"
    }
  ]
}

Resources vs Tools

AspectResourcesTools
AccessRead-onlyRead/write
CachingCacheable by clientsNot cached
FilteringNoneFull filter options
Use caseQuick access, embeddingInteractive operations

Use Resources when:

  • You need to embed snippet content in context
  • You want client-side caching
  • You’re reading without modification

Use Tools when:

  • You need to filter or search
  • You’re creating, updating, or deleting
  • You need pagination