Skip to main content
Glama

acquire_lock

Acquire an exclusive lock on a file before editing to prevent multiple AI agents from modifying it simultaneously. Returns lock status and blocker info if the file is already locked.

Instructions

Acquire an exclusive lock on a file before editing. Prevents other AI agents from modifying the same file simultaneously. Returns lock status and blocker info if already locked.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
intentYesBrief description of what the agent plans to do with this file (e.g., 'Refactoring the auth middleware')
filepathYesRelative path to the file to lock (e.g., 'src/index.ts')
agent_nameYesName of the AI agent requesting the lock (e.g., 'claude-code', 'aider', 'roo-code')
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses the exclusive nature of the lock, the concurrency prevention behavior, and what happens if already locked ('Returns lock status and blocker info if already locked'). It does not cover lock duration or release requirements, but the key behavioral traits are conveyed.

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 two sentences and 37 words, with the primary action and purpose in the first sentence and the return/blocker behavior in the second. Every sentence earns its place with no redundancy or filler.

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?

For a simple lock-acquisition tool with fully documented parameters and no output schema, the description adequately explains the purpose, exclusivity, and blocker-related return info. It could mention lock release or lifecycle, but the sibling tool release_lock implies the pattern, making the description sufficiently complete for an agent.

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 provides 100% coverage with descriptions for all three parameters (filepath, agent_name, intent). The tool description adds no parameter-specific information, so the baseline of 3 applies.

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 action: 'Acquire an exclusive lock on a file before editing.' It uses a specific verb (acquire) and resource (a file) and distinguishes itself from siblings like release_lock and force_release_all by focusing on acquiring the lock initially.

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?

The description provides clear context: use it 'before editing' to 'prevent other AI agents from modifying the same file simultaneously.' It does not explicitly name alternatives or exclusions, but the purpose is well-scoped relative to sibling tools.

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/codewithriza/AGNT-LOCK'

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