Skip to main content
Glama
T1nker-1220

Knowledge Graph Memory Server

create_entities

Add multiple new entities to a knowledge graph by specifying names, types, and associated observations for persistent memory storage.

Instructions

Create multiple new entities in the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entitiesYes

Implementation Reference

  • Core handler function in KnowledgeGraphManager that creates new entities: loads graph, filters duplicates by name, appends new entities, saves graph, returns 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;
  • Input schema definition for the create_entities tool, specifying structure for array of entities with required fields: name, entityType, 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"],
    },
  • TypeScript interface defining the Entity structure used by create_entities.
    interface Entity {
      name: string;
      entityType: string;
      observations: string[];
      metadata?: Metadata;  // Making metadata optional for backward compatibility
    }
  • index.ts:926-951 (registration)
    Tool registration in the ListTools response, defining name, description, and input 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"],
      },
    },
  • Dispatcher case in CallToolRequestSchema handler that invokes the createEntities method and formats JSON response.
    case "create_entities":
      return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.createEntities(args.entities as Entity[]), null, 2) }] };

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