list-buckets
Retrieve all storage buckets from the Insforge backend platform to manage and organize your cloud storage resources.
Instructions
Lists all storage buckets
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/shared/tools.ts:729-760 (handler)The handler function for the 'list-buckets' tool. It makes a GET request to the storage buckets API endpoint, handles the response, and returns a formatted success message or error.withUsageTracking('list-buckets', async () => { try { const response = await fetch(`${API_BASE_URL}/api/storage/buckets`, { method: 'GET', headers: { 'x-api-key': getApiKey(), }, }); const result = await handleApiResponse(response); return await addBackgroundContext({ content: [ { type: 'text', text: formatSuccessMessage('Buckets retrieved', result), }, ], }); } catch (error) { const errMsg = error instanceof Error ? error.message : 'Unknown error occurred'; return { content: [ { type: 'text', text: `Error listing buckets: ${errMsg}`, }, ], isError: true, }; } })
- src/shared/tools.ts:725-761 (registration)Registration of the 'list-buckets' tool on the MCP server, specifying name, description, empty input schema, and the wrapped handler function.server.tool( 'list-buckets', 'Lists all storage buckets', {}, withUsageTracking('list-buckets', async () => { try { const response = await fetch(`${API_BASE_URL}/api/storage/buckets`, { method: 'GET', headers: { 'x-api-key': getApiKey(), }, }); const result = await handleApiResponse(response); return await addBackgroundContext({ content: [ { type: 'text', text: formatSuccessMessage('Buckets retrieved', result), }, ], }); } catch (error) { const errMsg = error instanceof Error ? error.message : 'Unknown error occurred'; return { content: [ { type: 'text', text: `Error listing buckets: ${errMsg}`, }, ], isError: true, }; } }) );
- src/shared/tools.ts:728-728 (schema)Input schema for 'list-buckets' tool: empty object, indicating no parameters required.{},