Skip to main content
Glama
OpenCode Context Optimizer (OCCE)

OpenCode Context Optimizer (OCCE)

by SammySN-car

smart_exec

Execute shell commands with real-time ANSI stripping, progress-bar suppression, and head/tail truncation to keep command output compact and reduce prompt tokens.

Instructions

Execute a shell command with real-time ANSI escape stripping, carriage-return collapse, package manager progress bar & spinner suppression, and intelligent head/tail truncation.

Input Schema

NameRequiredDescriptionDefault
commandYesShell command line to execute.
max_linesNoMaximum output lines before head/tail truncation (default: 60).

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 carries the full burden, and it does disclose meaningful behavior: ANSI stripping, carriage-return collapse, progress/spinner suppression, and truncation of output. However, it omits critical operational facts for arbitrary shell execution — exit-code handling, stderr capture, timeouts, working directory, and permission/safety implications.

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?

A single front-loaded sentence with the action first and the modifiers after — efficient and zero filler. The dense feature list is slightly jargon-heavy but every clause conveys distinct behavior.

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?

There is no output schema and no annotations, so the description should ideally state what comes back (stdout string? exit status? error text?) for a tool that runs arbitrary commands. It is thorough about output transformation but silent on return shape and failure semantics, leaving a real gap for an execution tool.

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?

Schema coverage is 100%, so both parameters are already documented, making 3 the baseline. The description adds only marginal meaning: 'intelligent head/tail truncation' explains the strategy behind max_lines (preserving both ends rather than cutting the tail), but no format or interaction detail beyond the schema.

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?

The description opens with a specific verb+resource pair ('Execute a shell command') and then enumerates the output post-processing it performs. It is clearly distinguishable from the compression-oriented siblings (code_skeleton, diff_compact, test_compress), though it never explicitly names them or states how it differs from them.

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?

Usage is only implied: the emphasis on progress-bar/spinner suppression and head/tail truncation signals the tool is meant for noisy, long-running commands whose output would otherwise flood context. There is no explicit when-to-use, when-not-to-use, or alternative-sibling routing.

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