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
| Name | Required | Description | Default |
|---|---|---|---|
| source_id | Yes | Source node UUID | |
| target_id | Yes | Target node UUID | |
| relation | Yes | Edge relation type | |
| weight | No | Edge weight (0-10, default 1.0) |
Implementation Reference
- src/mcp/server.ts:357-382 (handler)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) }] }; }, );