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 |
Required. The name of the bucket to list objects in. Format: {bucket_id} |
prefix |
Optional. The prefix to filter objects by. If not specified, all objects are matched. If |
recursive |
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 |
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 |
Optional. A page token, received from a previous When paginating, all other parameters provided to |
Output Schema
Response message for ListObjects.
ListObjectsResponse
| JSON representation |
|---|
{ "objectNames": [ string ], "prefixes": [ string ], "nextPageToken": string } |
| Fields | |
|---|---|
objectNames[] |
The list of objects, ordered lexicographically by name. At most 1000 objects are returned. |
prefixes[] |
Object name prefixes for objects that matched the listing request but were excluded from |
nextPageToken |
A token, which can be sent as |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