Skip to main content
Glama
akave-ai

Akave MCP Server

by akave-ai

fetch_headers

Retrieve headers and metadata for a specific object stored in an S3-compatible bucket, providing essential information about the object's properties without downloading its content.

Instructions

Fetch headers/metadata for an object

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucketYesBucket name
keyYesObject key

Implementation Reference

  • The MCP tool handler for 'fetch_headers' which invokes the S3 client's fetchHeaders method and formats the response as MCP content.
    async ({ bucket, key }) => {
      const headers = await this.s3Client.fetchHeaders(bucket, key);
      return {
        content: [{ type: "text", text: JSON.stringify(headers) }],
      };
    }
  • Zod input schema defining the parameters for the 'fetch_headers' tool: bucket and key.
    {
      bucket: z.string().describe("Bucket name"),
      key: z.string().describe("Object key"),
    },
  • src/server.ts:196-209 (registration)
    Registration of the 'fetch_headers' MCP tool including name, description, schema, and handler function.
    this.server.tool(
      "fetch_headers",
      "Fetch headers/metadata for an object",
      {
        bucket: z.string().describe("Bucket name"),
        key: z.string().describe("Object key"),
      },
      async ({ bucket, key }) => {
        const headers = await this.s3Client.fetchHeaders(bucket, key);
        return {
          content: [{ type: "text", text: JSON.stringify(headers) }],
        };
      }
    );
  • Helper function in S3Client that performs a HeadObjectCommand to retrieve object metadata/headers.
    async fetchHeaders(bucket: string, key: string) {
      const command = new HeadObjectCommand({
        Bucket: bucket,
        Key: key,
      });
      return await this.client.send(command);
    }

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/akave-ai/akave-mcp'

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