Skip to main content
Glama

sdd_history

Retrieve the chronological SDD phase history for a project. Displays all contract transitions in order.

Instructions

Get the SDD phase history for a project. Shows all contract transitions in chronological order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesProject identifier
limitNoMax entries to return

Implementation Reference

  • The handler function for the 'sdd_history' tool. It queries the contracts table for a given project, orders by created_at DESC, and returns the history entries as JSON.
    // ── Get Project History ────────────────────────────
    server.tool(
      "sdd_history",
      "Get the SDD phase history for a project. Shows all contract transitions in chronological order.",
      {
        project: z.string().max(256).regex(/^[a-zA-Z0-9_.-]+$/).describe("Project identifier"),
        limit: z.number().min(1).max(100).default(20).describe("Max entries to return"),
      },
      async ({ project, limit }) => {
        const db = getDb();
        const rows = db
          .prepare(
            `SELECT id, phase, change_name, status, confidence, executive_summary, created_at
             FROM contracts WHERE project = ? ORDER BY created_at DESC LIMIT ?`
          )
          .all(project, limit);
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({ project, history: rows }),
            },
          ],
        };
      }
    );
  • Input schema for sdd_history: 'project' (string, max 256, alphanumeric+_.-) and 'limit' (number 1-100, default 20).
    {
      project: z.string().max(256).regex(/^[a-zA-Z0-9_.-]+$/).describe("Project identifier"),
      limit: z.number().min(1).max(100).default(20).describe("Max entries to return"),
    },
  • Registration of 'sdd_history' tool on the McpServer with description and zod-validated parameters.
    server.tool(
      "sdd_history",
      "Get the SDD phase history for a project. Shows all contract transitions in chronological order.",
      {
        project: z.string().max(256).regex(/^[a-zA-Z0-9_.-]+$/).describe("Project identifier"),
        limit: z.number().min(1).max(100).default(20).describe("Max entries to return"),
      },
      async ({ project, limit }) => {
        const db = getDb();
        const rows = db
          .prepare(
            `SELECT id, phase, change_name, status, confidence, executive_summary, created_at
             FROM contracts WHERE project = ? ORDER BY created_at DESC LIMIT ?`
          )
          .all(project, limit);
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({ project, history: rows }),
            },
          ],
        };
      }
    );
  • src/server.ts:18-18 (registration)
    Call to registerSddTools(server) which registers the sdd_history tool among others.
    registerSddTools(server);
  • Database schema initialization – creates the 'contracts' table with columns (id, phase, change_name, project, status, confidence, executive_summary, data, created_at) which sdd_history queries.
    function initSchema(db: Database.Database): void {
      db.exec(`
        CREATE TABLE IF NOT EXISTS contracts (
          id TEXT PRIMARY KEY,
          phase TEXT NOT NULL,
          change_name TEXT NOT NULL,
          project TEXT NOT NULL,
          status TEXT NOT NULL,
          confidence REAL NOT NULL,
          executive_summary TEXT NOT NULL,
          data TEXT NOT NULL DEFAULT '{}',
          created_at TEXT NOT NULL DEFAULT (datetime('now'))
        );
    
        CREATE TABLE IF NOT EXISTS boards (
          id TEXT PRIMARY KEY,
          project TEXT NOT NULL,
          name TEXT NOT NULL,
          created_at TEXT NOT NULL DEFAULT (datetime('now')),
          updated_at TEXT NOT NULL DEFAULT (datetime('now'))
        );
    
        CREATE TABLE IF NOT EXISTS tasks (
          id TEXT PRIMARY KEY,
          board_id TEXT NOT NULL REFERENCES boards(id) ON DELETE CASCADE,
          title TEXT NOT NULL,
          description TEXT NOT NULL DEFAULT '',
          status TEXT NOT NULL DEFAULT 'backlog',
          priority TEXT NOT NULL DEFAULT 'p2',
          assignee TEXT,
          spec_ref TEXT,
          acceptance_criteria TEXT NOT NULL DEFAULT '',
          dependencies TEXT NOT NULL DEFAULT '[]',
          notes TEXT NOT NULL DEFAULT '[]',
          created_at TEXT NOT NULL DEFAULT (datetime('now')),
          updated_at TEXT NOT NULL DEFAULT (datetime('now')),
          claimed_at TEXT,
          completed_at TEXT
        );
    
        CREATE TABLE IF NOT EXISTS file_reservations (
          id TEXT PRIMARY KEY,
          pattern TEXT NOT NULL,
          agent TEXT NOT NULL,
          expires_at TEXT NOT NULL,
          created_at TEXT NOT NULL DEFAULT (datetime('now'))
        );
    
        CREATE INDEX IF NOT EXISTS idx_tasks_board ON tasks(board_id);
        CREATE INDEX IF NOT EXISTS idx_tasks_status ON tasks(status);
        CREATE INDEX IF NOT EXISTS idx_contracts_project ON contracts(project);
        CREATE INDEX IF NOT EXISTS idx_reservations_agent ON file_reservations(agent);
    
        CREATE TABLE IF NOT EXISTS audit_log (
          id INTEGER PRIMARY KEY AUTOINCREMENT,
          timestamp TEXT DEFAULT (datetime('now')),
          action TEXT NOT NULL,
          entity_type TEXT NOT NULL,
          entity_id TEXT NOT NULL,
          agent_name TEXT,
          details TEXT
        );
      `);
    }
Behavior3/5

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

No annotations provided, so description must carry burden. States chronological order (useful), but omits permissions, error handling, or whether it's read-only. Adequate but not comprehensive.

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?

Two concise sentences, front-loaded with purpose. No wasted words.

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

Completeness2/5

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

No output schema; description fails to explain return format (what fields each transition contains). Given simplicity, some output detail expected for 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 already describes both parameters fully (100% coverage). Description adds no extra meaning beyond what is in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves SDD phase history, showing contract transitions in order. It differentiates from sibling tools like sdd_get (single project) and sdd_list (list projects) by focusing on history.

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

Usage Guidelines3/5

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

Implied usage when history needed, but no explicit when-not or alternatives provided. Lacks guidance on when to use this vs other related tools like sdd_get or sdd_list.

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/lleontor705/forgespec-mcp'

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