Skip to main content
Glama

file_release

Release file reservations held by a specified agent. Optionally provide patterns to release only specific files.

Instructions

Release file reservations held by an agent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agentYesAgent releasing reservations
patternsNoSpecific patterns to release (omit to release all)

Implementation Reference

  • Handles the file_release tool: deletes file reservations for a given agent, optionally filtered by specific patterns.
    server.tool(
      "file_release",
      "Release file reservations held by an agent.",
      {
        agent: z.string().max(256).regex(/^[a-zA-Z0-9_.-]+$/).describe("Agent releasing reservations"),
        patterns: z
          .array(z.string())
          .optional()
          .describe("Specific patterns to release (omit to release all)"),
      },
      async ({ agent, patterns }) => {
        const db = getDb();
    
        if (patterns && patterns.length > 0) {
          const placeholders = patterns.map(() => "?").join(",");
          const result = db
            .prepare(
              `DELETE FROM file_reservations WHERE agent = ? AND pattern IN (${placeholders})`
            )
            .run(agent, ...patterns);
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify({
                  released: true,
                  count: result.changes,
                  agent,
                  patterns,
                }),
              },
            ],
          };
        }
    
        const result = db
          .prepare(`DELETE FROM file_reservations WHERE agent = ?`)
          .run(agent);
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                released: true,
                count: result.changes,
                agent,
              }),
            },
          ],
        };
      }
    );
  • Input schema for file_release: requires 'agent' string and optional 'patterns' array of strings.
    {
      agent: z.string().max(256).regex(/^[a-zA-Z0-9_.-]+$/).describe("Agent releasing reservations"),
      patterns: z
        .array(z.string())
        .optional()
        .describe("Specific patterns to release (omit to release all)"),
    },
  • Registration of the file_release tool on the MCP server via server.tool() call.
    server.tool(
      "file_release",
      "Release file reservations held by an agent.",
      {
        agent: z.string().max(256).regex(/^[a-zA-Z0-9_.-]+$/).describe("Agent releasing reservations"),
        patterns: z
          .array(z.string())
          .optional()
          .describe("Specific patterns to release (omit to release all)"),
      },
      async ({ agent, patterns }) => {
        const db = getDb();
    
        if (patterns && patterns.length > 0) {
          const placeholders = patterns.map(() => "?").join(",");
          const result = db
            .prepare(
              `DELETE FROM file_reservations WHERE agent = ? AND pattern IN (${placeholders})`
            )
            .run(agent, ...patterns);
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify({
                  released: true,
                  count: result.changes,
                  agent,
                  patterns,
                }),
              },
            ],
          };
        }
    
        const result = db
          .prepare(`DELETE FROM file_reservations WHERE agent = ?`)
          .run(agent);
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                released: true,
                count: result.changes,
                agent,
              }),
            },
          ],
        };
      }
    );
  • src/server.ts:12-23 (registration)
    Top-level registration: registerFileTools (which includes file_release) is called during server creation.
    export function createServer(): McpServer {
      const server = new McpServer({
        name: "forgespec-mcp",
        version: pkg.version,
      });
    
      registerSddTools(server);
      registerTaskBoardTools(server);
      registerFileTools(server);
    
      return server;
    }
  • Database schema definition for the file_reservations table used by file_release to delete records.
    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
        );
      `);
    }
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It only says 'release', implying mutation, but lacks details on side effects, permissions, or reversibility.

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 clear sentence with no wasted words, optimally concise.

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 the tool's simplicity (2 parameters, no output schema), the description is minimally adequate but lacks behavioral and usage context, especially since annotations are absent.

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?

The input schema already describes both parameters (agent and patterns) with 100% coverage. The description adds no extra meaning, so baseline score of 3 is appropriate.

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 verb 'release' and the resource 'file reservations held by an agent', distinguishing it from the sibling tool 'file_reserve' which presumably creates reservations.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, nor any conditions or prerequisites. It is a single sentence without context.

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