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)orfnmatchcase(b,a)), including exact matchesWhen granted, a JSON artifact is written under
file_reservations/<sha1(path)>.jsonand the DB is updatedTTL 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/, orattachments/; 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_reservationsif 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
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | ||
| format | No | ||
| reason | No | ||
| exclusive | No | ||
| agent_name | Yes | ||
| project_key | Yes | ||
| ttl_seconds | No | ||
| registration_token | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||