## 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 |
|---|
| ```bash 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` | `string` Required. Cloud Storage bucket name. |
| `objectName` | `string` Required. |
| `generation` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. The generation of the object to read. If omitted or set to 0, the latest generation is read. |
| `readOffset` | `string (https://developers.google.com/discovery/v1/type-format format)` 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` | `string (https://developers.google.com/discovery/v1/type-format format)` 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 (`https://docs.cloud.google.com/storage/docs/reference/mcp/tools_list/read_text#Output.Schema.ContentRange`) } } ``` |

| Fields ||
|---|---|
| `bucketName` | `string` The name of the bucket containing the read object. |
| `objectName` | `string` The name of the read object. |
| `size` | `string (https://developers.google.com/discovery/v1/type-format format)` The size of the read object in bytes. |
| `content` | `string` The non-binary text content that was read. |
| `generation` | `string (https://developers.google.com/discovery/v1/type-format format)` The generation of the object that was read. |
| `contentRange` | ``object (`https://docs.cloud.google.com/storage/docs/reference/mcp/tools_list/read_text#Output.Schema.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` | `string (https://developers.google.com/discovery/v1/type-format format)` The start of the range of bytes to read. |
| `end` | `string (https://developers.google.com/discovery/v1/type-format format)` The end of the range of bytes to read. |
| `completeLength` | `string (https://developers.google.com/discovery/v1/type-format format)` The complete length of the object. |

### Tool Annotations

Destructive Hint: ❌ \| Idempotent Hint: ✅ \| Read Only Hint: ✅ \| Open World Hint: ❌