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) }] };
      },
    );

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