Skip to main content
Glama

AI Code Security Gate

Acquire Context Lock

acquire_lock

Acquire a DB-backed lock on a file path (TTL 1–3600s, default 300). Costs 1¢ per attempt. Fails if another agent holds a live lock.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file_path": "<file_path>",
      "agent_id": "<agent_id>"
    },
    "name": "acquire_lock"
  }
}

Input Schema

NameRequiredDescriptionDefault
api_keyNo
agent_idYes
file_pathYes
ttl_secondsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations only declare non-read-only, non-idempotent, non-destructive, non-open-world; the description adds material behavior beyond that — DB-backed persistence, TTL clamped to 1–3600s with a 300s default, a 1¢ cost per attempt, and contention failure. It omits what happens at TTL expiry and whether the same agent can re-acquire or refresh, which keeps it off a 5.

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 short sentences, zero filler, with the core action and constraints front-loaded and the cost/failure caveats immediately after. Every clause carries operational information.

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

Completeness4/5

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

An output schema exists, so return values need no explanation, and the description covers the non-obvious risks (cost, TTL, contention) for a mutating tool. The gap is the three undocumented parameters, which leave an agent guessing about identity and path format before a first call.

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 0%, so the description must carry parameter meaning — and it only covers ttl_seconds (valid range and default), which is genuinely useful. file_path (absolute vs relative, must it exist?), agent_id, and the optional api_key are left completely undefined in both schema and prose.

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?

States a specific verb ('Acquire') and resource ('a DB-backed lock on a file path'), with scope qualifiers (TTL bounds, default, failure condition). The verb alone cleanly separates it from the release_lock sibling, so an agent can pick it without opening the schema.

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?

Usage is implied rather than stated: an agent can infer you lock a file path before mutating it and that it must be released later. There is no explicit when-to-use/when-not guidance, no mention of release_lock as the required counterpart, and no retry advice after a contention failure.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.