Skip to main content
Glama

files/chown

DestructiveIdempotent

Change file or directory owner and group to manage access permissions. Requires root privileges for ownership changes; symlinks are never followed.

Instructions

Changes a file's or directory's owner and/or group (chown). Mutating and idempotent; for permission bits use files/chmod, 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. Changing the owner requires privileged: true (a grant, and a paths: entry for root). owner is user, user:group, :group or user: (the user's login group), with names or numeric ids; names are looked up in the host's /etc/passwd and /etc/group and an unknown one fails (no such user). Returns PATH: old -> new as owner:group, or unchanged; a recursive run prints one line per changed entry then a summary with skipped symlinks and per-entry errors, and is not atomic.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path
ownerYesuser, user:group, :group, or user: (the user's login group); names or numeric ids
recursiveNoAlso apply to everything below a directory (symlinks are skipped, never followed)
privilegedNoRun as root - required to change ownership. 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 - required to change ownership"New value: +"Run as root - required to change ownership. 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?

Goes well beyond the annotations (destructive/idempotent/not-readOnly): it discloses that symlinks are never followed and any symlinked component is refused, that recursive runs skip and report symlinks, that ownership change needs privileged elevation, and that recursive runs are non-atomic. This is exactly the class of mutation-risk detail the description should carry.

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?

Purpose and mutating nature are front-loaded in the first clause, and each subsequent sentence carries distinct value (symlink semantics, privilege requirement, return format). It is dense and somewhat clause-heavy, but nothing is filler.

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?

With no output schema, the description still explains return values ("PATH: old -> new", `unchanged`, recursive per-entry lines plus a summary). Combined with the annotations covering the safety profile, 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 coverage is 100%, so the schema already documents all four parameters (baseline 3). The description adds real meaning beyond the schema, though: the owner format variants, that names are resolved via /etc/passwd and /etc/group, and that an unknown name fails with "no such user".

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+resource: "Changes a file's or directory's owner and/or group (chown)." It also distinguishes itself from siblings by routing permission-bit changes to `files/chmod`, so an agent can differentiate without opening a 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 names alternatives and the condition that selects them: use `files/chmod` for permission bits and `files/list` to check the result. It also states the prerequisite (privileged: true with a grant and paths entry) for ownership changes, leaving little to inference.

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