Skip to main content
Glama

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
NameRequiredDescriptionDefault
bucketYesThe name of the bucket containing the object
keyYesThe object key (full path) to retrieve
max_sizeNoMaximum content size to read in bytes (default: 10MB). Larger files will be truncated.

Implementation Reference

  • 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", }); }
  • 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", }); } );
  • 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; }
  • 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), }, ], }; }

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/zq940222/hybrid-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server