Skip to main content
Glama

create_memory_timeline

Read-onlyIdempotent

Generate chronological memory timelines by filtering and grouping events by date, category, or time period to visualize historical data.

Instructions

메모리 타임라인을 생성합니다.

키워드: 타임라인, 시간순, 히스토리, timeline, history, chronological

사용 예시:

  • "최근 메모리 타임라인 보여줘"

  • "지난 7일간 메모리 히스토리"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startDateNo시작 날짜 (ISO 형식, 예: 2024-01-01)
endDateNo종료 날짜 (ISO 형식)
categoryNo카테고리 필터
limitNo최대 결과 수 (기본값: 20)
groupByNo그룹화 기준

Implementation Reference

  • Main execution logic for the create_memory_timeline tool: processes args, fetches and filters memories using MemoryManager, groups them by time/category, formats a markdown timeline with stats, handles errors.
    export async function createMemoryTimeline(args: CreateMemoryTimelineArgs): Promise<ToolResult> {
      try {
        const {
          startDate,
          endDate,
          category,
          limit = 20,
          groupBy = 'day'
        } = args;
    
        const memoryManager = MemoryManager.getInstance();
        let memories = memoryManager.getTimeline(startDate, endDate, limit);
    
        // Filter by category if specified
        if (category) {
          memories = memories.filter(m => m.category === category);
        }
    
        if (memories.length === 0) {
          return {
            content: [{
              type: 'text',
              text: `✗ 지정된 기간에 메모리가 없습니다.
    
    ${startDate ? `**시작일**: ${startDate}` : ''}
    ${endDate ? `**종료일**: ${endDate}` : ''}
    ${category ? `**카테고리**: ${category}` : ''}`
            }]
          };
        }
    
        let output = '## 메모리 타임라인\n\n';
    
        // Add filter info
        if (startDate || endDate || category) {
          output += '**필터**:\n';
          if (startDate) output += `- 시작: ${startDate}\n`;
          if (endDate) output += `- 종료: ${endDate}\n`;
          if (category) output += `- 카테고리: ${category}\n`;
          output += '\n';
        }
    
        // Group memories
        const grouped = groupMemories(memories, groupBy);
    
        for (const [groupKey, groupMemories] of Object.entries(grouped)) {
          output += `### ${formatGroupKey(groupKey, groupBy)}\n\n`;
    
          for (const memory of groupMemories as any[]) {
            const time = formatTime(memory.timestamp);
            const priority = memory.priority ? `⭐${memory.priority}` : '';
            const preview = memory.value.length > 100
              ? memory.value.substring(0, 100) + '...'
              : memory.value;
    
            output += `**${time}** | \`${memory.key}\` ${priority}\n`;
            output += `> ${preview}\n\n`;
          }
        }
    
        // Statistics
        const stats = generateTimelineStats(memories);
        output += `---\n## 통계\n${stats}`;
    
        return {
          content: [{
            type: 'text',
            text: output
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `✗ 타임라인 생성 오류: ${error instanceof Error ? error.message : '알 수 없는 오류'}`
          }]
        };
      }
    }
  • ToolDefinition object defining the tool's name, description, input schema (startDate, endDate, category, limit, groupBy), and annotations.
    export const createMemoryTimelineDefinition: ToolDefinition = {
      name: 'create_memory_timeline',
      description: `메모리 타임라인을 생성합니다.
    
    키워드: 타임라인, 시간순, 히스토리, timeline, history, chronological
    
    사용 예시:
    - "최근 메모리 타임라인 보여줘"
    - "지난 7일간 메모리 히스토리"`,
      inputSchema: {
        type: 'object',
        properties: {
          startDate: {
            type: 'string',
            description: '시작 날짜 (ISO 형식, 예: 2024-01-01)'
          },
          endDate: {
            type: 'string',
            description: '종료 날짜 (ISO 형식)'
          },
          category: {
            type: 'string',
            description: '카테고리 필터'
          },
          limit: {
            type: 'number',
            description: '최대 결과 수 (기본값: 20)'
          },
          groupBy: {
            type: 'string',
            description: '그룹화 기준',
            enum: ['day', 'week', 'month', 'category']
          }
        }
      },
      annotations: {
        title: 'Create Memory Timeline',
        audience: ['user', 'assistant'],
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: false
      }
    };
  • src/index.ts:172-172 (registration)
    Maps the tool name to its handler function in the toolHandlers dispatch object used for dynamic tool execution.
    'create_memory_timeline': createMemoryTimeline,
  • src/index.ts:105-105 (registration)
    Adds the tool definition to the tools array returned by ListToolsRequestSchema.
    createMemoryTimelineDefinition,
  • Helper function to group memories by day, week, month, or category for timeline organization.
    function groupMemories(
      memories: any[],
      groupBy: 'day' | 'week' | 'month' | 'category'
    ): Record<string, any[]> {
      const grouped: Record<string, any[]> = {};
    
      for (const memory of memories) {
        let key: string;
    
        switch (groupBy) {
          case 'day':
            key = memory.timestamp.substring(0, 10); // YYYY-MM-DD
            break;
          case 'week':
            const date = new Date(memory.timestamp);
            const weekStart = new Date(date);
            weekStart.setDate(date.getDate() - date.getDay());
            key = weekStart.toISOString().substring(0, 10);
            break;
          case 'month':
            key = memory.timestamp.substring(0, 7); // YYYY-MM
            break;
          case 'category':
            key = memory.category;
            break;
          default:
            key = memory.timestamp.substring(0, 10);
        }
    
        if (!grouped[key]) {
          grouped[key] = [];
        }
        grouped[key].push(memory);
      }
    
      return grouped;
    }
Behavior3/5

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

Annotations provide comprehensive behavioral hints (readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false), so the description doesn't need to repeat these. However, the description adds useful context through the keywords ('타임라인, 시간순, 히스토리') and examples that suggest chronological organization of memory data. It doesn't describe rate limits, authentication needs, or specific behavioral traits beyond what annotations already cover.

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

Conciseness4/5

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

The description is appropriately sized with a clear purpose statement followed by keywords and usage examples. The structure is logical and front-loaded with the main purpose. The Korean/English keywords section could be more concise, but overall the description avoids unnecessary verbosity.

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

Completeness3/5

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

Given the comprehensive annotations (which cover safety and idempotency) and 100% schema description coverage, the description provides adequate context. However, with no output schema and multiple sibling memory tools, the description could better explain what distinguishes this tool's output format or use case. The examples help but don't fully address the complexity of having 5 parameters and no output documentation.

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%, with all 5 parameters well-documented in the schema itself. The description adds no parameter-specific information beyond what's already in the schema. The usage examples imply date range usage but don't provide additional semantic context about parameters. With complete schema coverage, the baseline of 3 is appropriate.

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

Purpose3/5

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

The description states '메모리 타임라인을 생성합니다' (creates a memory timeline) which provides a basic verb+resource, but it's vague about what a 'memory timeline' actually is. It doesn't distinguish this tool from sibling memory tools like 'list_memories', 'search_memories_advanced', or 'get_memory_graph'. The keywords section adds some context but doesn't clarify the tool's specific purpose.

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 usage examples ('최근 메모리 타임라인 보여줘', '지난 7일간 메모리 히스토리') which imply this tool is for viewing historical memory data, but it doesn't explicitly state when to use this tool versus alternatives like 'list_memories' or 'search_memories_advanced'. No guidance is given about prerequisites, constraints, or when not to use this tool.

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/su-record/hi-ai'

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