Skip to main content
Glama

create_entities

Add multiple entities, including names, types, and associated observations, into a knowledge graph for persistent memory and reasoning across conversations in the MCP Memory Server.

Instructions

Create multiple new entities in the knowledge graph

Input Schema

NameRequiredDescriptionDefault
entitiesYes

Input Schema (JSON Schema)

{ "properties": { "entities": { "items": { "properties": { "entityType": { "description": "The type of the entity", "type": "string" }, "name": { "description": "The name of the entity", "type": "string" }, "observations": { "description": "An array of observation contents associated with the entity", "items": { "type": "string" }, "type": "array" } }, "required": [ "name", "entityType", "observations" ], "type": "object" }, "type": "array" } }, "required": [ "entities" ], "type": "object" }

Implementation Reference

  • The core handler function in KnowledgeGraphManager that executes the tool logic: loads the graph, filters out duplicate entities by name, appends new ones, saves the graph, and returns the newly created entities.
    async createEntities(entities: Entity[]): Promise<Entity[]> { const graph = await this.loadGraph(); const newEntities = entities.filter(e => !graph.entities.some(existingEntity => existingEntity.name === e.name)); graph.entities.push(...newEntities); await this.saveGraph(graph); return newEntities;
  • TypeScript interface defining the structure of an Entity, used as the type for inputs to createEntities.
    interface Entity { name: string; entityType: string; observations: string[]; }
  • src/index.ts:202-227 (registration)
    Tool registration in the listTools response, including name, description, and detailed inputSchema matching the Entity structure.
    { name: "create_entities", description: "Create multiple new entities in the knowledge graph", 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" }, }, required: ["name", "entityType", "observations"], }, }, }, required: ["entities"], }, },
  • Dispatch case in the CallToolRequestSchema handler that invokes the createEntities method and formats the response.
    case "create_entities": return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.createEntities(args.entities as Entity[]), null, 2) }] };

Other Tools

Related 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/StevenWangler/mcp-memory-server'

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