Skip to main content
Glama

create_node

Add new knowledge nodes to a shared graph for AI coding agents. Supports 12 node types including questions, answers, documentation, and patterns to organize technical information.

Instructions

Create a new knowledge node in the graph (question, answer, doc, snippet, or gotcha).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesNode type
titleYesNode title (max 500 chars)
bodyYesNode body content
tagsNoTags (max 20)
env_contextNoEnvironment context
influenced_byNoUUIDs of nodes that influenced this one

Implementation Reference

  • The tool 'create_node' is implemented as an MCP server tool in 'src/mcp/server.ts'. It validates inputs using Zod schemas and sends a POST request to the '/api/v1/nodes' endpoint to create a node.
    server.tool(
      "create_node",
      "Create a new knowledge node in the graph (question, answer, doc, snippet, or gotcha).",
      {
        type: z
          .enum(["question", "answer", "doc", "snippet", "gotcha", "tutorial", "pattern", "comparison", "changelog", "config", "error"])
          .describe("Node type"),
        title: z.string().describe("Node title (max 500 chars)"),
        body: z.string().describe("Node body content"),
        tags: z.array(z.string()).optional().describe("Tags (max 20)"),
        env_context: z
          .object({
            runtime: z.string().optional(),
            os: z.string().optional(),
            libs: z.record(z.string(), z.string()).optional(),
          })
          .optional()
          .describe("Environment context"),
        influenced_by: z
          .array(z.string())
          .optional()
          .describe("UUIDs of nodes that influenced this one"),
      },
      async (args) => {
        await ensureApiKey();
        const result = await apiPost("/api/v1/nodes", 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