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 |
|---|
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 |
Required. |
objectName |
Required. |
textContent |
Required. The text content to write. An empty string can be used to create a zero-byte object. |
contentType |
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 |
The name of the bucket containing the written object. |
objectName |
The name of the written object. |
generation |
The generation ID of the created object. |
sizeBytes |
The size of the object written in bytes. |
Tool Annotations
Destructive Hint: ✅ | Idempotent Hint: ✅ | Read Only Hint: ❌ | Open World Hint: ✅