get_resource
Read one resource's full content and metadata by its uri (as shown by
list_resources). Text resources come back as plain text; binary ones
(images, PDFs, archives) come back base64-encoded — the content_encoding field tells you
which. Use it to inspect a resource before editing, or to copy it into a personal or team space
the credential can manage.
To search a large text resource without pulling all of it back, use
grep_resource instead.
You can read any resource you can see, including one from your organization's shared catalogue. A resource you can't see reads as not found — its existence is never revealed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
uri | string | Yes | The resource to fetch, by the uri list_resources shows. |
Response
| Field | Type | Description |
|---|---|---|
uri | string | The resource's address. |
name | string | The resource's label. |
path | string | The resource's path. |
content_type | string | Its MIME type. |
size_bytes | integer | Its size in bytes. |
version | integer | The current version — pass as expected_version to a guarded edit. |
content | string | The content, encoded as content_encoding says. |
content_encoding | string | utf8 for text resources, base64 for binary ones. |
Example
{
"uri": "apistash://me/docs/readme.md"
}
Result:
{
"uri": "apistash://me/docs/readme.md",
"name": "readme.md",
"path": "docs/readme.md",
"content_type": "text/markdown",
"size_bytes": 7,
"version": 1,
"content": "# Hello",
"content_encoding": "utf8"
}
Errors
Each failure carries a precise code in the response. A domain rejection — a not-found or a capability denial — is returned as a tool result with isError: true, so the agent can read the code and self-correct; malformed arguments and server faults are JSON-RPC protocol errors.
| Code | Cause | Delivered as |
|---|---|---|
resource_not_found | No such resource is visible to you — it doesn't exist or is out of scope. | tool error (isError) |
capability_denied | The credential lacks the Resources capability required for this read. | tool error (isError) |
invalid_arguments | The arguments are missing or don't match the input schema. | protocol error (invalid_params) |
internal_error | An unexpected error occurred. | protocol error (internal_error) |
Notes
- A successful response contains content, version, and metadata from the same revision.
If a concurrent update or deletion makes that revision unavailable during the read,
the call can fail with
internal_error; read again to obtain a fresh editing basis. - When replacing content with
update_resource, send the returnedversionas the requiredexpected_version. You can also pass it topatch_resourceto guard an edit against a change since this read. - To copy a catalogue resource, read it here, then use
create_resource. - Reading a resource counts as one tool call against your plan's tool-invocation allowance.