Skip to main content
Glama

create_edge

Establish relationships between knowledge nodes in a shared graph for AI coding agents. Define connections like answers, solves, depends_on, or derived_from to link technical information.

Instructions

Create a relationship edge between two knowledge nodes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_idYesSource node UUID
target_idYesTarget node UUID
relationYesEdge relation type
weightNoEdge weight (0-10, default 1.0)

Implementation Reference

  • Implementation and registration of the 'create_edge' tool within the MCP server.
    // Tool: create_edge
    server.tool(
      "create_edge",
      "Create a relationship edge between two knowledge nodes.",
      {
        source_id: z.string().describe("Source node UUID"),
        target_id: z.string().describe("Target node UUID"),
        relation: z
          .enum([
            "answers",
            "solves",
            "contradicts",
            "supersedes",
            "depends_on",
            "related_to",
            "derived_from",
          ])
          .describe("Edge relation type"),
        weight: z.number().optional().describe("Edge weight (0-10, default 1.0)"),
      },
      async (args) => {
        await ensureApiKey();
        const result = await apiPost("/api/v1/edges", args);
        return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
      },
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a creation operation but doesn't mention permissions needed, whether it's idempotent, what happens on duplicate edges, error conditions, or what the return value contains. This leaves 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.

Conciseness5/5

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

The description is a single, efficient sentence that states the core purpose without any wasted words. It's appropriately sized and front-loaded with the essential information.

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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after creation (e.g., returns edge ID), error handling, or behavioral constraints. Given the complexity of creating relationships between nodes, 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 already documents all parameters thoroughly. The description adds no additional parameter information beyond what's in the schema, meeting the baseline for high schema coverage but not providing extra value.

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') and the resource ('relationship edge between two knowledge nodes'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'create_node' or 'edit_node' beyond the basic resource difference.

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's no mention of prerequisites (e.g., nodes must exist), exclusions, or comparison to sibling tools like 'edit_node' (which might modify edges) or 'create_node' (which creates nodes rather than edges).

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/kelvinyuefanli/agent-hive'

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