Skip to main content
Glama
Raheem-19

Serena MCP Server

by Raheem-19

execute_shell_command

Run a shell command and return its stdout/stderr output as JSON. Checks memory for suggested commands before executing, preventing unsafe operations.

Instructions

Execute a shell command and return its output. If there is a memory about suggested commands, read that first. Never execute unsafe shell commands like rm -rf / or similar!. Returns a JSON object containing the command's stdout and optionally stderr output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoThe working directory to execute the command in. If None, the project root will be used.
commandYesThe shell command to execute.
capture_stderrNoWhether to capture and return stderr output.
max_answer_charsNoIf the output is longer than this number of characters, no content will be returned. -1 means using the default value, don't adjust unless there is no other way to get the content required for the task.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

The description discloses the return format (JSON with stdout and optionally stderr) and hints at memory-checking behavior. However, with no annotations, it leaves critical behavioral aspects undisclosed: shell execution can have arbitrary side effects (file modifications, system changes), and there's no mention of timeouts or error handling. The safety warning is advisory, not a transparency disclosure.

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?

The description is concise at three sentences, starts with the primary purpose, and includes a necessary safety caution. The sentence about memory is slightly ambiguous but not wasteful. It avoids excessive detail, so it's well-structured for quick reading.

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

Completeness3/5

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

The tool's complexity is high (arbitrary shell execution), and while the output schema and parameter schema cover return values and parameters, the description doesn't explain execution context, side effects, or safety mechanisms beyond the rm example. It also doesn't discuss timeouts or exit code behavior. Given the available annotations are absent, the description only partially covers what an agent needs to know.

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

Parameters3/5

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

The input schema already provides 100% parameter descriptions, so the baseline is 3. The description adds minimal parameter information beyond the schema, only linking 'optionally stderr output' to capture_stderr. It doesn't elaborate on cwd or max_answer_chars behavior, which the schema already covers.

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 'Execute a shell command and return its output,' which is a specific verb+resource. It is distinct from sibling tools (file operations, memory operations) as the only tool for shell execution. The mention of returning stdout/stderr clarifies the output.

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?

It provides a prerequisite ('If there is a memory about suggested commands, read that first') and an explicit safety exclusion ('Never execute unsafe shell commands like rm -rf / or similar!'). However, it doesn't name alternatives or explain when this tool should be preferred over file-specific tools, so it lacks explicit when-not/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/Raheem-19/serena-optimized'

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