MCP tools reference: storage.googleapis.com

Tool: read_object

Reads a blob object from Cloud Storage.

Use this tool for binary files, such as images, PDFs, and zip archives.

This tool has the following constraints and behaviors:

  • Size limit: The maximum supported file size is 8MiB. Requests for larger objects will fail with an OutOfRange error.
  • Text or binary: For valid UTF-8 text files, use read_text instead, as it consumes fewer tokens.

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

Input schema

Request message for ReadObject.

ReadObjectRequest

JSON representation
 { 
 "bucketName" 
 : 
 string 
 , 
 "objectName" 
 : 
 string 
 , 
 "contentType" 
 : 
 string 
 } 
Fields
bucketName

string

Required. Cloud Storage bucket name.

objectName

string

Required. Cloud Storage object name.

contentType

string

Optional. The IANA media type of the object (for example, application/pdf , image/png ). Provide contentType only if the object name or context suggests a specific format.

Output schema

CallToolResponse

JSON representation
 { 
 "common" 
 : 
 { 
 object (  ResponseFields 
 
) 
 } 
 , 
 "content" 
 : 
 [ 
 { 
 object (  Content 
 
) 
 } 
 ] 
 , 
 "structuredContent" 
 : 
 { 
 object 
 } 
 , 
 "isError" 
 : 
 boolean 
 } 
Fields
common

object ( ResponseFields )

content[]

object ( Content )

structuredContent

object ( Struct format)

If the tool defines an output schema, this field is populated. Clients that support structured output should ignore the content field above if this field is set.

isError

boolean

Optional.

ResponseFields

JSON representation
 { 
 "instructions" 
 : 
 string 
 , 
 "metadata" 
 : 
 { 
 object 
 } 
 , 
 "dependentRequests" 
 : 
 { 
 string 
 : 
 { 
 object (  ServerInitiatedRequest 
 
) 
 } 
 , 
 ... 
 } 
 , 
 "resumeData" 
 : 
 { 
 object 
 } 
 } 
Fields
instructions

string

Optional. Sent only on the initial response on any RPC.

metadata

object ( Struct format)

Escape hatch for arbitrary side-channel data.

dependentRequests

map (key: string, value: object ( ServerInitiatedRequest ))

Dependent requests. This field indicates that the request is incomplete. The client must try its request again with the results of these dependent requests in the dependent_responses field.

An object containing a list of "key": value pairs. For example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .

resumeData

object ( Struct format)

State for the client to echo back in subsequent RPCs for the same persistent request.

Struct

JSON representation
 { 
 "fields" 
 : 
 { 
 string 
 : 
 value 
 , 
 ... 
 } 
 } 
Fields
fields

map (key: string, value: value ( Value format))

Unordered map of dynamically typed values.

An object containing a list of "key": value pairs. For example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .

FieldsEntry

JSON representation
 { 
 "key" 
 : 
 string 
 , 
 "value" 
 : 
 value 
 } 
Fields
key

string

value

value ( Value format)

Value

JSON representation
 { 
 // Union field kind 
can be only one of the following: 
 "nullValue" 
 : 
 null 
 , 
 "numberValue" 
 : 
 number 
 , 
 "stringValue" 
 : 
 string 
 , 
 "boolValue" 
 : 
 boolean 
 , 
 "structValue" 
 : 
 { 
 object 
 } 
 , 
 "listValue" 
 : 
 array 
 // End of list of possible types for union field kind 
. 
 } 
Fields
Union field kind . This field can be only one of the following values:
nullValue

null

Represents a null value.

numberValue

number

Represents a double value.

stringValue

string

Represents a string value.

boolValue

boolean

Represents a boolean value.

structValue

object ( Struct format)

Represents a structured value.

listValue

array ( ListValue format)

Represents a repeated Value .

ListValue

JSON representation
 { 
 "values" 
 : 
 [ 
 value 
 ] 
 } 
Fields
values[]

value ( Value format)

Repeated field of dynamically typed values.

DependentRequestsEntry

JSON representation
 { 
 "key" 
 : 
 string 
 , 
 "value" 
 : 
 { 
 object (  ServerInitiatedRequest 
 
) 
 } 
 } 
Fields
key

string

value

object ( ServerInitiatedRequest )

ServerInitiatedRequest

JSON representation
 { 
 "samplingCreateMessage" 
 : 
 { 
 object (  SamplingCreateMessageRequest 
 
) 
 } 
 , 
 "listRootsRequest" 
 : 
 { 
 object ( ListRootsRequest 
) 
 } 
 , 
 "notifyOnRootListUpdate" 
 : 
 boolean 
 , 
 "elicitRequest" 
 : 
 { 
 object (  ElicitRequest 
 
) 
 } 
 } 
