Skip to main content
Glama
TripQi

Code Editor MCP Server

by TripQi

read_file

Read file content from specified paths with optional line range selection and automatic encoding detection for text and image files.

Instructions

Read file content with optional line range.

Args: file_path: Absolute path to the file. offset: Start line (negative reads from end). length: Max lines to return. encoding: "auto"/None for auto-detection, or specify: utf-8, gbk, gb2312.

Returns: dict with keys: - content: File content as string - mimeType: MIME type of the file - isImage: Boolean indicating if file is an image - encoding: Detected encoding (e.g., "utf_8", "gbk", "gb2312") - encodingConfidence: Confidence score for encoding detection (float or None)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
offsetNo
lengthNo
encodingNo
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 detailing return structure (dict with content, mimeType, isImage, encoding, encodingConfidence) and behavioral aspects like encoding auto-detection and line-range reading. It doesn't mention error handling, file size limits, or permissions, leaving some gaps.

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 well-structured with a clear opening sentence, followed by organized 'Args' and 'Returns' sections. Every sentence adds value: the first states purpose, and subsequent sections detail parameters and output without redundancy. It's appropriately sized and front-loaded.

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 provides good completeness for a read tool: covers purpose, parameters, and return values. It could improve by mentioning error cases (e.g., file not found) or performance considerations, but it's largely sufficient for the tool's complexity.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It adds significant meaning beyond the schema: explains 'offset' (negative reads from end), 'length' (max lines), and 'encoding' (auto-detection options with examples like utf-8, gbk). It covers all 4 parameters thoroughly, though it could clarify 'file_path' requirements more.

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 verb ('Read') and resource ('file content') with specific scope ('with optional line range'). It distinguishes from siblings like 'read_files' (plural) and 'edit_block' (modification) by focusing on single-file reading with line-range filtering.

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 description implies usage for reading file content with line-range options, but provides no explicit guidance on when to use this vs. alternatives like 'read_files' (for multiple files) or 'edit_block' (for editing). It mentions optional line range but doesn't specify scenarios where this is preferable.

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/TripQi/code-editor'

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