Skip to main content
Glama
oemoem12

lmstudio-agent-mcp

by oemoem12

agent_execute_command

Destructive

Execute shell commands and retrieve stdout, stderr, and exit code. Supports working directory, environment variables, and execution timeout.

Instructions

Execute a terminal command and return stdout, stderr, and exit code.

The command runs in a subprocess. By default it is executed through the system shell so that pipes, redirections, and environment variables work. Use caution with untrusted input to avoid command injection.

Args: command: Shell command to execute. working_directory: Working directory for the command. timeout: Maximum execution time in seconds. env: Additional environment variables to set or override. shell: Execute the command through the system shell.

Returns: str: JSON string with keys 'success', 'command', 'exit_code', 'stdout', 'stderr', and 'timed_out'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
envNoAdditional environment variables to set or override.
shellNoExecute the command through the system shell (required for pipes/redirects).
commandYesShell command to execute. Pipes and redirections are supported.
timeoutNoMaximum execution time in seconds.
working_directoryNoWorking directory for the command. Defaults to the server process cwd.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Beyond the annotations (destructiveHint=true), the description reveals that the command runs in a subprocess via the system shell, that pipes/redirections are supported, and that care is needed to avoid command injection. The return format is also disclosed. This adds meaningful behavioral context beyond the annotation flags.

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 well-organized with clear sections (introduction, caution, Args, Returns). It is moderately concise, though the Args section duplicates schema descriptions. The security warning and shell behavior details justify the length, and no filler is present.

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 the tool's complexity (5 params, annotations, and an output schema), the description covers all key aspects: execution model, shell behavior, security considerations, and return format. It does not explicitly describe timeout side-effects beyond the 'timed_out' return key, but this is minor given the output schema exists.

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% description coverage for all five parameters, including defaults and constraints. The description's Args section largely repeats this information without adding significant new semantics. Baseline of 3 is appropriate because the schema does the heavy lifting.

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 opens with a clear verb+resource: 'Execute a terminal command and return stdout, stderr, and exit code.' It specifies the tool's scope as executing commands in a subprocess, which clearly differentiates it from sibling tools like agent_read_file or agent_web_search that handle files, memory, or web tasks.

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 provides clear context for when to use the tool (running terminal commands) and includes a security caution about untrusted input. However, it does not explicitly name alternatives or state when not to use it, though the sibling tools are distinct enough that the intended usage is evident.

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/oemoem12/lmstudio-agent-mcp'

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