tos_list_buckets
List all available storage buckets in Volcengine TOS object storage service for bucket management and organization.
Instructions
列举 TOS 存储桶
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "tos_list_buckets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tos_mcp_server/handlers.py:39-52 (handler)The handler function that implements the tos_list_buckets tool. It calls tos_client.list_buckets() to retrieve all buckets and formats them as a JSON list with name, creation_date, and location.
async def list_buckets(_args: Dict[str, Any]) -> List[TextContent]: """列举存储桶""" try: resp = tos_client.list_buckets() buckets = [] for bucket in resp.buckets: buckets.append({ "name": bucket.name, "creation_date": str(bucket.creation_date) if bucket.creation_date else None, "location": bucket.location }) return [TextContent(type="text", text=json.dumps(buckets, indent=2, ensure_ascii=False))] except Exception as e: return [TextContent(type="text", text=f"列举存储桶失败: {str(e)}")] - src/tos_mcp_server/server.py:53-60 (registration)Tool registration in list_tools() function, defining the name, description, and input schema (empty properties) for tos_list_buckets.
Tool( name="tos_list_buckets", description="列举 TOS 存储桶", inputSchema={ "type": "object", "properties": {} } ), - src/tos_mcp_server/server.py:339-340 (registration)Dispatch logic in call_tool() that routes the tos_list_buckets tool call to the list_buckets handler function.
elif name == "tos_list_buckets": return await list_buckets(arguments) - src/tos_mcp_server/server.py:56-59 (schema)Input schema for the tos_list_buckets tool, which requires no parameters (empty properties).
inputSchema={ "type": "object", "properties": {} }