Skip to main content
Glama

get_bucket_memories

Retrieve memories from a specified bucket on the Memory Box MCP Server, enabling pagination, result limits, and optional reference data inclusion for efficient information access.

Instructions

Get memories from a specific bucket

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucket_idYesThe bucket to retrieve memories from
include_reference_dataNoInclude reference data in response (default: false)
limitNoMaximum number of results to return (1-100, default: 10)
offsetNoNumber of results to skip for pagination (default: 0)

Implementation Reference

  • MCP tool handler for 'get_bucket_memories': validates bucket_id, calls MemoryBoxClient.getBucketMemories with options, formats and returns the list of memories from the bucket.
    case "get_bucket_memories": {
      const bucketId = String(request.params.arguments?.bucket_id || "");
    
      if (!bucketId) {
        throw new McpError(ErrorCode.InvalidParams, "Bucket ID is required");
      }
    
      const options = {
        limit: request.params.arguments?.limit ? Number(request.params.arguments.limit) : undefined,
        offset: request.params.arguments?.offset ? Number(request.params.arguments.offset) : undefined,
        includeReferenceData: Boolean(request.params.arguments?.include_reference_data || false)
      };
    
      // Get memories from the specified bucket
      const result = await memoryBoxClient.getBucketMemories(bucketId, options);
    
      // Format the results
      let responseText = `Memories in bucket "${bucketId}":\n\n`;
      
      if (result.items && result.items.length > 0) {
        result.items.forEach((memory: any, index: number) => {
          responseText += `${index + 1}. ${memory.text}\n\n`;
        });
      } else {
        responseText += "No memories found in this bucket.";
      }
    
      return {
        content: [{
          type: "text",
          text: responseText
        }]
      };
    }
  • Input schema for get_bucket_memories tool: requires bucket_id, optional limit (1-100), offset (>=0), include_reference_data (boolean).
    name: "get_bucket_memories",
    description: "Get memories from a specific bucket",
    inputSchema: {
      type: "object",
      properties: {
        bucket_id: {
          type: "string",
          description: "The bucket to retrieve memories from"
        },
        limit: {
          type: "integer",
          description: "Maximum number of results to return (1-100, default: 10)",
          minimum: 1,
          maximum: 100
        },
        offset: {
          type: "integer",
          description: "Number of results to skip for pagination (default: 0)",
          minimum: 0
        },
        include_reference_data: {
          type: "boolean",
          description: "Include reference data in response (default: false)"
        }
      },
      required: ["bucket_id"]
    }
  • MemoryBoxClient.getBucketMemories helper method: performs API GET request to /api/v2/memory with bucketId and optional pagination/reference params, handles errors.
    async getBucketMemories(
      bucketId: string,
      options?: {
        limit?: number;
        offset?: number;
        includeReferenceData?: boolean;
      }
    ): Promise<any> {
      try {
        const params: any = { bucketId };
        
        if (options) {
          if (options.limit !== undefined) params.limit = options.limit;
          if (options.offset !== undefined) params.offset = options.offset;
          if (options.includeReferenceData !== undefined) params.include_reference_data = options.includeReferenceData;
        }
    
        const response = await axios.get(
          `${this.baseUrl}/api/v2/memory`,
          {
            params,
            headers: {
              "Authorization": `Bearer ${this.token}`
            }
          }
        );
        return response.data;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new McpError(
            ErrorCode.InternalError,
            `Failed to get bucket memories: ${error.response?.data?.detail || error.message}`
          );
        }
        throw error;
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves memories but doesn't mention whether this is a read-only operation, if it requires authentication, any rate limits, error conditions, or the format of the returned memories. This leaves significant gaps in understanding how the tool behaves beyond its basic function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly. There's no wasted verbiage or structural complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for a tool with 4 parameters and no structured behavioral hints. It doesn't explain what 'memories' are in this context, how they're returned, or any operational constraints. For a retrieval tool in a system with multiple memory-related siblings, more context is needed to ensure proper use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting all four parameters (bucket_id, include_reference_data, limit, offset) with their purposes, types, defaults, and constraints. The description adds no additional parameter information beyond what's in the schema, so it meets the baseline for adequate but not enhanced semantic value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('memories from a specific bucket'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'get_all_memories' or 'search_memories', which would require more specificity about scope or filtering capabilities.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_all_memories' (which might retrieve memories across all buckets) or 'search_memories' (which might offer more flexible querying). There's no mention of prerequisites, such as needing an existing bucket, or exclusions for when other tools might be more appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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