Skip to main content
Glama

file_reservation_paths

Reserve project file paths or globs before editing to prevent conflicting edits between agents; conflicts are reported against overlapping exclusive leases.

Instructions

Request advisory file reservations (leases) on project-relative paths/globs.

Semantics

  • Conflicts are reported if an overlapping active exclusive reservation exists held by another agent

  • Glob matching is symmetric (fnmatchcase(a,b) or fnmatchcase(b,a)), including exact matches

  • When granted, a JSON artifact is written under file_reservations/<sha1(path)>.json and the DB is updated

  • TTL must be >= 60 seconds (enforced by the server settings/policy)

  • Server-side enforcement (if enabled) only checks reservations that target mail archive paths such as agents/, messages/, or attachments/; code repo enforcement is via the pre-commit guard

Do / Don't

Do:

  • Reserve files before starting edits to signal intent to other agents.

  • Use specific, minimal patterns (e.g., app/api/*.py) instead of broad globs.

  • Set a realistic TTL and renew with renew_file_reservations if you need more time.

Don't:

  • Reserve the entire repository or very broad patterns (e.g., **/*) unless absolutely necessary.

  • Hold long-lived exclusive reservations when you are not actively editing.

  • Ignore conflicts; resolve them by coordinating with holders or waiting for expiry.

Parameters

project_key : str agent_name : str paths : list[str] File paths or glob patterns relative to the project workspace (e.g., "app/api/*.py"). ttl_seconds : int Time to live for the file_reservation; expired file_reservations are auto-released. exclusive : bool If true, exclusive intent; otherwise shared/observe-only. reason : str Optional explanation (helps humans reviewing Git artifacts).

Returns

dict { granted: [{id, path_pattern, exclusive, reason, expires_ts}], conflicts: [{path, holders: [...]}] }

Example

{"jsonrpc":"2.0","id":"12","method":"tools/call","params":{"name":"file_reservation_paths","arguments":{
  "project_key":"/abs/path/backend","agent_name":"GreenCastle","paths":["app/api/*.py"],
  "ttl_seconds":7200,"exclusive":true,"reason":"migrations"
}}}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYes
formatNo
reasonNo
exclusiveNo
agent_nameYes
project_keyYes
ttl_secondsNo
registration_tokenNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.4

TDQS

A4.7/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 delivers: conflict-detection rules, symmetric glob matching semantics, side effects (JSON artifact written to file_reservations/<sha1>.json plus DB update), the enforced TTL floor of 60s, and the precise scope of server-side enforcement. This is unusually rich disclosure for a mutation/lease tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Sectioned (Semantics, Do/Don't, Parameters, Returns, Example) and front-loaded with the core purpose, so an agent can scan it quickly. It runs long and the JSON-RPC example is somewhat verbose, but nearly every line carries actionable information for an 8-parameter tool.

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, yet the description still helpfully spells out the {granted, conflicts} return shape. Combined with the semantics and conflict behavior, an agent has enough to call it correctly, with the only real gap being the undocumented 'format' and 'registration_token' parameters.

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 0%, so the description must compensate, and it documents 6 of 8 params (project_key, agent_name, paths, ttl_seconds, exclusive, reason) with real meaning beyond the bare schema. However, 'format' and especially 'registration_token' are never explained, leaving an apparent auth/format parameter undocumented.

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?

Opens with a specific verb+resource+scope: 'Request advisory file reservations (leases) on project-relative paths/globs.' This clearly distinguishes it from the sibling reservation tools (release_file_reservations, renew_file_reservations, force_release_file_reservation) without needing to open any schema.

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

Usage Guidelines5/5

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

The Do/Don't section gives explicit when-to-use (reserve before edits), when-not (broad globs, long-lived holds, ignoring conflicts), and names the alternative 'renew with renew_file_reservations' for extending time. This is exactly the when/when-not/alternatives structure that earns a 5.

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