> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getmcp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Resource

> Retrieve a single resource by ID.

## Path Parameters

<ParamField path="server_id" type="string" required>
  The numeric ID of the server.
</ParamField>

<ParamField path="id" type="string" required>
  The numeric ID of the resource.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
       --url https://yoursite.com/wp-json/getmcp/v1/servers/1/resources/3 \
       --header 'Authorization: Bearer gmcp_your_api_key'
  ```

  ```python Python theme={null}
  import requests
  response = requests.get(
      "https://yoursite.com/wp-json/getmcp/v1/servers/1/resources/3",
      headers={"Authorization": "Bearer gmcp_your_api_key"}
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://yoursite.com/wp-json/getmcp/v1/servers/1/resources/3",
    {
      headers: { "Authorization": "Bearer gmcp_your_api_key" }
    }
  );
  const data = await response.json();
  ```

  ```php PHP theme={null}
  $response = wp_remote_get(
      "https://yoursite.com/wp-json/getmcp/v1/servers/1/resources/3",
      ["headers" => ["Authorization" => "Bearer gmcp_your_api_key"]]
  );
  $data = json_decode(wp_remote_retrieve_body($response), true);
  ```

  ```go Go theme={null}
  package main
  import (
  	"fmt"
  	"io"
  	"net/http"
  )

  func main() {
  	req, _ := http.NewRequest("GET", "https://yoursite.com/wp-json/getmcp/v1/servers/1/resources/3", nil)

  	client := &http.Client{}
  	resp, _ := client.Do(req)
  	defer resp.Body.Close()
  	data, _ := io.ReadAll(resp.Body)
  	fmt.Println(string(data))
  }
  ```

  ```java Java theme={null}
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;

  public class Main {
      public static void main(String[] args) throws Exception {
          HttpRequest request = HttpRequest.newBuilder()
              .uri(URI.create("https://yoursite.com/wp-json/getmcp/v1/servers/1/resources/3"))
              .GET()
              .build();

          HttpClient client = HttpClient.newHttpClient();
          HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
          System.out.println(response.body());
      }
  }
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'
  require 'uri'

  uri = URI('https://yoursite.com/wp-json/getmcp/v1/servers/1/resources/3')
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = uri.scheme == 'https'

  request = Net::HTTP::Get.new(uri)

  response = http.request(request)
  puts JSON.parse(response.body)
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": 3,
    "server_id": 1,
    "uri": "docs://tool-guide",
    "name": "Tool Usage Guide",
    "description": "Instructions for using weather tools effectively",
    "mime_type": "text/markdown",
    "data_source_type": "static",
    "data_source_config": {
      "content": "# Weather Tools Guide\n\nUse `get_weather` for current conditions..."
    },
    "template_uri": null,
    "server_uuid": "836995ae-1cff-41ec-823e-a4f07ccca3a0",
    "created_at": "2025-03-18T10:00:00Z",
    "updated_at": "2025-03-18T10:00:00Z"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "code": "getmcp_not_found",
    "message": "Resource not found.",
    "data": { "status": 404 }
  }
  ```
</ResponseExample>
