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
MCP tool results only carry text today, so the previous base64-encoded
content was unusable by the LLM. Validate object bytes with utf8.Valid
and return plain-text content; non-UTF-8 objects surface as an
agent-fixable ErrBinaryContent error. TODO notes mark the spots to
revisit once MCP supports embedded resources.
A "cloud-storage-read-object" tool reads the content of a Cloud Storage object and returns it as a base64-encoded string, optionally constrained to a byte range.
6
+
A "cloud-storage-read-object" tool reads the UTF-8 text content of a Cloud Storage object, optionally constrained to a byte range.
7
7
---
8
8
9
9
## About
10
10
11
11
A `cloud-storage-read-object` tool fetches the bytes of a single
12
-
[Cloud Storage object][gcs-objects] and returns them base64-encoded so that
13
-
arbitrary binary content can be round-tripped through JSON safely.
12
+
[Cloud Storage object][gcs-objects] and returns them as plain UTF-8 text.
13
+
14
+
Only text objects are supported today: if the object bytes (or the requested
15
+
range) are not valid UTF-8 the tool returns an agent-fixable error. This is
16
+
because the MCP tool-result channel currently only carries text; binary
17
+
payloads will be supported once MCP can carry embedded resources.
14
18
15
19
Reads are capped at **8 MiB** per call to protect the server's memory and keep
16
20
LLM contexts manageable; objects or ranges larger than that are rejected with
17
21
an agent-fixable error. Use the optional `range` parameter to read a slice of
18
22
a larger object.
19
23
20
-
This tool is intended for small-to-medium textual or binary content an LLM can
21
-
process directly. For bulk downloads of large files to the local filesystem,
22
-
use `cloud-storage-download-object` (coming in a follow-up release).
24
+
This tool is intended for small-to-medium textual content an LLM can process
25
+
directly. For bulk downloads of large files to the local filesystem, use
26
+
`cloud-storage-download-object` (coming in a follow-up release).
0 commit comments