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]
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions returning a bucket based on conditions, but fails to specify key behaviors such as whether this is a read-only operation, what authentication is needed, if there are rate limits, or what the output format looks like. This leaves significant gaps in understanding how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise, but it is under-specified and lacks clarity. While it avoids unnecessary length, the sentence does not effectively communicate purpose or usage, making it inefficient rather than truly concise. It could be more front-loaded with specific information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a list operation with filtering), lack of annotations, and no output schema, the description is incomplete. It does not explain what is returned (e.g., bucket details, list format), authentication requirements, or error handling. This leaves the agent with insufficient context to use the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'prefix' parameter clearly documented in the schema. The description adds no additional meaning beyond what the schema provides—it vaguely refers to 'conditions' but does not elaborate on parameters. With high schema coverage, the baseline score of 3 is appropriate as the description does not compensate but also does not detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Return the Bucket you configured based on the conditions' is vague and tautological—it essentially restates the tool name 'list_buckets' without specifying what 'configured' means or what 'conditions' entail. It does not clearly distinguish this tool from sibling tools like 'list_objects' or 'live_streaming_list_buckets', leaving the purpose ambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. For example, it does not explain when to choose 'list_buckets' over 'list_objects' or 'live_streaming_list_buckets', nor does it mention any prerequisites or context for usage. The description lacks explicit or implied usage instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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