Skip to main content
Glama
modelcontextprotocol

Knowledge Graph Memory Server

create_entities

Add multiple entities to the knowledge graph, specifying name, type, and associated observations, to enhance memory storage in the Knowledge Graph Memory Server.

Instructions

Create multiple new entities in the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entitiesYes

Implementation Reference

  • Registers the 'create_entities' MCP tool, defining input/output schemas (using EntitySchema) and a thin handler that delegates to KnowledgeGraphManager.createEntities.
    server.registerTool(
      "create_entities",
      {
        title: "Create Entities",
        description: "Create multiple new entities in the knowledge graph",
        inputSchema: {
          entities: z.array(EntitySchema)
        },
        outputSchema: {
          entities: z.array(EntitySchema)
        }
      },
      async ({ entities }) => {
        const result = await knowledgeGraphManager.createEntities(entities);
        return {
          content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
          structuredContent: { entities: result }
        };
      }
    );
  • Executes the core logic for creating entities: loads the knowledge graph from JSONL, filters out duplicates by name, appends new entities, saves back to file, 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;
    }
  • Zod schema for validating Entity objects used in the create_entities tool input and output.
    const EntitySchema = z.object({
      name: z.string().describe("The name of the entity"),
      entityType: z.string().describe("The type of the entity"),
      observations: z.array(z.string()).describe("An array of observation contents associated with the entity")
    });
  • TypeScript interface defining the structure of an Entity, used throughout the knowledge graph and tool.
    export interface Entity {
      name: string;
      entityType: string;
      observations: string[];
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool creates entities, implying a write/mutation operation, but doesn't cover critical aspects like permissions needed, whether creation is idempotent, error handling, or what happens on success/failure. This leaves significant gaps for safe and effective use.

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 with zero waste. It's front-loaded with the core purpose and appropriately sized for the tool's complexity, making it easy to parse quickly without unnecessary elaboration.

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 tool's complexity (a write operation with nested parameters), lack of annotations, 0% schema description coverage, and no output schema, the description is incomplete. It doesn't address behavioral traits, parameter details, or return values, leaving the agent with insufficient context for reliable invocation.

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

Parameters2/5

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

Schema description coverage is 0%, meaning the input schema provides no parameter descriptions. The description mentions 'multiple new entities' but doesn't explain the 'entities' parameter's structure, required fields (name, entityType, observations), or semantics. It adds minimal value beyond the schema's bare structure, failing to compensate for the coverage gap.

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') and resource ('multiple new entities 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 handle related but distinct operations in the same domain.

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. It doesn't mention prerequisites, when-not-to-use scenarios, or comparisons to siblings like 'add_observations' (which might add to existing entities) or 'create_relations' (which links entities). Usage is implied but not explicitly defined.

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

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/modelcontextprotocol/knowledge-graph-memory-server'

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