create_entities
Add multiple entities to a knowledge graph memory system, specifying names, types, and associated observations for structured data organization.
Instructions
Create multiple new entities in your Memento MCP knowledge graph memory system
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entities | Yes |
Implementation Reference
- The handleCreateEntities function that executes the core logic of the 'create_entities' MCP tool. It calls knowledgeGraphManager.createEntities with the provided args.entities and returns the result formatted as MCP content.export async function handleCreateEntities( args: Record<string, unknown>, // eslint-disable-next-line @typescript-eslint/no-explicit-any knowledgeGraphManager: any ): Promise<{ content: Array<{ type: string; text: string }> }> { const result = await knowledgeGraphManager.createEntities(args.entities); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- The schema definition for the 'create_entities' tool, including inputSchema with properties for entities array, each requiring name, entityType, observations, and optional temporal fields.name: 'create_entities', description: 'Create multiple new entities in your Memento MCP knowledge graph memory system', inputSchema: { type: 'object', properties: { entities: { type: 'array', items: { type: 'object', properties: { name: { type: 'string', description: 'The name of the entity', }, entityType: { type: 'string', description: 'The type of the entity', }, observations: { type: 'array', items: { type: 'string', }, description: 'An array of observation contents associated with the entity', }, // Temporal fields - optional id: { type: 'string', description: 'Optional entity ID' }, version: { type: 'number', description: 'Optional entity version' }, createdAt: { type: 'number', description: 'Optional creation timestamp' }, updatedAt: { type: 'number', description: 'Optional update timestamp' }, validFrom: { type: 'number', description: 'Optional validity start timestamp' }, validTo: { type: 'number', description: 'Optional validity end timestamp' }, changedBy: { type: 'string', description: 'Optional user/system identifier' }, }, required: ['name', 'entityType', 'observations'], }, }, }, required: ['entities'], }, },
- src/server/handlers/callToolHandler.ts:38-39 (registration)The dispatch case in handleCallToolRequest that registers and routes 'create_entities' tool calls to the specific handleCreateEntities handler.case 'create_entities': return await toolHandlers.handleCreateEntities(args, knowledgeGraphManager);
- src/server/handlers/toolHandlers/index.ts:5-5 (registration)Re-exports the handleCreateEntities handler for use in tool dispatching.export { handleCreateEntities } from './createEntities.js';