Skip to main content
Glama
itseasy21

Knowledge Graph Memory Server

update_entities

Modify multiple existing entities in the knowledge graph by updating their types and observation data to maintain accurate memory storage.

Instructions

Update multiple existing entities in the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entitiesYes

Implementation Reference

  • The handler function in KnowledgeGraphManager that loads the graph, updates specified entities by merging properties, increments version, updates the graph in place, saves it, and returns the updated entities.
    async updateEntities(entities: Entity[]): Promise<Entity[]> {
      const graph = await this.loadGraph();
      const updatedEntities = entities.map(updateEntity => {
        const existingEntity = graph.entities.find(e => e.name === updateEntity.name);
        if (!existingEntity) {
          throw new Error(`Entity with name ${updateEntity.name} not found`);
        }
        return {
          ...existingEntity,
          ...updateEntity,
          version: existingEntity.version + 1,
          createdAt: new Date().toISOString()
        };
      });
      
      // Update entities in the graph
      updatedEntities.forEach(updatedEntity => {
        const index = graph.entities.findIndex(e => e.name === updatedEntity.name);
        if (index !== -1) {
          graph.entities[index] = updatedEntity;
        }
      });
      
      await this.saveGraph(graph);
      return updatedEntities;
    }
  • index.ts:454-479 (registration)
    Tool registration in the ListTools response, defining name, description, and input schema for update_entities.
    {
      name: "update_entities",
      description: "Update multiple existing 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 to update" },
                entityType: { type: "string", description: "The updated type of the entity" },
                observations: {
                  type: "array",
                  items: { type: "string" },
                  description: "The updated array of observation contents"
                },
              },
              required: ["name"],
            },
          },
        },
        required: ["entities"],
      },
    },
  • Dispatcher case in CallToolRequest handler that calls the updateEntities method on the manager instance with parsed arguments and returns JSON stringified result.
    case "update_entities":
      return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.updateEntities(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 mentions 'update' which implies mutation, but fails to detail critical aspects such as required permissions, whether updates are atomic or batch, error handling for invalid entities, or impact on existing data. This leaves significant gaps in understanding the tool's behavior.

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 no wasted words, making it easy to parse. It front-loads the key action ('update') and resource, though it could benefit from more detail given the tool's complexity.

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 mutation nature, lack of annotations, no output schema, and 0% schema description coverage, the description is incomplete. It doesn't address return values, error cases, or behavioral nuances, making it inadequate for safe and effective use by an AI agent in this context.

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?

The schema description coverage is 0%, so the description must compensate for undocumented parameters. It only mentions 'entities' broadly without explaining the structure (e.g., 'name', 'entityType', 'observations') or their roles in updates. This adds minimal value beyond the schema, failing to clarify parameter meanings effectively.

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 verb ('update') and resource ('multiple existing entities in the knowledge graph'), making the purpose understandable. However, it doesn't distinguish this tool from its sibling 'update_relations' or specify what aspects of entities are updated (e.g., types, observations), leaving room for improvement in sibling differentiation.

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 'create_entities' for new entities or 'update_relations' for different graph components. It lacks context on prerequisites (e.g., entities must exist) or exclusions, offering minimal usage direction.

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/itseasy21/mcp-knowledge-graph'

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