s3_prefix_usage
Sum bytes and object counts per first-level sub-prefix in an S3 bucket to identify which folders consume space; read-only results are estimates when scans are partial.
Instructions
Sum bytes and object counts per first-level sub-prefix under prefix, scanning up to max_scan keys (default 10000); read-only. Use it to see which folders take space; use s3_largest_objects for individual files. Returns prefixes[] (prefix, bytes, count; objects directly under prefix are grouped under prefix itself), scanned, partial, continuation_token and next_result_offset when more than 1000 rows exist. partial:true means totals cover only the scanned keys; this is an estimate, not billing data.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"bucket": "<bucket>"
},
"name": "s3_prefix_usage"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucket | Yes | Bucket name, e.g. "backups". Must be inside the configured bucket scope. | |
| prefix | No | Parent prefix whose first-level sub-prefixes are summed, e.g. "backups/"; omit for the bucket root. | |
| max_scan | No | Maximum number of object keys to scan in this call; default 10000. Higher values give more complete results but take longer. | |
| result_offset | No | Row offset into the aggregated prefixes: pass next_result_offset from the previous response with the same prefix, max_scan and continuation_token; default 0. | |
| continuation_token | No | continuation_token from a previous partial result to scan the next batch of keys; omit to start at the beginning of prefix. |