Skip to main content
Glama
yodakeisuke

Knowledge Graph Memory Server

by yodakeisuke

create_entities

Add multiple entities with names, types, and observations to the knowledge graph for persistent memory across chat interactions.

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, adds new ones if any, saves the graph, and returns the newly added entities.
    async createEntities(entities: Entity[]): Promise<Entity[]> {
      console.error(`[Debug] Creating entities:`, entities);
      const graph = await this.loadGraph();
      console.error(`[Debug] Current graph:`, graph);
      
      const newEntities = entities.filter(e => !graph.entities.some(existingEntity => existingEntity.name === e.name));
      console.error(`[Debug] New entities to add:`, newEntities);
      
      if (newEntities.length > 0) {
        graph.entities.push(...newEntities.map(e => ({
          name: e.name,
          entityType: e.entityType,
          observations: e.observations,
          subdomain: e.subdomain
        })));
        await this.saveGraph(graph);
      }
      
      console.error(`[Debug] Final graph:`, graph);
      return newEntities;
    }
  • Type definition for Entity, used as input type for create_entities.
    interface Entity {
      name: string;
      entityType: string;
      observations: string[];
      /** The loglass subdomain this knowledge belongs to. Optional for knowledge spanning multiple domains. */
      subdomain?: string;
    }
  • index.ts:360-389 (registration)
    Registration of the create_entities tool in the ListToolsRequestSchema response, including name, description, and inputSchema.
    {
      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" },
                subdomain: { 
                  type: "string", 
                  description: "The loglass subdomain this knowledge belongs to (e.g., 'allocation', 'report', 'accounts', 'plans', 'actual' etc.). Can be omitted if the knowledge spans multiple domains.",
                },
                observations: { 
                  type: "array", 
                  items: { type: "string" },
                  description: "An array of observation contents associated with the entity"
                },
              },
              required: ["name", "entityType", "observations"],
            },
          },
        },
        required: ["entities"],
      },
    },
  • Dispatch handler in the CallToolRequestSchema switch statement that invokes the createEntities method.
    case "create_entities":
      return createResponse(JSON.stringify(await knowledgeGraphManager.createEntities(args.entities as Entity[]), null, 2));
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool creates entities, implying a write operation, but doesn't cover permissions, idempotency, error handling, or what happens on partial failures (e.g., if some entities fail). This leaves significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a mutation tool with 1 parameter (an array of nested objects), no annotations, and no output schema, the description is insufficient. It doesn't explain return values, error cases, or behavioral nuances, leaving the agent with inadequate information for reliable use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions 'multiple new entities' which hints at the 'entities' array parameter, but schema description coverage is 0%, meaning all parameter details are undocumented. The description adds minimal value beyond the schema's structure, so it meets the baseline for moderate coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create multiple new entities') and the target resource ('in the knowledge graph'), which is specific and unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'create_relations' or 'add_observations', which would require a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'add_observations' or 'create_relations'. It lacks context about prerequisites, such as whether entities must exist before adding observations or relations, or when batch creation is preferred over individual operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/yodakeisuke/mcp-memory-domain-knowledge'

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