Skip to main content
Glama
qiniu

Qiniu MCP Server

Official
by qiniu

list_buckets

Retrieve configured storage buckets from Qiniu Cloud with optional prefix filtering to manage and organize cloud storage resources.

Instructions

Return the Bucket you configured based on the conditions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prefixNoBucket prefix. The listed Buckets will be filtered based on this prefix, and only those matching the prefix will be output.

Implementation Reference

  • MCP tool handler for 'list_buckets', including schema definition and execution logic that delegates to StorageService.list_buckets()
    @tools.tool_meta( types.Tool( name="list_buckets", description="Return the Bucket you configured based on the conditions.", inputSchema={ "type": "object", "properties": { "prefix": { "type": "string", "description": "Bucket prefix. The listed Buckets will be filtered based on this prefix, and only those matching the prefix will be output.", }, }, "required": [], }, ) ) async def list_buckets(self, **kwargs) -> list[types.TextContent]: buckets = await self.storage.list_buckets(**kwargs) return [types.TextContent(type="text", text=str(buckets))]
  • Registration of storage tools including list_buckets using tools.auto_register_tools()
    def register_tools(storage: StorageService): tool_impl = _ToolImpl(storage) tools.auto_register_tools( [ tool_impl.list_buckets, tool_impl.list_objects, tool_impl.get_object, tool_impl.upload_text_data, tool_impl.upload_local_file, tool_impl.get_object_url, ] )
  • Core implementation of list_buckets in StorageService using aioboto3 S3 client to list configured buckets, with prefix filtering.
    async def list_buckets(self, prefix: Optional[str] = None) -> List[dict]: if not self.config.buckets or len(self.config.buckets) == 0: return [] max_buckets = 50 async with self.s3_session.client( "s3", aws_access_key_id=self.config.access_key, aws_secret_access_key=self.config.secret_key, endpoint_url=self.config.endpoint_url, region_name=self.config.region_name, ) as s3: # If buckets are configured, only return those response = await s3.list_buckets() all_buckets = response.get("Buckets", []) configured_bucket_list = [ bucket for bucket in all_buckets if bucket["Name"] in self.config.buckets ] if prefix: configured_bucket_list = [ b for b in configured_bucket_list if b["Name"] > prefix ] return configured_bucket_list[:max_buckets]

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/qiniu/qiniu-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server