Skip to main content
Glama

ubuntu_execute_command

Execute a single validated command under an active security policy, with chaining and injection patterns blocked. Returns structured JSON results and flags output as untrusted text.

Instructions

Execute one validated command under the active security policy.

This tool is for controlled command execution. The command is parsed with shlex, validated against allow/deny rules, and executed without shell expansion in secure mode. Command chaining and injection patterns (e.g., ;, &&, pipes) are blocked.

Args: command: Single command line string (no command chaining). working_dir: Optional directory; must be policy-allowed. detailed: If True, returns raw stdout/stderr payload; if False, returns compact summary fields.

Returns: JSON string using unified contract: - success: {"ok": true, "data": {...}} - error: {"ok": false, "error": {"type", "message"}}

`data` includes command execution fields and `security_notice`
marking tool output as untrusted text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYes
detailedNo
working_dirNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.1.0

TDQS

A4.8/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden, and it delivers: it discloses shlex parsing, allow/deny validation, no shell expansion in secure mode, blocked chaining, and the output contract including security_notice marking output as untrusted. This is far beyond a generic 'execute a command' 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 organized into clear sections (purpose, args, returns) and every sentence carries operational information. There is no filler or redundant restating of the schema, and the most important security constraints are front-loaded.

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 generic command execution tool with no annotations, it covers security constraints, argument semantics, and the return contract including both success and error shapes. The presence of an output schema supplements this, but nothing essential is missing for correct and safe invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so every parameter needed semantics, and the description provides them all: command must be a single line with no chaining, working_dir is optional and policy-restricted, and detailed controls raw vs compact output. This fully compensates for the bare 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?

The opening line states a specific verb ('Execute'), a resource ('one validated command'), and a governing constraint ('under the active security policy'). This clearly distinguishes it from the listed sibling tools, which are narrower read/write/package/system operations.

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 frames the tool as 'for controlled command execution' and spells out what is blocked (chaining, injection patterns, shell expansion in secure mode), giving clear context for when it is appropriate. It does not name specific sibling alternatives to prefer, so it stops short of full when-to-use vs alternative guidance.

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

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/bill-kopp-ai-dev/percival-ubuntu-mcp'

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