add_metadata
Enhance knowledge graph nodes by adding metadata arrays, enabling enriched data organization and retrieval on the MemoryMesh MCP server.
Instructions
Add new metadata to existing nodes in the knowledge graph
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| metadata | Yes | Array of metadata to add |
Implementation Reference
- Executes the 'add_metadata' tool logic by invoking the knowledge graph manager's addMetadata method and formatting the successful response.case "add_metadata": const addResult = await this.knowledgeGraphManager.addMetadata(args.metadata); return formatToolResponse({ data: {metadata: addResult}, actionTaken: "Added metadata to nodes" });
- Defines the input schema for validating arguments to the 'add_metadata' tool, expecting an array of metadata objects with nodeName and contents.inputSchema: { type: "object", properties: { metadata: { type: "array", description: "Array of metadata to add", items: { type: "object", description: "Metadata to add", properties: { nodeName: {type: "string", description: "The name of the node to add the metadata to"}, contents: { type: "array", items: {type: "string", description: "Metadata content item"}, description: "An array of metadata contents to add" }, }, required: ["nodeName", "contents"], }, }, }, required: ["metadata"], },
- src/integration/tools/registry/staticTools.ts:223-249 (registration)Registers the 'add_metadata' tool in the metadataTools array, including name, description, and input schema.{ name: "add_metadata", description: "Add new metadata to existing nodes in the knowledge graph", inputSchema: { type: "object", properties: { metadata: { type: "array", description: "Array of metadata to add", items: { type: "object", description: "Metadata to add", properties: { nodeName: {type: "string", description: "The name of the node to add the metadata to"}, contents: { type: "array", items: {type: "string", description: "Metadata content item"}, description: "An array of metadata contents to add" }, }, required: ["nodeName", "contents"], }, }, }, required: ["metadata"], }, },
- src/integration/tools/handlers/ToolHandlerFactory.ts:49-50 (registration)Registers the handler mapping for 'add_metadata' tool by matching the tool name pattern to MetadataToolHandler.if (toolName.match(/^(add|delete)_metadata$/)) { return this.metadataHandler;