Tool: read_text
DEPRECATED: Use read_object instead. Reads non-binary text content from an object.
The following sample demonstrates how to use curl to invoke the read_text MCP tool.
| Curl Request |
|---|
curl --location 'https://storage.googleapis.com/storage/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "read_text", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request message for ReadText.
ReadTextRequest
| JSON representation |
|---|
{ "bucketName": string, "objectName": string, "generation": string, "readOffset": string, "readLimit": string } |
| Fields | |
|---|---|
bucketName |
Required. Cloud Storage bucket name. |
objectName |
Required. |
generation |
Optional. The generation of the object to read. If omitted or set to 0, the latest generation is read. |
readOffset |
Optional. The offset from the beginning of the object at which the data should be read. If not specified, the read starts from the beginning of the object. Negative values are allowed and are interpreted as an offset from the end of the object. |
readLimit |
Optional. The maximum number of bytes to read. If not specified, the read starts from the beginning of the object and continues until the end of the object. Zero means no limit. Negative values are not allowed. |
Output Schema
Response message for ReadText.
ReadTextResponse
| JSON representation |
|---|
{
"bucketName": string,
"objectName": string,
"size": string,
"content": string,
"generation": string,
"contentRange": {
object ( |
| Fields | |
|---|---|
bucketName |
The name of the bucket containing the read object. |
objectName |
The name of the read object. |
size |
The size of the read object in bytes. |
content |
The non-binary text content that was read. |
generation |
The generation of the object that was read. |
contentRange |
The content range of the object that was read. If the request was not a range request, this field will not be set. |
ContentRange
| JSON representation |
|---|
{ "start": string, "end": string, "completeLength": string } |
| Fields | |
|---|---|
start |
The start of the range of bytes to read. |
end |
The end of the range of bytes to read. |
completeLength |
The complete length of the object. |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