Skip to main content
Glama

read_file

Reads a file and marks it as active while automatically summarizing inactive files to their public interfaces, reducing context size for supported programming languages.

Instructions

Read a file and mark it as the active file. When you switch to a different file, the previous file is automatically summarized to just its public interface, reducing context size.

Supported languages for summarization: .rs, .py, .ts, .tsx, .js, .jsx, .php, .cs, .gd

For unsupported file types, returns full contents without tracking (same as standard file read).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the file to read (absolute or relative)
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: it marks files as active, automatically summarizes previous files when switching (reducing context size), lists supported languages for summarization, and explains fallback behavior for unsupported types. It doesn't cover potential side effects like performance impact or error handling.

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 efficiently structured: first sentence states core purpose, second explains the active file behavior, third lists supported languages, fourth covers unsupported types. Every sentence adds value with zero wasted words, and it's appropriately sized for the complexity.

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 no annotations and no output schema, the description does a good job covering the tool's behavior, language support, and fallback handling. However, it doesn't explain what 'public interface' summarization entails or provide examples of the output format, leaving some ambiguity for the agent.

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% for the single 'path' parameter, so the schema already documents it adequately. The description adds no additional parameter semantics beyond what the schema provides, maintaining the baseline score of 3 for high schema coverage.

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 clearly states the tool's purpose: 'Read a file and mark it as the active file.' It specifies the verb ('read'), resource ('file'), and distinguishes from siblings by explaining the active file tracking and summarization behavior, unlike simpler read tools like peek_file.

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 on when to use this tool: for reading files with active tracking and summarization for supported languages, and for unsupported types it behaves like a standard read. However, it doesn't explicitly state when NOT to use it or name alternatives like peek_file for non-tracking reads.

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/UBTCodeNinja/mcp-file-compaction'

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