get_blob
Retrieve stored data from Walrus decentralized storage by providing the blob ID, enabling access to blockchain-verified content on the Sui network.
Instructions
Retrieve a blob from Walrus storage
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blobId | Yes | The blob ID to retrieve |
Implementation Reference
- src/index.ts:153-164 (handler)MCP tool handler for 'get_blob': parses arguments with GetBlobSchema and calls walrusClient.getBlob, returning the result as text contentcase 'get_blob': { const { blobId } = GetBlobSchema.parse(args); const result = await walrusClient.getBlob(blobId); return { content: [ { type: 'text', text: result, }, ], }; }
- src/index.ts:35-37 (schema)Zod input schema validation for the get_blob tool (requires blobId string)const GetBlobSchema = z.object({ blobId: z.string().describe('The blob ID to retrieve'), });
- src/index.ts:74-87 (registration)Tool registration descriptor for 'get_blob' in the ListTools response, defining name, description, and input schema{ name: 'get_blob', description: 'Retrieve a blob from Walrus storage', inputSchema: { type: 'object', properties: { blobId: { type: 'string', description: 'The blob ID to retrieve', }, }, required: ['blobId'], }, },
- src/walrus-client.ts:106-126 (helper)Core implementation of blob retrieval in WalrusClient: HTTP GET to aggregator, returns base64-encoded blob data with error handlingasync getBlob(blobId: string): Promise<string> { try { const response = await this.httpClient.get( `${this.config.aggregatorUrl}/v1/${blobId}`, { responseType: 'arraybuffer', } ); // Return as base64 encoded string return Buffer.from(response.data).toString('base64'); } catch (error) { if (axios.isAxiosError(error)) { if (error.response?.status === 404) { throw new Error(`Blob not found: ${blobId}`); } throw new Error(`Failed to retrieve blob: ${error.response?.data?.error || error.message}`); } throw new Error(`Failed to retrieve blob: ${error instanceof Error ? error.message : String(error)}`); } }