Skip to main content
Glama
T1nker-1220

Knowledge Graph Memory Server

create_entities

Add multiple entities to a knowledge graph by specifying names, types, and associated observations, enabling structured data storage for improved memory and learning capabilities.

Instructions

Create multiple new entities in the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entitiesYes

Implementation Reference

  • The main handler function in KnowledgeGraphManager that implements the create_entities tool logic: loads the graph, filters out existing entities by name, appends new ones, saves the graph, and returns the 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; }
  • The input schema for the create_entities tool, specifying an object with an 'entities' array, each entity requiring 'name', 'entityType', and 'observations'.
    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"], },
  • index.ts:926-951 (registration)
    Registration of the create_entities tool in the ListToolsRequestSchema handler, including name, description, and schema.
    { 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"], }, },
  • index.ts:1223-1224 (registration)
    Dispatch handler in the CallToolRequestSchema switch statement that invokes the createEntities method with tool arguments 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/T1nker-1220/memories-with-lessons-mcp-server'

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