Skip to main content
Glama

create_entities

Add entities to a knowledge graph, inserting new entries and optionally attaching initial observations for data organization.

Instructions

Create entities in the knowledge graph. Inserts each entity if not exists and optionally seeds it with observations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entitiesYesArray of entities to create.

Implementation Reference

  • Core handler function that creates entities in the knowledge graph if they do not already exist, optionally adds observations, and returns the list of newly created entities.
    async createEntities(entities) {
        const created = [];
        for (const entity of entities) {
            const existingId = await this.#repository.getEntityId(entity.name);
            if (!existingId) {
                await this.#repository.createEntity(entity.name, entity.entityType);
                created.push(entity);
            }
            if (entity.observations?.length) {
                await this.addObservations([{ entityName: entity.name, contents: entity.observations }]);
            }
        }
        return created;
    }
  • Zod schema defining the input parameters for the create_entities tool: an array of entities each with name, entityType, and optional observations.
    {
        entities: z.array(z.object({
            name:         z.string().describe('Unique name of the entity.'),
            entityType:   z.string().describe('Type or category of the entity.'),
            observations: z.array(z.string()).optional()
                              .describe('Initial list of observations to attach to the entity.')
        })).describe('Array of entities to create.')
    },
  • src/server.js:44-65 (registration)
    Registers the 'create_entities' MCP tool with name, description, input schema using Zod, and async handler that delegates to KnowledgeGraphManager.createEntities and returns JSON response.
    this.tool(
        'create_entities',
        'Create entities in the knowledge graph. Inserts each entity if not exists and optionally seeds it with observations.',
        {
            entities: z.array(z.object({
                name:         z.string().describe('Unique name of the entity.'),
                entityType:   z.string().describe('Type or category of the entity.'),
                observations: z.array(z.string()).optional()
                                  .describe('Initial list of observations to attach to the entity.')
            })).describe('Array of entities to create.')
        },
        async ({ entities }) => ({
            content: [{
                type: 'text',
                text: JSON.stringify(
                    await this.#knowledgeGraphManager.createEntities(entities),
                    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 mentions 'inserts each entity if not exists' (idempotent behavior) and 'optionally seeds it with observations', which adds some context. However, it lacks critical details like permission requirements, rate limits, error handling, or what happens on duplicate entities—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 front-loads the core action ('Create entities in the knowledge graph') and adds useful behavioral context ('inserts each entity if not exists and optionally seeds it with observations'). Every word earns its place with zero waste.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It covers the basic purpose and idempotent behavior but omits critical details like response format, error conditions, side effects, or how it integrates with sibling tools. This leaves significant gaps for an AI agent to use it correctly.

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?

Schema description coverage is 100%, so the schema fully documents the 'entities' parameter and its nested properties. The description adds marginal value by hinting at optional observation seeding, but doesn't provide syntax or format details beyond what the schema already specifies. Baseline 3 is appropriate as the schema does the heavy lifting.

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 entities in the knowledge graph') and specifies the resource ('entities'), making the purpose immediately understandable. It distinguishes from siblings like 'add_observations' by focusing on entity creation rather than observation addition, though it doesn't explicitly contrast with all siblings like 'create_relations'.

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, compare with siblings like 'create_relations' for relationship creation, or indicate scenarios where this tool is preferred over others. 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

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/iAchilles/memento'

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