get_buckets
Retrieve all available buckets from the Memory Box MCP Server to organize and access stored memories efficiently using meaning-based search capabilities.
Instructions
Retrieve a list of all available buckets
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1133-1166 (handler)MCP server tool call handler case for 'get_buckets'. Invokes the MemoryBoxClient.getBuckets() method and formats the list of buckets into a human-readable text response.case "get_buckets": { // Get all available buckets const result = await memoryBoxClient.getBuckets(); // Format the results let responseText = "Available buckets:\n\n"; if (result.items && result.items.length > 0) { result.items.forEach((bucket: any, index: number) => { responseText += `${index + 1}. ${bucket.name} (ID: ${bucket.id})`; // Add memory count if available if (bucket.memory_count !== undefined) { responseText += ` - ${bucket.memory_count} memories`; } // Add creation date if available if (bucket.created_at) { responseText += ` - Created: ${bucket.created_at}`; } responseText += "\n"; }); } else { responseText += "No buckets found."; } return { content: [{ type: "text", text: responseText }] }; }
- src/index.ts:60-80 (helper)Core helper method in MemoryBoxClient class that performs the HTTP GET request to the Memory Box API endpoint /api/v2/buckets to retrieve the list of available buckets, with proper error handling.async getBuckets(): Promise<any> { try { const response = await axios.get( `${this.baseUrl}/api/v2/buckets`, { headers: { "Authorization": `Bearer ${this.token}` } } ); return response.data; } catch (error) { if (axios.isAxiosError(error)) { throw new McpError( ErrorCode.InternalError, `Failed to get buckets: ${error.response?.data?.detail || error.message}` ); } throw error; } }
- src/index.ts:774-783 (registration)Tool registration entry in the ListTools response, defining the 'get_buckets' tool name, description, and input schema (no parameters required).{ name: "get_buckets", description: "Retrieve a list of all available buckets", inputSchema: { type: "object", properties: { // No specific parameters needed for this operation } } },
- src/index.ts:777-782 (schema)Input schema definition for the 'get_buckets' tool, specifying an empty object schema since no parameters are required.inputSchema: { type: "object", properties: { // No specific parameters needed for this operation } }