## Tool: `write_text`

Writes text content to an object, overwriting any existing content.

The following sample demonstrates how to use `curl` to invoke the `write_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": "write_text", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' ``` |

## Input Schema

Request message for WriteText.

### WriteTextRequest

| JSON representation |
|---|
| ``` { "bucketName": string, "objectName": string, "textContent": string, "contentType": string } ``` |

| Fields ||
|---|---|
| `bucketName` | `string` Required. |
| `objectName` | `string` Required. |
| `textContent` | `string` Required. The text content to write. An empty string can be used to create a zero-byte object. |
| `contentType` | `string` Optional. The content type of the object (for example, "text/plain"). |

## Output Schema

Response message for WriteText.

### WriteTextResponse

| JSON representation |
|---|
| ``` { "bucketName": string, "objectName": string, "generation": string, "sizeBytes": string } ``` |

| Fields ||
|---|---|
| `bucketName` | `string` The name of the bucket containing the written object. |
| `objectName` | `string` The name of the written object. |
| `generation` | `string (https://developers.google.com/discovery/v1/type-format format)` The generation ID of the created object. |
| `sizeBytes` | `string (https://developers.google.com/discovery/v1/type-format format)` The size of the object written in bytes. |

### Tool Annotations

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