MCP Tools Reference: storage.googleapis.com

Tool: read_object

Reads an object from Cloud Storage. Supports both text and binary content (it will output text for text content and binary for binary content).

Constraints & Behavior:

  • Size Limit: The maximum supported file size is 8MiB. Requests for larger objects will fail with an OutOfRange error.

The following sample demonstrates 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.

ReadBlobRequest

JSON representation
{
  "bucketName": string,
  "objectName": string,
  "contentType": string,
  "generation": string,
  "readOffset": string,
  "readLimit": 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 or image/png). See Media types. Only provide contentType if the object name or context strongly suggests a specific format. If unknown, leave this blank.

generation

string (int64 format)

Optional. The generation of the object to read. If omitted or set to 0, the latest generation is read.

readOffset

string (int64 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 (int64 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

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 will be 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. The presence of this field tells the client that the request is incomplete and that the client must try its request again with the result of these dependent requests in the dependent_responses field.

An object containing a list of "key": value pairs. 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. 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. The kind of value. kind can be only one of the following:
nullValue

null

Represents a JSON null.

numberValue

number

Represents a JSON number. Must not be NaN, Infinity or -Infinity, since those are not supported in JSON. This also cannot represent large Int64 values, since JSON format generally does not support them in its number type.

stringValue

string

Represents a JSON string.

boolValue

boolean

Represents a JSON boolean (true or false literal in JSON).

structValue

object (Struct format)

Represents a JSON object.

listValue

array (ListValue format)

Represents a JSON array.

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)

Exactly one of these fields must be populated. (Not using "oneof", since that causes 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. 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 will be present. (Not using "oneof", since that causes 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,
  "doubleRange": {
    object (DoubleRange)
  },
  "integerRange": {
    object (IntegerRange)
  }
}
Fields
title

string

description

string

minimum
(deprecated)

string

maximum
(deprecated)

string

doubleRange

object (DoubleRange)

Only one of these fields must be set.

integerRange

object (IntegerRange)

DoubleRange

JSON representation
{

  // Union field _minimum can be only one of the following:
  "minimum": number
  // End of list of possible types for union field _minimum.

  // Union field _maximum can be only one of the following:
  "maximum": number
  // End of list of possible types for union field _maximum.
}
Fields

Union field _minimum.

_minimum can be only one of the following:

minimum

number

Union field _maximum.

_maximum can be only one of the following:

maximum

number

IntegerRange

JSON representation
{

  // Union field _minimum can be only one of the following:
  "minimum": string
  // End of list of possible types for union field _minimum.

  // Union field _maximum can be only one of the following:
  "maximum": string
  // End of list of possible types for union field _maximum.
}
Fields

Union field _minimum.

_minimum can be only one of the following:

minimum

string (int64 format)

Union field _maximum.

_maximum can be only one of the following:

maximum

string (int64 format)

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
  ],
  "singleSelect": {
    object (SingleSelect)
  },
  "multiSelect": {
    object (MultiSelect)
  }
}
Fields
title

string

description

string

enumList[]

string

enumNames[]

string

singleSelect

object (SingleSelect)

No more than one of these must be set. If neither is set, we assume single_select with no default value.

multiSelect

object (MultiSelect)

SingleSelect

JSON representation
{

  // Union field _default_item can be only one of the following:
  "defaultItem": string
  // End of list of possible types for union field _default_item.
}
Fields

Union field _default_item.

_default_item can be only one of the following:

defaultItem

string

MultiSelect

JSON representation
{
  "defaultItems": [
    string
  ],

  // Union field _min_items can be only one of the following:
  "minItems": integer
  // End of list of possible types for union field _min_items.

  // Union field _max_items can be only one of the following:
  "maxItems": integer
  // End of list of possible types for union field _max_items.
}
Fields
defaultItems[]

string

Union field _min_items.

_min_items can be only one of the following:

minItems

integer (uint32 format)

Union field _max_items.

_max_items can be only one of the following:

maxItems

integer (uint32 format)

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. At least one will be populated if the tool does not define an output schema. If the tool does define an output schema, the structured_content field will be populated instead, but one of these fields can still be populated for backward compatibility.

No more than one of these fields must be populated. (Not using "oneof", since that causes 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

Exactly one of these fields must be populated. (Not using "oneof", since that causes 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.

NullValue

Represents a JSON null.

NullValue is a sentinel, using an enum with only one value to represent the null value for the Value type union.

A field of type NullValue with any value other than 0 is considered invalid. Most ProtoJSON serializers will emit a Value with a null_value set as a JSON null regardless of the integer value, and so will round trip to a 0 value.

Enums
NULL_VALUE Null value.

Role

Enums
ROLE_UNKNOWN
ROLE_USER
ROLE_ASSISTANT

IncludeContext

Enums
NONE
THIS_SERVER
ALL_SERVERS

Format

Enums
FORMAT_UNKNOWN
FORMAT_EMAIL
FORMAT_URI
FORMAT_DATE
FORMAT_DATE_TIME

Tool Annotations

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