Skip to main content
Glama
cachly-dev

Cachly — AI Cognitive Brain

cache_lock_acquire

Acquire a distributed lock to prevent concurrent access to a resource, with automatic expiration to avoid deadlocks.

Instructions

Acquire a distributed lock using Redis SET NX PX (Redlock-lite). Returns a fencing token on success. The lock auto-expires after ttl_ms to prevent deadlocks. Use cache_lock_release to free the lock early.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instance_idYesUUID of the cache instance
keyYesLock resource identifier
ttl_msYesSafety TTL in milliseconds (e.g. 5000)
retriesNoMax acquire attempts (default: 3)
retry_delay_msNoMilliseconds between retries (default: 50)
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the auto-expiration after ttl_ms to prevent deadlocks and explains the Redis SET NX PX mechanism. This provides sufficient behavioral context for safe usage.

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 extremely concise with only three sentences, each adding value: action, return value, and usage guidance with sibling tool. It is front-loaded and contains no fluff.

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?

The description covers the core behavior and return value (fencing token). However, it omits details on retry behavior (retries, retry_delay_ms) and failure scenarios (e.g., lock not acquired). Still, it is sufficient for a lock acquire tool with good schema coverage.

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 comprehensive descriptions for all 5 parameters (100% coverage). The tool description adds no additional parameter meaning beyond the schema, so the baseline score of 3 is appropriate.

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 tool acquires a distributed lock using Redis SET NX PX (Redlock-lite) and returns a fencing token. It distinguishes from sibling cache_lock_release by advising to use it for early release.

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 explicitly mentions using cache_lock_release to free the lock early, providing a clear alternative. However, it does not specify when not to use this tool or other potential alternatives.

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/cachly-dev/cachly-mcp'

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