Read Text File
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.
Purpose
This skill provides access to the MCP tool read_text_file. It allows you to 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..
Parameters
The tool accepts the following parameters:
path
Required
- Type:
string - Description: No description provided
tail
Optional
- Type:
number - Description: If provided, returns only the last N lines of the file
head
Optional
- Type:
number - Description: If provided, returns only the first N lines of the file
Usage Instructions
To use this tool:
- Prepare the parameters according to the schema above
- Invoke the MCP tool
read_text_filewith the prepared parameters - Process the result returned by the tool
Example
{
"path": "example_value",
"tail": 123,
"head": 123
}
Expected Output
The tool returns data with the following structure:
- content (
string): No description provided
Notes
- This skill requires an active MCP connection to the server providing the
read_text_filetool - Ensure the MCP server is properly configured and running before attempting to use this tool
- Review the parameter requirements carefully to avoid errors