Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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
        }]
      };
    }
  • 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
        }
      }
    },
  • 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
      }
    }

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/amotivv/memory-box-mcp'

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