Skip to main content
Glama

get_file_locks

Identify active file locks on Linux by querying /proc/locks, revealing type, mode, PID, byte range, and path. Use it to determine which process holds a lock.

Instructions

Returns active file locks from /proc/locks: type, mode, PID, byte range, and path. Read-only; an unreadable file is silently swallowed, parse errors go in the errors field. Use to find who holds a lock.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
locksYes
errorsNo
Behavior5/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It explicitly notes that the tool is read-only, that unreadable files are silently swallowed, and that parse errors go into the errors field. This transparency goes beyond a simple return statement.

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: the first states the core function and output fields, the second adds the use case and behavioral caveat. Every sentence earns its place with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool with an output schema, the description is complete. It covers the data source (/proc/locks), output fields, error handling, and intended use case, leaving no gaps for an agent to select and invoke the tool correctly.

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?

The tool has zero parameters, so the schema is trivial. The description adds meaningful context by enumerating the output fields and error behavior, which helps the agent understand what data will be returned. Baseline 4 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's function: it returns active file locks from /proc/locks, enumerating the specific fields (type, mode, PID, byte range, path). It also states the tool's purpose ('Use to find who holds a lock'), distinguishing it from sibling get_* tools by focusing exclusively on file locks.

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 gives a clear, direct use case: 'Use to find who holds a lock.' This provides clear context for when to use the tool. It does not explicitly mention when not to use it or alternatives, but the use case is sufficient for a read-only diagnostic tool.

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/Mohabdo21/linux-mcp'

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