Skip to main content
Glama

chcon

Destructive

Plan or apply SELinux security context changes to files. Preview with --dry_run and execute with --allow_context to alter file security labels.

Instructions

Plan or apply an SELinux security context to files. Destructive: may alter file security labels, affecting access control. Use --dry_run to preview without changes. Requires --allow_context for actual execution; fails safely otherwise. Use to manage SELinux contexts on labeled filesystems. Not for general permission changes — use 'chmod'. See also 'runcon', 'chmod'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allow_contextNoAllow real SELinux context changes where supported.
contextYesSecurity context to apply.
dry_runNoReport operations without changing contexts.
no_followNoDo not follow symlinks where supported.
pathsYesPaths whose security context should change.
rawNoWrite context/path rows without a JSON envelope.
recursiveNoApply to directory contents recursively.
Behavior4/5

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

The description notes it is destructive ('may alter file security labels, affecting access control'), which adds context beyond the destructiveHint annotation. It also explains safe execution via --dry_run and --allow_context. However, it could be more explicit about fail-safe behavior when --allow_context is false.

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 concise: it leads with the main purpose, then warnings, then usage tips, then related tools. Every sentence serves a purpose without redundancy.

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?

Given no output schema, the description does not explain return values, but it covers safe usage and behavior. It addresses the 7 parameters indirectly through key flags. The description is adequate for an agent to use the tool correctly, though output details are missing.

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 parameters are described in the schema. The description adds value by highlighting key parameters like --dry_run and --allow_context with practical usage advice, exceeding the baseline of 3.

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 'Plan or apply an SELinux security context to files', providing a specific verb and resource. It distinguishes from siblings like 'chmod' and 'runcon' by specifying that it manages SELinux contexts, not general permissions.

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?

The description explicitly mentions when to use --dry_run for preview, requires --allow_context for execution, and warns against using it for general permission changes, directing to 'chmod'. It also references 'runcon' as related. This gives clear when, when-not, and 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/caseSHY/AI-CLI'

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