Skip to main content
Glama

claim_path

Lock a repo path before editing so concurrent AI sessions cannot collide. Fails fast when another live session holds the path, returning the holder so work can be rerouted.

Instructions

Cooperatively lock a path on the session bus before editing it. Fail-fast: if another live session holds the lock the claim is refused and the holder is returned; coordinate or pick another territory instead of retrying in a loop. A lock on a folder covers everything under it, so a claim above or inside a path another session holds is refused too, and a relative path is read from this session's project. Locks expire after ttl_seconds (default 900, max 3600) and die with their session.

Input Schema

NameRequiredDescriptionDefault
pathYesRepo-relative or absolute path (file or folder) to lock.
session_idNoLeave out: the lock is always taken by this server's own session, and any other id is refused.
ttl_secondsNoLock lifetime in seconds (1-3600, default 900).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.1.23
    • changedInput schema / properties / session_id / description
      Previous value: -"Session id acquiring the lock. Defaults to the current session."New value: +"Leave out: the lock is always taken by this server's own session, and any other id is refused."
  2. Addedv1.1.17
  3. Removedv1.1.15
  4. Addedv1.1.14

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: refusal semantics, returning the holder, hierarchical folder coverage that blocks ancestor/descendant claims, relative-path resolution against the session's project, TTL expiry, and lock death with the session. This is real behavioral disclosure an agent cannot infer from the schema.

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?

Four tight sentences, front-loaded with the action and its timing, then failure mode, then scoping rules, then lifetime. Every clause carries operational information; nothing is 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?

There is no output schema, and the description explains the refusal case returns the holder but not what a successful claim returns (lock identifier? confirmation?), which an agent may need before writing. Otherwise complete for a 3-parameter tool with full schema coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3; the description adds meaning beyond the schema by explaining that a relative path resolves from this session's project and that a folder path implies subtree coverage. ttl defaults are restated from the schema but the hierarchy semantics for `path` are genuinely new.

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?

States a specific verb and resource ('cooperatively lock a path') plus the motivating timing ('before editing it'), so an agent immediately knows this is a mutual-exclusion claim, distinct from the read/write state tools. It does not explicitly name its counterpart release_path, so sibling differentiation is implied rather than stated.

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?

Strong guidance: use before editing, expect fail-fast refusal, and on refusal 'coordinate or pick another territory instead of retrying in a loop' — an explicit anti-pattern. It stops short of naming release_path as the exit path or describing multi-path claim ordering strategies.

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