curl --request POST \
--url https://api.example.com/api/resources/get \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"resource_id": "<string>",
"kwargs": {}
}
'import requests
url = "https://api.example.com/api/resources/get"
payload = {
"resource_id": "<string>",
"kwargs": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({resource_id: '<string>', kwargs: {}})
};
fetch('https://api.example.com/api/resources/get', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/resources/get",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resource_id' => '<string>',
'kwargs' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/resources/get"
payload := strings.NewReader("{\n \"resource_id\": \"<string>\",\n \"kwargs\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/resources/get")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"resource_id\": \"<string>\",\n \"kwargs\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/resources/get")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource_id\": \"<string>\",\n \"kwargs\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Load a stored resource by id, optionally rendering it
Load a stored resource by its id, optionally rendering it as a template.
Args:
resource_id: The id (path) of the resource to load.
kwargs: When omitted, the resource’s loaded content is returned
as-is. When provided (any dict, incl. {}), text is rendered as a
Jinja template with these variables; media raises loudly (400).
Returns:
The loaded (and optionally rendered) content — text or a MediaBlock.
A missing resource is a 404; a traversal-escaping id, a render of media, or
broken client-supplied Jinja is a 400. Genuine storage/transport failures
raise other types and propagate as a 500.
curl --request POST \
--url https://api.example.com/api/resources/get \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"resource_id": "<string>",
"kwargs": {}
}
'import requests
url = "https://api.example.com/api/resources/get"
payload = {
"resource_id": "<string>",
"kwargs": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({resource_id: '<string>', kwargs: {}})
};
fetch('https://api.example.com/api/resources/get', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/resources/get",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resource_id' => '<string>',
'kwargs' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/resources/get"
payload := strings.NewReader("{\n \"resource_id\": \"<string>\",\n \"kwargs\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/resources/get")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"resource_id\": \"<string>\",\n \"kwargs\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/resources/get")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource_id\": \"<string>\",\n \"kwargs\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
Body
Load a stored resource by resource_id, optionally rendering it.
When kwargs is omitted the loaded content is returned as-is (a
template/text resource as its text, a document as extracted text, media as a
MediaBlock). When provided (any object, including {}) the caller intends
a render: text is rendered as a Jinja template with these variables; media
cannot be rendered and is refused with a 400.
Response
Success.
The loaded resource body of get_resource_by_id (both the GET fetch and
the POST render route): the resource text, OR a media block. The fastmcp media
members (Image/Audio/File) are not pydantic-v2 JSON-schema-able, so
the media arm is described as its serialized JSON value (JsonValue) rather
than a media model.

