Skip to main content
Glama

get_blob_info

Retrieve blob information including size and availability status from the Walrus decentralized storage network using a blob ID.

Instructions

Get information about a blob (size, availability, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blobIdYesThe blob ID to get information about

Implementation Reference

  • MCP tool handler for 'get_blob_info': parses input using schema, calls walrusClient.getBlobInfo, and returns JSON stringified result.
    case 'get_blob_info': {
      const { blobId } = GetBlobInfoSchema.parse(args);
      const result = await walrusClient.getBlobInfo(blobId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Zod schema for validating input arguments to get_blob_info tool (blobId: string).
    const GetBlobInfoSchema = z.object({
      blobId: z.string().describe('The blob ID to get information about'),
    });
  • src/index.ts:116-129 (registration)
    Registration of 'get_blob_info' tool in the ListTools response, including name, description, and input schema.
    {
      name: 'get_blob_info',
      description: 'Get information about a blob (size, availability, etc.)',
      inputSchema: {
        type: 'object',
        properties: {
          blobId: {
            type: 'string',
            description: 'The blob ID to get information about',
          },
        },
        required: ['blobId'],
      },
    },
  • Core implementation of getBlobInfo: performs HEAD request to aggregator to get blob metadata like size, assumes certified if accessible.
    async getBlobInfo(blobId: string): Promise<BlobInfo> {
      try {
        // Try to get blob head information
        const response = await this.httpClient.head(`${this.config.aggregatorUrl}/v1/${blobId}`);
        
        const size = parseInt(response.headers['content-length'] || '0');
        
        return {
          blobId,
          size,
          encodedSize: size, // Approximate, actual encoded size may differ
          storageId: blobId,
          certified: true, // If we can access it, it's certified
        };
      } catch (error) {
        if (axios.isAxiosError(error)) {
          if (error.response?.status === 404) {
            throw new Error(`Blob not found: ${blobId}`);
          }
          throw new Error(`Failed to get blob info: ${error.response?.data?.error || error.message}`);
        }
        throw new Error(`Failed to get blob info: ${error instanceof Error ? error.message : String(error)}`);
      }
    }

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/Mr-Sunglasses/walrus-mcp'

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