Skip to main content
Glama

add_nodes

Expand knowledge graphs by adding multiple nodes with names, types, and associated metadata using this tool in the MemoryMesh MCP server.

Instructions

Add multiple new nodes in the knowledge graph

Input Schema

NameRequiredDescriptionDefault
nodesYesArray of nodes to add

Input Schema (JSON Schema)

{ "properties": { "nodes": { "description": "Array of nodes to add", "items": { "description": "Node to add", "properties": { "metadata": { "description": "An array of metadata contents associated with the node", "items": { "description": "Metadata item", "type": "string" }, "type": "array" }, "name": { "description": "The name of the node", "type": "string" }, "nodeType": { "description": "The type of the node", "type": "string" } }, "required": [ "name", "nodeType", "metadata" ], "type": "object" }, "type": "array" } }, "required": [ "nodes" ], "type": "object" }

Implementation Reference

  • The core handler logic for the 'add_nodes' tool within the GraphToolHandler's handleTool method. It extracts nodes from args, calls knowledgeGraphManager.addNodes, and returns a formatted success response with the added nodes.
    case "add_nodes": const addedNodes = await this.knowledgeGraphManager.addNodes(args.nodes); return formatToolResponse({ data: {nodes: addedNodes}, actionTaken: "Added nodes to knowledge graph" });
  • The input schema definition and tool metadata (name, description) for the 'add_nodes' tool, exported as part of graphTools.
    { name: "add_nodes", description: "Add multiple new nodes in the knowledge graph", inputSchema: { type: "object", properties: { nodes: { type: "array", description: "Array of nodes to add", items: { type: "object", description: "Node to add", properties: { name: {type: "string", description: "The name of the node"}, nodeType: {type: "string", description: "The type of the node"}, metadata: { type: "array", items: {type: "string", description: "Metadata item"}, description: "An array of metadata contents associated with the node" }, }, required: ["name", "nodeType", "metadata"], }, }, }, required: ["nodes"], }, },
  • Registration of the GraphToolHandler for graph manipulation tools including 'add_nodes' via regex matching in ToolHandlerFactory.getHandler.
    if (toolName.match(/^(add|update|delete)_(nodes|edges)$/)) { return this.graphHandler;
  • Registration of all static tools (including 'add_nodes') into the central tools Map during ToolsRegistry initialization.
    // Register static tools allStaticTools.forEach(tool => { this.tools.set(tool.name, tool); });

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