Fields
samplingCreateMessage

object ( SamplingCreateMessageRequest )

Sampling, as per https://modelcontextprotocol.io/specification/2025-03-26/client/sampling .

listRootsRequest

object ( ListRootsRequest )

Root list request, as per https://modelcontextprotocol.io/specification/2025-03-26/client/roots .

notifyOnRootListUpdate

boolean

elicitRequest

object ( ElicitRequest )

Elicitations, as per https://modelcontextprotocol.io/specification/2025-06-18/client/elicitation .

SamplingCreateMessageRequest

JSON representation
 { 
 "messages" 
 : 
 [ 
 { 
 object (  SamplingMessage 
 
) 
 } 
 ] 
 , 
 "modelPreferences" 
 : 
 { 
 object (  ModelPreferences 
 
) 
 } 
 , 
 "systemPrompt" 
 : 
 string 
 , 
 "includeContext" 
 : 
 enum ( IncludeContext 
) 
 , 
 "temperature" 
 : 
 number 
 , 
 "maxTokens" 
 : 
 integer 
 , 
 "stopSequence" 
 : 
 [ 
 string 
 ] 
 } 
Fields
messages[]

object ( SamplingMessage )

modelPreferences

object ( ModelPreferences )

Optional.

systemPrompt

string

Optional.

includeContext

enum ( IncludeContext )

Optional.

temperature

number

Optional.

maxTokens

integer

Optional.

stopSequence[]

string

Optional.

SamplingMessage

JSON representation
 { 
 "role" 
 : 
 enum ( Role 
) 
 , 
 "text" 
 : 
 { 
 object (  TextContent 
 
) 
 } 
 , 
 "image" 
 : 
 { 
 object (  ImageContent 
 
) 
 } 
 , 
 "audio" 
 : 
 { 
 object (  AudioContent 
 
) 
 } 
 } 
Fields
role

enum ( Role )

Which role is sending the message.

text

object ( TextContent )

Populate exactly one of these fields. (This implementation avoids "oneof" to prevent forward-compatibility problems.)

image

object ( ImageContent )

audio

object ( AudioContent )

TextContent

JSON representation
 { 
 "text" 
 : 
 string 
 , 
 "annotations" 
 : 
 { 
 object (  Annotations 
 
) 
 } 
 } 
Fields
text

string

annotations

object ( Annotations )

Optional.

Annotations

JSON representation
 { 
 "audience" 
 : 
 [ 
 enum ( Role 
) 
 ] 
 , 
 "priority" 
 : 
 number 
 } 
Fields
audience[]

enum ( Role )

priority

number

Must be in range [0,1].

ImageContent

JSON representation
 { 
 "data" 
 : 
 string 
 , 
 "mimeType" 
 : 
 string 
 , 
 "annotations" 
 : 
 { 
 object (  Annotations 
 
) 
 } 
 } 
Fields
data

string ( bytes format)

A base64-encoded string.

mimeType

string

annotations

object ( Annotations )

Optional.

AudioContent

JSON representation
 { 
 "data" 
 : 
 string 
 , 
 "mimeType" 
 : 
 string 
 , 
 "annotations" 
 : 
 { 
 object (  Annotations 
 
) 
 } 
 } 
Fields
data

string ( bytes format)

A base64-encoded string.

mimeType

string

annotations

object ( Annotations )

Optional.

ModelPreferences

JSON representation
 { 
 "hints" 
 : 
 [ 
 { 
 object (  ModelHint 
 
) 
 } 
 ] 
 , 
 "intelligencePriority" 
 : 
 number 
 , 
 "speedPriority" 
 : 
 number 
 , 
 "costPriority" 
 : 
 number 
 } 
Fields
hints[]

object ( ModelHint )

intelligencePriority

number

speedPriority

number

costPriority

number

ModelHint

JSON representation
 { 
 "name" 
 : 
 string 
 } 
Fields
name

string

Optional.

ElicitRequest

JSON representation
 { 
 "message" 
 : 
 string 
 , 
 "requestedSchema" 
 : 
 { 
 string 
 : 
 { 
 object (  PrimitiveSchemaDefinition 
 
) 
 } 
 , 
 ... 
 } 
 , 
 "requiredFields" 
 : 
 [ 
 string 
 ] 
 } 
Fields
message

string

Message to present to user. Required.

requestedSchema

map (key: string, value: object ( PrimitiveSchemaDefinition ))

An object containing a list of "key": value pairs. For example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .

requiredFields[]

string

RequestedSchemaEntry

JSON representation
 { 
 "key" 
 : 
 string 
 , 
 "value" 
 : 
 { 
 object (  PrimitiveSchemaDefinition 
 
) 
 } 
 } 
