Skip to main content
Glama
rafim-dev

mcp-context-condenser

condense_source

Extracts a structural skeleton of a source file, keeping imports, types, and signatures while removing function bodies to reduce token consumption.

Instructions

Extracts an AST-aware structural skeleton of a source file (preserves imports, interfaces, types, and function/method signatures while stripping implementation bodies) to slash token consumption by up to 85%.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute or relative path to target source file
preserveDocstringsNoWhether to preserve docstring comments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well by disclosing the AST-aware transformation, what is preserved, what is removed, and the token reduction effect. It does not explicitly state whether the operation mutates the original file or returns a new representation, but 'Extracts' implies a non-destructive output.

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 well-structured sentence that front-loads the action and resource, uses a parenthetical to efficiently list preserved versus stripped elements, and closes with a concrete benefit. There is no filler or redundant information.

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 core purpose and behavior are clearly described, and the two parameters are simple enough that an agent can invoke the tool with just a path. However, there is no explicit statement about the return format or output representation, and no sibling differentiation, which is more noticeable because no 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?

Schema description coverage is 100%, and both parameters already have clear descriptions. The tool description adds no additional meaning about how path resolution works or what role preserveDocstrings plays beyond its schema description, so a baseline score is appropriate.

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 uses a specific verb ('Extracts') and resource ('structural skeleton of a source file'), and clearly states what is preserved (imports, interfaces, types, signatures) versus stripped (implementation bodies). This makes the tool's function distinct from siblings like extract_symbol or compress_log.

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 usage context is implied: use this when you need a condensed, structurally faithful representation of source code to reduce token consumption. However, there is no explicit guidance on when to choose this tool over siblings like extract_symbol or compress_log, and no mention of when not to use it.

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

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/rafim-dev/mcp-context-condenser'

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