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
| Name | Required | Description | Default |
|---|---|---|---|
| blobId | Yes | The blob ID to get information about |
Implementation Reference
- src/index.ts:192-203 (handler)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), }, ], }; }
- src/index.ts:47-49 (schema)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'], }, },
- src/walrus-client.ts:128-151 (helper)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)}`); } }