Skip to main content
Glama

create_memory_timeline

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; }

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