Skip to main content
Glama
BRO3886

Memory Custom

by BRO3886

create_relations

Establish connections between entities in a knowledge graph by defining relationships with active voice descriptions, enabling structured data organization and relationship mapping.

Instructions

Create multiple new relations between entities in the knowledge graph. Relations should be in active voice

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
relationsYes
memoryFilePathYesThe path to the memory file

Implementation Reference

  • The core handler function in KnowledgeGraphManager that executes the create_relations tool logic: loads the graph, filters out existing relations to avoid duplicates, appends new relations, saves the graph to the memory file, and returns the newly added relations.
    async createRelations(
      relations: Relation[],
      filepath: string
    ): Promise<Relation[]> {
      await this.setMemoryFilePath(filepath);
      const graph = await this.loadGraph();
      const newRelations = relations.filter(
        (r) =>
          !graph.relations.some(
            (existingRelation) =>
              existingRelation.from === r.from &&
              existingRelation.to === r.to &&
              existingRelation.relationType === r.relationType
          )
      );
      graph.relations.push(...newRelations);
      await this.saveGraph(graph);
      return newRelations;
    }
  • index.ts:362-398 (registration)
    Registers the create_relations tool in the list of available tools, including name, description, and input schema.
    {
      name: "create_relations",
      description:
        "Create multiple new relations between entities in the knowledge graph. Relations should be in active voice",
      inputSchema: {
        type: "object",
        properties: {
          relations: {
            type: "array",
            items: {
              type: "object",
              properties: {
                from: {
                  type: "string",
                  description:
                    "The name of the entity where the relation starts",
                },
                to: {
                  type: "string",
                  description:
                    "The name of the entity where the relation ends",
                },
                relationType: {
                  type: "string",
                  description: "The type of the relation",
                },
              },
              required: ["from", "to", "relationType"],
            },
          },
          memoryFilePath: {
            type: "string",
            description: "The path to the memory file",
          },
        },
        required: ["relations", "memoryFilePath"],
      },
  • The dispatch handler in the CallToolRequestSchema that invokes the KnowledgeGraphManager.createRelations method with parsed arguments and formats the response as MCP content.
    case "create_relations":
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              await knowledgeGraphManager.createRelations(
                args.relations as Relation[],
                args.memoryFilePath as string
              ),
              null,
              2
            ),
          },
        ],
      };
  • Input schema definition for validating the arguments to the create_relations tool: expects an array of relations (from, to, relationType) and memoryFilePath.
    inputSchema: {
      type: "object",
      properties: {
        relations: {
          type: "array",
          items: {
            type: "object",
            properties: {
              from: {
                type: "string",
                description:
                  "The name of the entity where the relation starts",
              },
              to: {
                type: "string",
                description:
                  "The name of the entity where the relation ends",
              },
              relationType: {
                type: "string",
                description: "The type of the relation",
              },
            },
            required: ["from", "to", "relationType"],
          },
        },
        memoryFilePath: {
          type: "string",
          description: "The path to the memory file",
        },
      },
      required: ["relations", "memoryFilePath"],
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool creates relations, implying a write operation, but doesn't cover permissions, side effects, error handling, or response format. The 'active voice' note is trivial and doesn't add meaningful behavioral insight, leaving significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. However, the 'active voice' note is somewhat redundant and doesn't add value, slightly detracting from perfect conciseness.

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 a mutation tool with no annotations, 50% schema coverage, and no output schema, the description is insufficient. It lacks details on behavioral traits, error cases, and return values, making it incomplete for safe and effective agent use in a knowledge graph context.

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 50%, with the 'relations' parameter well-documented but 'memoryFilePath' lacking context. The description doesn't add any parameter-specific details beyond what the schema provides, such as explaining the structure of relations or the purpose of the memory file. Since schema coverage is moderate, the baseline score of 3 is appropriate, as the description doesn't compensate for the coverage gap.

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 ('Create multiple new relations') and the resource ('between entities in the knowledge graph'), which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like 'delete_relations' or 'create_entities', and the 'active voice' note is stylistic rather than functional, so it doesn't reach the highest clarity level.

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' or 'delete_relations', nor does it mention prerequisites or context for usage. It's purely functional without any operational context, leaving the agent to infer usage scenarios.

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/BRO3886/mcp-memory-custom'

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