Skip to main content
Glama

term_exec

Execute a command in an active Windows terminal session and return its output and exit code.

Instructions

Run one command in the session and return only its output and exit code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cmdYesCommand to run in the shell
timeoutNo
max_bytesNo
session_idYesSession id from term_open

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral burden. It does disclose the core behavior: runs one command and returns output and exit code, implying a non-interactive, synchronous execution. However, it does not mention blocking behavior, timeout effects, output truncation, or potential side effects on the session.

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 a single, front-loaded sentence with no filler. Every word contributes to understanding what the tool does and returns.

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 is simple, but the description omits any mention of timeout or max_bytes semantics, and there is no output schema to clarify the return format beyond 'output and exit code'. It also lacks guidance about appropriate use cases relative to siblings, leaving the agent to guess on edge cases.

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

Parameters2/5

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

Schema coverage is 50%, with cmd and session_id documented in the schema but timeout and max_bytes not described in either schema or description. The description adds no parameter-level meaning and fails to compensate for the gaps in the 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 description states a specific action ('Run one command'), a resource ('in the session'), and the exact return ('only its output and exit code'). This clearly distinguishes it from sibling tools like term_send or term_read, which handle streaming or interactive I/O.

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

Usage Guidelines2/5

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

The description gives no guidance on when to use this tool versus term_send, term_read, kd_exec, or other siblings. There is no mention of alternatives or conditions for choosing this tool, leaving the agent to infer usage from the name and schema alone.

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