Skip to main content
Glama

shell_exec_verified

Executes PowerShell commands, then independently verifies outcomes with filesystem assertions such as path existence, directory or file type, or file contents; retries with exponential backoff on failure.

Instructions

执行命令,并用文件系统 API 独立验证结果;验证不过自动带指数退避重试(自愈雏形)。 不轻信命令自身的返回值:例如 mkdir 之后,真的去确认目录存在。 expect 支持:pathExists / pathNotExists / isDir / isFile / fileContains:[路径,内容] / cwd

Input Schema

NameRequiredDescriptionDefault
expectYes验证断言,如 {"isDir":"D:\\tmp\\x"} 或 {"fileContains":["D:\\a.txt","hello"]}
commandYes要执行的 PowerShell 命令
retriesNo失败重试次数,默认 2
timeoutNo单次超时毫秒,默认 30000

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations present the description carries the full load, and it delivers the key traits: this is a mutating executor that re-checks state via a separate filesystem API, retries failures with exponential backoff (default count in schema), and honors a per-command timeout. What it omits is the terminal-failure path — what the agent gets back if all retries exhaust — and any permission/safety framing.

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?

Three tight sentences: the core mechanism comes first, then the rationale, then the assertion vocabulary. The trailing key list is dense but functional. Little wasted text, though the expect enumeration reads as a raw spec dump rather than prose.

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?

For a 4-parameter tool with a nested `expect` object and no output schema, the description covers the input and retry semantics adequately but says nothing about the returned result — whether the agent gets a pass/fail verdict, which assertion failed, or the command's stdout. That is a meaningful omission when there is no output schema to fall back on.

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 already 100%, so 3 is the floor; the description earns above that by enumerating the valid `expect` keys (pathExists, pathNotExists, isDir, isFile, fileContains:[path,content], cwd) and the shape of fileContains, which the schema only hints at with one example. It doesn't explain the retry semantics of `retries` or the timeout unit context beyond what the schema states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and mechanism: run a command, then independently verify the outcome through the filesystem API, with retries on verification failure. The 'mkdir → confirm the directory exists' example makes the intent concrete. It does not explicitly contrast itself with the sibling shell_exec, which keeps it short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'Don't trust the command's own return value' implies when to reach for this over a plain executor, and the expect-key list defines the required usage precondition. However, it never names shell_exec as the lightweight alternative or says when verification is unnecessary, so routing is inferred rather than stated.

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