Skip to main content
Glama

files/chmod

DestructiveIdempotent

Change file or directory permission bits using octal or symbolic modes. Supports recursive changes, skips symlinks, and requires privilege for files you don't own.

Instructions

Changes a file's or directory's permission bits (chmod). Mutating and idempotent; for owner or group use files/chown, to check the result files/list. Never follows symbolic links: a path containing a symlink in any component is refused, and recursive changes skip symlinks and report them. Numeric modes follow GNU chmod semantics (on directories a 4-digit mode keeps setuid/setgid; use 5 digits, e.g. 00755, to set them exactly); a bare 755 is octal. Changing a file you do not own needs privileged: true (a grant, and a paths: entry for root). Single change returns PATH: 0644 (-rw-r--r--) -> 0755 (-rwxr-xr-x), or ... unchanged if already set. A recursive run prints one line per changed entry, then changed N, unchanged M (plus skipped symlinks) and per-entry errors; it is not atomic, so partial success is possible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYesOctal (644, 0755, 4755) or symbolic (u+x, go-w, a=r, +X, u+s, +t; comma-separated)
pathYesAbsolute path
recursiveNoAlso apply to everything below a directory (symlinks are skipped, never followed)
privilegedNoRun as root - needed for files you don't own. Needs a grant for this tool in mcp-sudo.yaml and a `paths:` entry covering the path

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.1
    • changedInput schema / properties / privileged / description
      Previous value: -"Run as root - needed for files you don't own"New value: +"Run as root - needed for files you don't own. Needs a grant for this tool in mcp-sudo.yaml and a `paths:` entry covering the path"
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare mutating/destructive/idempotent, but the description adds substantial context beyond them: symlinks are never followed and any symlinked component is refused, recursive runs skip and report symlinks, GNU numeric-mode semantics (4-digit vs 5-digit setuid handling), the exact return format for single and recursive runs, and that recursive runs are non-atomic with possible partial success.

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?

Front-loads the core purpose and the sibling routing, and almost every clause carries distinct information. It is dense and somewhat run-on with heavy semicolon chaining, which slightly hurts scanability, but little is wasted.

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 complex mutating, non-atomic tool with 4 parameters and no output schema, the description is complete: it discloses return formats, symlink policy, elevation requirements, mode semantics, and partial-failure behavior, so an agent has everything needed to call it 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?

Schema description coverage is already 100%, so the baseline is 3, but the description adds real meaning: it clarifies numeric vs symbolic mode behavior (a bare `755` is octal, 4 vs 5 digits control setuid/setgid), and that `privileged` requires both a grant in mcp-sudo.yaml and a `paths:` entry. This meaningfully elaborates on the schema.

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?

States a specific verb and resource ('Changes a file's or directory's permission bits (chmod)') and explicitly distinguishes itself from siblings by naming `files/chown` for owner/group and `files/list` to check results. An agent can identify and route to it without opening the 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?

Explicitly states when to use alternatives (`files/chown` for owner/group, `files/list` to verify) and the condition that requires elevation (`privileged: true` plus a grant and `paths:` entry for files you don't own). Nothing is left to inference.

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