MCP tools reference: storage.googleapis.com

Tool: list_objects

Lists the objects in a bucket.

The following example shows how to use curl to invoke the list_objects 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 
 } 
Fields
bucketName

string

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

prefix

string

Optional. The prefix used to filter objects. If you don't specify a prefix, the operation matches all objects. If recursive is false , the operation matches only objects at the same level as the prefix. For example, "documents" matches "documents.txt" but not "documents/my-file.txt" .

recursive

boolean

Optional. Specifies whether the list operation is recursive, which includes objects in subdirectories. If recursive is set to false (default), the operation lists only objects directly within the specified prefix.

Output schema

ListObjectsResponse

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

string

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

prefixes[]

string

Object name prefixes for objects that matched the listing request but were excluded from objectNames because the recursive parameter is false . Values in this list are object names up to and including the delimiter / . The duplicate entries are omitted from this list. The prefixes are ordered lexicographically. At most 1,000 prefixes are returned.

Tool Annotations

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

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