Skip to main content
Glama
AperionAI

aperion-shield

Official

Read Text File

read_text_file
Read-only

Reads a file's complete text contents to inspect or process it, with optional head/tail line limits and clear errors for unreadable files. Works only within allowed directories.

Instructions

Read the complete contents of a file from the file system as text. Handles various text encodings and provides detailed error messages if the file cannot be read. Use this tool when you need to examine the contents of a single file. Use the 'head' parameter to read only the first N lines of a file, or the 'tail' parameter to read only the last N lines of a file. Operates on the file as text regardless of extension. Only works within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
headNoIf provided, returns only the first N lines of the file
pathYes
tailNoIf provided, returns only the last N lines of the file

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes

Schema Changelog

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

  1. Addedv1.0.4
  2. Removedv1.0.3
  3. First observedv1.0.1

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, and the description adds meaningful behavior: handling various text encodings, providing detailed error messages, supporting head/tail line limits, and restricting operation to allowed directories. These details go beyond the annotations without contradicting them.

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?

The description is moderately sized and front-loaded with the core purpose. Each sentence contributes useful information such as encoding handling, error messages, usage context, parameter behavior, and access restrictions. There is slight redundancy between the first sentence and the usage guidance, but it is not wasteful.

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 read-only tool with an output schema, the description covers essential context: encodings, error behavior, head/tail options, extension-agnostic text handling, and directory restrictions. It does not explicitly clarify the relationship with the sibling read_file tool or address potential interactions between head and tail, but these are minor gaps given the schema and annotations.

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 67%; the head and tail parameters are already described in the schema. The description reinforces their behavior and adds that the default is complete contents, but it does not add meaningful detail for the undocumented required path parameter beyond implying it is a file system path within allowed directories.

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 clearly states the tool reads the complete contents of a file as text, which is a specific verb+resource. It distinguishes itself from read_media_file by specifying text regardless of extension and from read_multiple_files by focusing on a single file, but it does not explicitly differentiate from the similarly named sibling read_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?

It explicitly says to use this tool when examining the contents of a single file, giving clear context. It implies exclusions through 'as text regardless of extension' and 'Only works within allowed directories,' but it does not name alternative tools such as read_media_file or read_multiple_files when those would be more appropriate.

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/AperionAI/shield'

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