Skip to main content
Glama

record_decision

Document technical choices affecting codebase structure by recording decisions, reasons, alternatives, and constraints for architectural memory.

Instructions

Record an architectural decision. Call this whenever you make a technical choice that affects the codebase structure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesCategory: database, authentication, architecture, api, testing, deployment, security, performance, other
decisionYesShort description of the decision made
reasonYesWhy this decision was made
alternativesNoAlternatives that were considered and rejected
constraintsNoConstraints or rules that should not be violated
authorNoWho made this decision

Implementation Reference

  • The handler for 'record_decision' which retrieves the current lore store, constructs a decision object, checks for duplicates, and saves it to the store.
    // ── record_decision ──
    if (name === "record_decision") {
      const store = readStore();
    
      const decision: Decision = {
        id: crypto.randomUUID(),
        timestamp: new Date().toISOString(),
        category: (args?.category as string) || "other",
        decision: args?.decision as string,
        reason: args?.reason as string,
        alternatives: (args?.alternatives as string[]) || [],
        constraints: (args?.constraints as string[]) || [],
        author: (args?.author as "AI" | "human") || "AI",
        confidence: "HIGH",
      };
    
      // dedup: لا نسجل نفس القرار مرتين
      const exists = store.decisions.some(
        (d) =>
          d.decision.toLowerCase().trim() ===
          decision.decision.toLowerCase().trim()
      );
    
      if (exists) {
        return {
          content: [
            {
              type: "text",
              text: `⚠️  Decision already exists: "${decision.decision}"`,
            },
          ],
        };
      }
    
      store.decisions.push(decision);
      writeStore(store);
    
      return {
        content: [
          {
            type: "text",
            text: `✓ Decision recorded: "${decision.decision}"\n→ LORE.md updated`,
          },
        ],
      };
    }
  • src/index.ts:149-187 (registration)
    Tool definition and registration for 'record_decision'.
    {
      name: "record_decision",
      description:
        "Record an architectural decision. Call this whenever you make a technical choice that affects the codebase structure.",
      inputSchema: {
        type: "object",
        properties: {
          category: {
            type: "string",
            description:
              "Category: database, authentication, architecture, api, testing, deployment, security, performance, other",
          },
          decision: {
            type: "string",
            description: "Short description of the decision made",
          },
          reason: {
            type: "string",
            description: "Why this decision was made",
          },
          alternatives: {
            type: "array",
            items: { type: "string" },
            description: "Alternatives that were considered and rejected",
          },
          constraints: {
            type: "array",
            items: { type: "string" },
            description: "Constraints or rules that should not be violated",
          },
          author: {
            type: "string",
            enum: ["AI", "human"],
            description: "Who made this decision",
          },
        },
        required: ["category", "decision", "reason"],
      },
    },
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/EliotShift/lore-mcp'

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