Skip to main content
Glama
qiniu

Qiniu MCP Server

Official
by qiniu

list_objects

List objects in Qiniu Cloud Storage buckets with pagination support. Use start_after parameter to continue listing from a specific key and prefix filtering to narrow results.

Instructions

List objects in Qiniu Cloud, list a part each time, you can set start_after to continue listing, when the number of listed objects is less than max_keys, it means that all files are listed. start_after can be the key of the last file in the previous listing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucketYesQiniu Cloud Storage bucket Name
max_keysNoSets the max number of keys returned, default: 20
prefixNoSpecify the prefix of the operation response key. Only keys that meet this prefix will be listed.
start_afterNostart_after is where you want Qiniu Cloud to start listing from. Qiniu Cloud starts listing after this specified key. start_after can be any key in the bucket.

Implementation Reference

  • The handler function that executes the list_objects tool logic, delegating to the storage service and formatting the response as TextContent.
    async def list_objects(self, **kwargs) -> list[types.TextContent]:
        objects = await self.storage.list_objects(**kwargs)
        return [types.TextContent(type="text", text=str(objects))]
  • The input schema and metadata definition for the list_objects tool, including parameters like bucket, max_keys, prefix, start_after.
        types.Tool(
            name="list_objects",
            description="List objects in Qiniu Cloud, list a part each time, you can set start_after to continue listing, when the number of listed objects is less than max_keys, it means that all files are listed. start_after can be the key of the last file in the previous listing.",
            inputSchema={
                "type": "object",
                "properties": {
                    "bucket": {
                        "type": "string",
                        "description": _BUCKET_DESC,
                    },
                    "max_keys": {
                        "type": "integer",
                        "description": "Sets the max number of keys returned, default: 20",
                    },
                    "prefix": {
                        "type": "string",
                        "description": "Specify the prefix of the operation response key. Only keys that meet this prefix will be listed.",
                    },
                    "start_after": {
                        "type": "string",
                        "description": "start_after is where you want Qiniu Cloud to start listing from. Qiniu Cloud starts listing after this specified key. start_after can be any key in the bucket.",
                    },
                },
                "required": ["bucket"],
            },
        )
    )
  • Registers the list_objects tool (via tool_impl.list_objects) 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,
            ]
        )
  • Invokes register_tools to register storage tools including list_objects during service initialization.
    def load(cfg: config.Config):
        storage = StorageService(cfg)
        register_tools(storage)
        register_resource_provider(storage)
  • Core implementation of list_objects in StorageService using aioboto3 S3 client to list objects in the specified bucket.
    async def list_objects(
            self, bucket: str, prefix: str = "", max_keys: int = 20, start_after: str = ""
    ) -> List[dict]:
        if self.config.buckets and bucket not in self.config.buckets:
            logger.warning(f"Bucket {bucket} not in configured bucket list")
            return []
    
        if isinstance(max_keys, str):
            max_keys = int(max_keys)
    
        if max_keys > 100:
            max_keys = 100
    
        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:
            response = await s3.list_objects_v2(
                Bucket=bucket,
                Prefix=prefix,
                MaxKeys=max_keys,
                StartAfter=start_after,
            )
            return response.get("Contents", [])
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: pagination behavior ('list a part each time'), continuation logic ('start_after to continue listing'), and completion detection ('when the number of listed objects is less than max_keys, it means that all files are listed'). However, it doesn't cover error conditions, rate limits, or authentication requirements.

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

Conciseness4/5

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

The description is appropriately sized at three sentences, front-loading the core purpose. Each sentence adds value: the first states the action, the second explains pagination and completion logic, and the third clarifies 'start_after'. There's no redundant information, though it could be slightly more structured.

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

Completeness3/5

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

Given no annotations and no output schema, the description provides adequate context for a read-only listing tool with pagination. It covers the main behavioral aspects but lacks details on return format, error handling, or authentication. For a tool with 4 parameters and complex pagination logic, it's minimally complete but leaves gaps an agent might need.

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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema—it mentions 'start_after' for continuation and implies 'max_keys' for pagination, but doesn't provide additional semantic context or usage examples that aren't already in the schema descriptions.

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

Purpose4/5

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

The description clearly states the verb ('List') and resource ('objects in Qiniu Cloud'), making the purpose unambiguous. It distinguishes itself from sibling tools like 'list_buckets' by specifying it lists objects within a bucket, but doesn't explicitly contrast with other object-related tools like 'get_object'.

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

Usage Guidelines3/5

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

The description implies usage for paginated listing with continuation via 'start_after', suggesting when to use it for large result sets. However, it doesn't provide explicit guidance on when to choose this tool over alternatives like 'get_object' or 'list_buckets', nor does it mention any prerequisites or exclusions.

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