Skip to main content
Glama

memory_export

Export memories from the DocuMCP server to JSON or CSV format for analysis or backup purposes.

Instructions

Export memories to JSON or CSV

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoExport formatjson
filterNoFilter memories to export

Implementation Reference

  • Input schema definition for the memory_export tool, specifying format (json/csv) and optional filters.
    {
      name: "memory_export",
      description: "Export memories to JSON or CSV",
      inputSchema: {
        type: "object",
        properties: {
          format: {
            type: "string",
            enum: ["json", "csv"],
            description: "Export format",
            default: "json",
          },
          filter: {
            type: "object",
            properties: {
              type: { type: "string" },
              projectId: { type: "string" },
              startDate: { type: "string", format: "date-time" },
              endDate: { type: "string", format: "date-time" },
            },
            description: "Filter memories to export",
          },
        },
      },
    },
  • Tool registration within the memoryTools array exported for MCP integration.
    {
      name: "memory_export",
      description: "Export memories to JSON or CSV",
      inputSchema: {
        type: "object",
        properties: {
          format: {
            type: "string",
            enum: ["json", "csv"],
            description: "Export format",
            default: "json",
          },
          filter: {
            type: "object",
            properties: {
              type: { type: "string" },
              projectId: { type: "string" },
              startDate: { type: "string", format: "date-time" },
              endDate: { type: "string", format: "date-time" },
            },
            description: "Filter memories to export",
          },
        },
      },
    },
  • Wrapper function for memory export that initializes the manager and calls its export method, matching the tool's simple interface.
    export async function exportMemories(
      format: "json" | "csv" = "json",
      projectId?: string,
    ): Promise<string> {
      const manager = await initializeMemory();
      return await manager.export(format, projectId);
    }
  • Core handler logic in MemoryManager.export that queries storage with optional projectId filter and generates JSON or CSV export string.
    async export(
      format: "json" | "csv" = "json",
      projectId?: string,
    ): Promise<string> {
      const filter = projectId ? { projectId } : {};
      const allMemories = await this.storage.query(filter);
    
      if (format === "json") {
        return JSON.stringify(allMemories, null, 2);
      } else {
        // CSV export
        const headers = [
          "id",
          "timestamp",
          "type",
          "projectId",
          "repository",
          "ssg",
        ];
        const rows = allMemories.map((m: any) => [
          m.id,
          m.timestamp,
          m.type,
          m.metadata?.projectId || "",
          m.metadata?.repository || "",
          m.metadata?.ssg || "",
        ]);
    
        return [headers, ...rows].map((r: any) => r.join(",")).join("\n");
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what the tool does, not how it behaves. It doesn't disclose whether this is a read-only operation, if it requires authentication, what happens to exported data, rate limits, or error conditions. The description is functional but lacks behavioral context.

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 with zero wasted words. It's front-loaded with the core functionality and uses clear, direct language. Every word earns its place in conveying the essential purpose.

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?

For a tool with 2 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'memories' are in this context, what the export output looks like, whether filtering is required, or any behavioral aspects. The agent would need to guess about important operational details.

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?

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description mentions 'JSON or CSV' which aligns with the 'format' enum, but adds no additional meaning beyond what's in the schema. This meets the baseline for high schema coverage.

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 ('Export') and resource ('memories') with specific output formats ('JSON or CSV'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'memory_export_advanced' or 'memory_migration', which likely have overlapping functionality.

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 'memory_export_advanced' or other memory-related tools. There's no mention of prerequisites, limitations, or typical use cases, leaving the agent to guess based on tool names alone.

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

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/tosin2013/documcp'

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