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"],
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action ('record') but doesn't disclose behavioral traits like how the decision is stored, if it's immutable, requires permissions, or has side effects. This is a significant gap for a tool with mutation implications.

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 front-loads the purpose and usage without any wasted words. It's appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description adequately covers purpose and usage but lacks details on behavior, return values, or error handling. For a mutation tool with 6 parameters, it's minimally viable but has clear gaps in completeness.

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 fully documents all parameters. The description adds no additional meaning beyond implying the tool is for recording decisions, which aligns with the schema but doesn't enhance parameter understanding. Baseline 3 is appropriate as the schema handles the heavy lifting.

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 verb ('record') and resource ('architectural decision'), specifying it's for technical choices affecting codebase structure. It distinguishes from siblings like 'get_context' and 'get_gaps' by focusing on recording rather than retrieving, but doesn't explicitly differentiate beyond that.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides clear context on when to use ('whenever you make a technical choice that affects the codebase structure'), which implicitly distinguishes it from sibling tools that likely retrieve information. However, it lacks explicit exclusions or named alternatives for similar recording tasks.

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/EliotShift/lore-mcp'

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