create_entities
Adds new knowledge graph entities with names, types, and observations to the remote memory server for collaborative data management.
Instructions
새로운 엔티티들을 생성합니다
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entities | Yes |
Implementation Reference
- src/index.ts:429-451 (handler)The main handler function for the 'create_entities' MCP tool. It delegates entity creation to the memory manager, optionally syncs to GitHub if autoPush is enabled, and returns a success response.private async handleCreateEntities(args: any) { this.memoryManager.createEntities(args.entities); // 자동 푸시가 활성화된 경우에만 동기화 if (this.autoPush) { // 더 의미있는 커밋 메시지로 자동 동기화 const entityNames = args.entities.map((e: any) => e.name).join(', '); const commitMessage = `feat: Add ${args.entities.length} entities (${entityNames})`; await this.syncWithMessage(commitMessage); } return { content: [{ type: 'text', text: JSON.stringify({ success: true, message: `Created ${args.entities.length} entities`, entities: args.entities.map((e: any) => e.name), }, null, 2), }], }; }
- src/index.ts:84-107 (registration)Tool registration metadata including name, description, and input schema for 'create_entities' in the ListTools response.name: 'create_entities', description: '새로운 엔티티들을 생성합니다', inputSchema: { type: 'object', properties: { entities: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, entityType: { type: 'string' }, observations: { type: 'array', items: { type: 'string' }, }, }, required: ['name', 'entityType', 'observations'], }, }, }, required: ['entities'], }, },
- src/index.ts:86-106 (schema)JSON Schema defining the input parameters for the 'create_entities' tool: an array of entities each with name, entityType, and observations.inputSchema: { type: 'object', properties: { entities: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, entityType: { type: 'string' }, observations: { type: 'array', items: { type: 'string' }, }, }, required: ['name', 'entityType', 'observations'], }, }, }, required: ['entities'], },
- src/memory-graph.ts:41-53 (helper)Core utility method in MemoryGraphManager that creates and stores new entities in the in-memory graph with timestamps.createEntities(entities: Omit<Entity, 'createdAt' | 'updatedAt'>[]): void { const now = new Date().toISOString(); entities.forEach(entity => { this.graph.entities.set(entity.name, { ...entity, createdAt: now, updatedAt: now, }); }); this.updateMetadata(); }