Skip to main content
Glama

shell_exec

Execute PowerShell commands in a persistent session to preserve directory changes, environment variables, and virtual environment state across consecutive operations.

Instructions

在持久化 PowerShell 会话中执行命令。 核心创新:这是一个长期存活的 Shell 进程,不是每次开新进程。 效果:cd 之后目录保持、set 的环境变量保持、Python venv / node -e 等状态保持。 适用于:需要连续操作的场景(先 cd 再 git status、先激活 venv 再 pip install)。

Input Schema

NameRequiredDescriptionDefault
commandYes要执行的 PowerShell 命令
timeoutNo超时毫秒,默认 30000

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

A4.6/5.0
Behavior5/5

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

Since no annotations were provided, the description must carry the full burden of behavioral disclosure. It highlights the 'core innovation'—that the Shell process is long-lived and maintains state (directory location, environment variables, and virtual environment status), which is the most critical behavior to understand for this tool.

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 slightly longer than necessary but uses excellent structure. It follows a logical flow: general definition -> core benefit -> concrete effects -> application scenarios, ensuring all necessary value is 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 long-lived shell process, the description is maximally complete. It clearly states that state is retained after execution, which is the primary operational characteristic an AI agent needs to select this tool over a standard executor.

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?

Given that schema description coverage is 100%, the description adds functional meaning without needing to define the parameters. It does not elaborate on the syntax or complex constraints of 'command' or 'timeout' beyond what the schema implies.

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 purpose is highly specific: executing commands within a *persistent* PowerShell session. It clearly defines the resource (PowerShell session) and the action (executing commands), effectively distinguishing it from non-persistent execution tools.

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 tool explicitly outlines the ideal use cases: scenarios requiring continuous interaction, such as navigating directories and then listing contents ('cd' followed by 'git status'). This prevents misuse in one-off command contexts.

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