get_object
Retrieve object content from Huawei OBS storage, returning text as plain text and binary files as base64-encoded data with configurable size limits.
Instructions
Retrieve the content of an object from the 'huawei_obs' source. Text files are returned as plain text, binary files as base64. Default max size: 10MB
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 retrieve | |
| max_size | No | Maximum content size to read in bytes (default: 10MB). Larger files will be truncated. |
Implementation Reference
- src/server.ts:217-227 (handler)The handler function that executes the get_object tool logic. It is an inline anonymous async function that currently returns a placeholder TODO response including the input arguments.async (args) => { // TODO: Implement actual object retrieval with storage provider return createToolSuccessResponse({ message: `Object retrieval from '${sourceId}' not yet implemented`, bucket: args.bucket, key: args.key, max_size: args.max_size || 10485760, source_id: sourceId, note: "Storage provider integration pending", }); }
- src/server.ts:212-216 (schema)Zod schema defining the input parameters for the get_object tool: bucket (required string), key (required string), max_size (optional number).{ bucket: z.string().describe("The name of the bucket containing the object"), key: z.string().describe("The object key (full path) to retrieve"), max_size: z.number().optional().describe("Maximum content size to read in bytes (default: 10MB). Larger files will be truncated."), },
- src/server.ts:208-228 (registration)Registration of the get_object tool using server.tool(), including name, description, input schema, and handler function. Registered for each storage source with optional suffix.// get_object tool server.tool( `get_object${toolSuffix}`, `Retrieve the content of an object from the '${sourceId}' source. Text files are returned as plain text, binary files as base64. Default max size: 10MB`, { bucket: z.string().describe("The name of the bucket containing the object"), key: z.string().describe("The object key (full path) to retrieve"), max_size: z.number().optional().describe("Maximum content size to read in bytes (default: 10MB). Larger files will be truncated."), }, async (args) => { // TODO: Implement actual object retrieval with storage provider return createToolSuccessResponse({ message: `Object retrieval from '${sourceId}' not yet implemented`, bucket: args.bucket, key: args.key, max_size: args.max_size || 10485760, source_id: sourceId, note: "Storage provider integration pending", }); } );
- src/types/config.ts:61-68 (schema)TypeScript interface GetObjectToolConfig defining the configuration structure for the get_object tool.* Built-in storage tool configuration for get_object */ export interface GetObjectToolConfig { name: "get_object"; source: string; /** Maximum file size in bytes to read (for text files) */ max_size?: number; }
- src/server.ts:79-88 (helper)Helper function used by the get_object handler to format successful tool responses as MCP content blocks.function createToolSuccessResponse(data: any) { return { content: [ { type: "text" as const, text: JSON.stringify(data, null, 2), }, ], }; }