list_objects
Retrieve objects from Huawei OBS storage buckets with options for prefix filtering, hierarchical grouping, and paginated results.
Instructions
List objects in a bucket from the 'huawei_obs' source. Supports prefix filtering, delimiter for hierarchical listing, and pagination.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucket | Yes | The name of the bucket to list objects from | |
| prefix | No | Filter objects by key prefix (e.g., 'folder/subfolder/') | |
| delimiter | No | Character to use for grouping keys (e.g., '/' for folder-like listing) | |
| max_keys | No | Maximum number of objects to return (default: 1000) | |
| continuation_token | No | Token for pagination, returned from previous request |
Implementation Reference
- src/server.ts:192-205 (handler)The handler function for the 'list_objects' tool. It currently returns a placeholder response indicating that implementation is pending, echoing the input arguments.async (args) => { // TODO: Implement actual object listing with storage provider return createToolSuccessResponse({ message: `Object listing from '${sourceId}' not yet implemented`, bucket: args.bucket, filter: { prefix: args.prefix, delimiter: args.delimiter, max_keys: args.max_keys, }, source_id: sourceId, note: "Storage provider integration pending", }); }
- src/server.ts:185-191 (schema)Zod schema defining the input parameters for the list_objects tool: bucket (required), prefix, delimiter, max_keys, continuation_token (optional).{ bucket: z.string().describe("The name of the bucket to list objects from"), prefix: z.string().optional().describe("Filter objects by key prefix (e.g., 'folder/subfolder/')"), delimiter: z.string().optional().describe("Character to use for grouping keys (e.g., '/' for folder-like listing)"), max_keys: z.number().optional().describe("Maximum number of objects to return (default: 1000)"), continuation_token: z.string().optional().describe("Token for pagination, returned from previous request"), },
- src/server.ts:181-206 (registration)Registration of the 'list_objects' tool via server.tool() within the loop for each storage source. The tool name includes a suffix for non-default sources. Includes description, input schema, and handler.// list_objects tool server.tool( `list_objects${toolSuffix}`, `List objects in a bucket from the '${sourceId}' source. Supports prefix filtering, delimiter for hierarchical listing, and pagination.`, { bucket: z.string().describe("The name of the bucket to list objects from"), prefix: z.string().optional().describe("Filter objects by key prefix (e.g., 'folder/subfolder/')"), delimiter: z.string().optional().describe("Character to use for grouping keys (e.g., '/' for folder-like listing)"), max_keys: z.number().optional().describe("Maximum number of objects to return (default: 1000)"), continuation_token: z.string().optional().describe("Token for pagination, returned from previous request"), }, async (args) => { // TODO: Implement actual object listing with storage provider return createToolSuccessResponse({ message: `Object listing from '${sourceId}' not yet implemented`, bucket: args.bucket, filter: { prefix: args.prefix, delimiter: args.delimiter, max_keys: args.max_keys, }, source_id: sourceId, note: "Storage provider integration pending", }); } );
- src/types/config.ts:53-58 (schema)TypeScript interface for ListObjectsToolConfig used in configuration, specifying the tool name, source, and optional max_keys.export interface ListObjectsToolConfig { name: "list_objects"; source: string; /** Maximum objects to list per request */ max_keys?: number; }