Fields
key

string

value

object ( PrimitiveSchemaDefinition )

PrimitiveSchemaDefinition

JSON representation
 { 
 "stringSchema" 
 : 
 { 
 object (  StringSchema 
 
) 
 } 
 , 
 "numberSchema" 
 : 
 { 
 object (  NumberSchema 
 
) 
 } 
 , 
 "booleanSchema" 
 : 
 { 
 object (  BooleanSchema 
 
) 
 } 
 , 
 "enumSchema" 
 : 
 { 
 object (  EnumSchema 
 
) 
 } 
 } 
Fields
stringSchema

object ( StringSchema )

Exactly one of these fields is present. (This implementation avoids "oneof" to prevent forward-compatibility problems.)

numberSchema

object ( NumberSchema )

booleanSchema

object ( BooleanSchema )

enumSchema

object ( EnumSchema )

StringSchema

JSON representation
 { 
 "title" 
 : 
 string 
 , 
 "description" 
 : 
 string 
 , 
 "minLength" 
 : 
 string 
 , 
 "maxLength" 
 : 
 string 
 , 
 "format" 
 : 
 enum ( Format 
) 
 } 
Fields
title

string

description

string

minLength

string

maxLength

string

format

enum ( Format )

NumberSchema

JSON representation
 { 
 "title" 
 : 
 string 
 , 
 "description" 
 : 
 string 
 , 
 "minimum" 
 : 
 string 
 , 
 "maximum" 
 : 
 string 
 } 
Fields
title

string

description

string

minimum

string

maximum

string

BooleanSchema

JSON representation
 { 
 "title" 
 : 
 string 
 , 
 "description" 
 : 
 string 
 , 
 "default" 
 : 
 boolean 
 } 
Fields
title

string

description

string

default

boolean

EnumSchema

JSON representation
 { 
 "title" 
 : 
 string 
 , 
 "description" 
 : 
 string 
 , 
 "enumList" 
 : 
 [ 
 string 
 ] 
 , 
 "enumNames" 
 : 
 [ 
 string 
 ] 
 } 
Fields
title

string

description

string

enumList[]

string

enumNames[]

string

Content

JSON representation
 { 
 "text" 
 : 
 { 
 object (  TextContent 
 
) 
 } 
 , 
 "image" 
 : 
 { 
 object (  ImageContent 
 
) 
 } 
 , 
 "audio" 
 : 
 { 
 object (  AudioContent 
 
) 
 } 
 , 
 "embeddedResource" 
 : 
 { 
 object (  EmbeddedResource 
 
) 
 } 
 , 
 "resourceLink" 
 : 
 { 
 object (  Resource 
 
) 
 } 
 } 
Fields
text

object ( TextContent )

Unstructured result contents. If the tool does not define an output schema, at least one of these fields is populated. If the tool defines an output schema, the structured_content field is populated instead. One of these fields might still be populated for backward compatibility.

Populate no more than one of these fields. (This implementation avoids "oneof" to prevent forward-compatibility problems.)

image

object ( ImageContent )

audio

object ( AudioContent )

embeddedResource

object ( EmbeddedResource )

resourceLink

object ( Resource )

EmbeddedResource

JSON representation
 { 
 "contents" 
 : 
 { 
 object (  ResourceContents 
 
) 
 } 
 , 
 "annotations" 
 : 
 { 
 object (  Annotations 
 
) 
 } 
 } 
Fields
contents

object ( ResourceContents )

annotations

object ( Annotations )

Optional.

ResourceContents

JSON representation
 { 
 "uri" 
 : 
 string 
 , 
 "mimeType" 
 : 
 string 
 , 
 "text" 
 : 
 string 
 , 
 "blob" 
 : 
 string 
 } 
Fields
uri

string

mimeType

string

text

string

Populate exactly one of these fields. (This implementation avoids "oneof" to prevent forward-compatibility problems.)

blob

string ( bytes format)

A base64-encoded string.

Resource

JSON representation
 { 
 "uri" 
 : 
 string 
 , 
 "name" 
 : 
 string 
 , 
 "title" 
 : 
 string 
 , 
 "description" 
 : 
 string 
 , 
 "mimeType" 
 : 
 string 
 , 
 "annotations" 
 : 
 { 
 object (  Annotations 
 
) 
 } 
 , 
 "size" 
 : 
 string 
 } 
Fields
uri

string

name

string

title

string

description

string

Optional.

mimeType

string

Optional.

annotations

object ( Annotations )

Optional.

size

string

Optional.

Tool Annotations

Destructive hint: ❌ | Idempotent hint: ✅ | Read-only hint: ✅ | Open-world hint: ❌

Create a Mobile Website
View Site in Mobile | Classic
Share by: