Skip to main content
Glama

localnest_memory_add_relation

Link two memory entries with a named relation to build a traversable knowledge graph. Use for connections like 'depends_on', 'contradicts', or 'supersedes'.

Instructions

Link two memory entries with a named relation. Use to build a traversable knowledge graph (e.g. "depends_on", "contradicts", "supersedes", "related").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_idYes
target_idYes
relation_typeNorelated
response_formatNojson

Implementation Reference

  • The handler function for the localnest_memory_add_relation tool, which calls the memory service to create the relation.
    async ({ source_id, target_id, relation_type }) => {
      const result = await memory.addRelation(source_id, target_id, relation_type);
      return normalizeRelationResult(result, { source_id, target_id, relation_type });
    }
  • Registration of the localnest_memory_add_relation tool in the memory store toolset.
    registerJsonTool(
      ['localnest_memory_add_relation'],
      {
        title: 'Memory Add Relation',
        description: 'Link two memory entries with a named relation. Use to build a traversable knowledge graph (e.g. "depends_on", "contradicts", "supersedes", "related").',
        inputSchema: {
          source_id: z.string().min(1),
          target_id: z.string().min(1),
          relation_type: z.string().min(1).max(60).default('related')
        },
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false
        }
      },
      async ({ source_id, target_id, relation_type }) => {
        const result = await memory.addRelation(source_id, target_id, relation_type);
        return normalizeRelationResult(result, { source_id, target_id, relation_type });
      }
    );

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/wmt-mobile/localnest'

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