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),
          },
        ],
      };
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: the tool retrieves content, handles text vs. binary files differently (plain text vs. base64), has a default max size (10MB), and truncates larger files. This covers important operational traits beyond basic functionality.

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

Conciseness5/5

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

The description is front-loaded with the core purpose and efficiently adds essential details in two sentences. Every sentence earns its place by conveying critical information (source, file handling, size limits) without redundancy or unnecessary elaboration.

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

Completeness4/5

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

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is largely complete. It covers purpose, behavior, and key constraints. However, it lacks details on error conditions, authentication needs, or rate limits, which could enhance completeness for a retrieval tool with no annotations.

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 (bucket, key, max_size) with their descriptions. The description adds value by explaining the default max size and truncation behavior for max_size, but does not provide additional meaning for bucket or key beyond what the schema states. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the specific action ('Retrieve the content'), target resource ('an object from the 'huawei_obs' source'), and distinguishes it from siblings like get_object_metadata (which retrieves metadata only) and list_objects (which lists objects rather than retrieving content). It precisely defines what the tool does.

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 by specifying the source ('huawei_obs') and default behavior for file types, but it does not explicitly state when to use this tool versus alternatives like get_object_metadata or search_objects. It provides some context but lacks explicit guidance on exclusions or comparisons with sibling tools.

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

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