MCP Tools Reference: storage.googleapis.com

Tool: list_objects

Lists the objects in a bucket.

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

Input Schema

ListObjectsRequest

JSON representation
{
  "bucketName": string,
  "prefix": string,
  "recursive": boolean,
  "pageSize": integer,
  "pageToken": string
}
Fields
bucketName

string

Required. The name of the bucket to list objects in. Format: {bucket_id}

prefix

string

Optional. The prefix to filter objects by. If not specified, all objects are matched. If recursive is false, only objects at the same level as the prefix are matched. For instance, if recursive is false, "documents" will match "documents.txt" but not "documents/my-file.txt".

recursive

boolean

Optional. Indicates whether the list operation should be recursive, including objects in subdirectories. If false (default), only objects directly within the specified prefix are listed.

pageSize

integer

Optional. The maximum number of objects to return. The service can return fewer than this value.

If unspecified, at most 1000 objects will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

pageToken

string

Optional. A page token, received from a previous ListObjects call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to ListObjects must match the call that provided the page token (except pageSize, which can differ).

Output Schema

Response message for ListObjects.

ListObjectsResponse

JSON representation
{
  "objectNames": [
    string
  ],
  "prefixes": [
    string
  ],
  "nextPageToken": string
}
Fields
objectNames[]

string

The list of objects, ordered lexicographically by name. At most 1000 objects are returned.

prefixes[]

string

Object name prefixes for objects that matched the listing request but were excluded from objectNames because recursive is false. Values in this list are object names up to and including the delimiter /. Duplicate entries are omitted from this list. Ordered lexicographically. At most 1000 prefixes are returned.

nextPageToken

string

A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

Tool Annotations

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