Skip to main content
Glama
OpenCode Context Optimizer (OCCE)

OpenCode Context Optimizer (OCCE)

by SammySN-car

code_skeleton

Extract an AST outline of classes, functions, signatures, type hints, and docstrings from source files, replacing bodies with '...' to cut token usage by 80-94%.

Instructions

Extract an AST outline of classes, functions, signatures, argument type hints, and docstrings from a source file, replacing bodies with '...'. Consumes 80-94% fewer tokens than raw file reading.

Input Schema

NameRequiredDescriptionDefault
pathYesPath to the source file (relative or absolute).
depthNoMaximum nesting depth to inspect (default: 3).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/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 behavioral burden. It discloses the key transformation (bodies replaced with '...') and token savings, but does not explicitly state read-only behavior, supported languages, parse-error handling, or permission requirements.

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 definition is two front-loaded sentences with no waste. The core extraction behavior comes first, followed by a compact token-efficiency rationale.

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?

For a simple two-parameter extraction tool with no output schema, the description sufficiently explains the return shape as an AST outline with bodies elided. It could be slightly more complete by noting language support or failure behavior, but no critical invocation detail is missing.

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 description coverage is 100%, so both parameters are already documented. The description does not add meaning about path handling or how depth controls traversal beyond what the schema provides, making the baseline 3 appropriate.

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 uses a specific verb ('Extract') and resource ('AST outline') and lists the exact elements returned: classes, functions, signatures, type hints, and docstrings. It clearly distinguishes this from raw file reading, but it does not name or differentiate against sibling tools such as symbol_slice.

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?

The token-efficiency claim implies the tool should be used when a compact code overview is needed, but there is no explicit guidance on when to choose it over symbol_slice or other siblings, and no when-not-to-use conditions.

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