create_entities
Creates new knowledge graph entities with names, types, and observations for remote memory storage and collaboration.
Instructions
새로운 엔티티들을 생성합니다
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entities | Yes |
Implementation Reference
- src/index.ts:429-451 (handler)The primary MCP tool handler for 'create_entities'. It calls memoryManager.createEntities with the input args.entities, optionally performs auto-sync push to GitHub if enabled, and returns a success response with details.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:86-106 (schema)Input schema definition for the 'create_entities' tool, specifying 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/index.ts:83-107 (registration)Tool registration in the ListTools response, including name, description, and full input schema.{ 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/memory-graph.ts:41-53 (helper)Core helper function in MemoryGraphManager that actually creates the entities in the in-memory graph, adding timestamps and updating metadata. Called by the MCP handler.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(); }
- src/index.ts:380-381 (registration)Dispatch registration in the CallToolRequestHandler switch statement that routes to the specific handler.case 'create_entities': return await this.handleCreateEntities(args);