Skip to main content
Glama

update_nodes

Modify existing nodes in the MemoryMesh knowledge graph by updating node types, metadata, or other properties, ensuring accurate and dynamic data representation.

Instructions

Update existing nodes in the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodesYesArray of nodes to update

Implementation Reference

  • The tool handler case for 'update_nodes' that executes the update by delegating to knowledgeGraphManager.updateNodes and returns formatted response.
    case "update_nodes":
        const updatedNodes = await this.knowledgeGraphManager.updateNodes(args.nodes);
        return formatToolResponse({
            data: {nodes: updatedNodes},
            actionTaken: "Updated nodes in knowledge graph"
        });
  • Input schema defining the structure for update_nodes tool arguments: array of partial nodes with required 'name'.
    inputSchema: {
        type: "object",
        properties: {
            nodes: {
                type: "array",
                description: "Array of nodes to update",
                items: {
                    type: "object",
                    description: "Node to update",
                    properties: {
                        name: {type: "string", description: "The name of the node to update"},
                        nodeType: {type: "string", description: "The new type of the node"},
                        metadata: {
                            type: "array",
                            items: {type: "string", description: "Metadata item"},
                            description: "An array of new metadata contents for the node"
                        },
                    },
                    required: ["name"],
                },
            },
        },
        required: ["nodes"],
    },
  • Registers all static tools (including update_nodes) from allStaticTools into the central tools Map.
    // Register static tools
    allStaticTools.forEach(tool => {
        this.tools.set(tool.name, tool);
    });
  • Core helper function implementing node updates: validates, finds and merges partial node data into graph, persists changes.
    async updateNodes(nodes: Partial<Node>[]): Promise<Node[]> {
        try {
            this.emit('beforeUpdateNodes', {nodes});
    
            const graph = await this.storage.loadGraph();
            const updatedNodes: Node[] = [];
    
            for (const updateNode of nodes) {
                GraphValidator.validateNodeNameProperty(updateNode);
                const nodeIndex = graph.nodes.findIndex(n => n.name === updateNode.name);
    
                if (nodeIndex === -1) {
                    throw new Error(`Node not found: ${updateNode.name}`);
                }
    
                graph.nodes[nodeIndex] = {
                    ...graph.nodes[nodeIndex],
                    ...updateNode
                };
                updatedNodes.push(graph.nodes[nodeIndex]);
            }
    
            await this.storage.saveGraph(graph);
    
            this.emit('afterUpdateNodes', {nodes: updatedNodes});
            return updatedNodes;
        } catch (error) {
            const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
            throw new Error(errorMessage);
        }
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. 'Update existing nodes' implies a mutation operation, but it doesn't disclose important behavioral traits like required permissions, whether updates are partial or complete, what happens to unspecified fields, error handling, or side effects. The description is minimal and lacks critical operational context.

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 wasted words. It's front-loaded with the core purpose and appropriately sized for what it conveys, though it could benefit from additional context.

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 updating nodes in a knowledge graph, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what constitutes a valid update, how conflicts are handled, what the response contains, or error conditions. For a mutation tool with rich sibling alternatives, more context is needed.

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 single 'nodes' parameter and its nested structure. The description adds no additional parameter semantics beyond what's in the schema, which meets the baseline expectation when schema coverage is high. No compensation is needed or provided.

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 ('Update') and target resource ('existing nodes in the knowledge graph'), which is specific and unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'update_artifact' or 'update_edges', which update different resource types in the same system.

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. There are multiple 'update_' sibling tools for different resource types (e.g., update_artifact, update_edges), but the description doesn't mention any context, prerequisites, or exclusions for choosing this specific node-updating tool.

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/CheMiguel23/MemoryMesh'

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