get_object_metadata
Retrieve metadata for Huawei OBS objects without downloading content. Get content type, size, last modified date, ETag, storage class, and custom metadata by specifying bucket and key.
Instructions
Get metadata for an object from the 'huawei_obs' source without downloading content. Returns content type, size, last modified date, ETag, storage class, and custom metadata.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucket | Yes | The name of the bucket containing the object | |
| key | Yes | The object key (full path) to get metadata for |
Implementation Reference
- src/server.ts:230-248 (registration)Registration of the 'get_object_metadata' tool using McpServer.tool(). Includes inline Zod schema for inputs (bucket, key) and the handler function which currently returns a placeholder TODO response. Registered per storage source with optional suffix.// get_object_metadata tool server.tool( `get_object_metadata${toolSuffix}`, `Get metadata for an object from the '${sourceId}' source without downloading content. Returns content type, size, last modified date, ETag, storage class, and custom metadata.`, { bucket: z.string().describe("The name of the bucket containing the object"), key: z.string().describe("The object key (full path) to get metadata for"), }, async (args) => { // TODO: Implement actual metadata retrieval with storage provider return createToolSuccessResponse({ message: `Metadata retrieval from '${sourceId}' not yet implemented`, bucket: args.bucket, key: args.key, source_id: sourceId, note: "Storage provider integration pending", }); } );
- src/types/config.ts:70-76 (schema)TypeScript interface GetObjectMetadataToolConfig defining the tool name and source for configuration purposes./** * Built-in storage tool configuration for get_object_metadata */ export interface GetObjectMetadataToolConfig { name: "get_object_metadata"; source: string; }
- src/types/config.ts:255-261 (helper)'get_object_metadata' listed as one of the built-in storage tools, used for validation and identification.export const BUILTIN_STORAGE_TOOLS = [ "list_buckets", "list_objects", "get_object", "get_object_metadata", "search_objects", ] as const;
- src/server.ts:238-247 (handler)The core handler function for executing the get_object_metadata tool logic. Currently unimplemented (TODO) and returns a mock error response with input arguments.async (args) => { // TODO: Implement actual metadata retrieval with storage provider return createToolSuccessResponse({ message: `Metadata retrieval from '${sourceId}' not yet implemented`, bucket: args.bucket, key: args.key, source_id: sourceId, note: "Storage provider integration pending", }); }