Skip to main content
Glama

Filesystem MCP Server

read_text_file

Access and extract specific lines from UTF-8 text files within allowed directories. Provide file path and optional line range (1-indexed) to retrieve desired content.

Instructions

Read the contents of a UTF-8 text file, optionally within a line range.

Args: path (str): File path to read (absolute or relative to allowed directories) fromLine (int, optional): Starting line number (1-indexed, inclusive) toLine (int, optional): Ending line number (1-indexed, inclusive)

Returns: str: File contents as text, or error message if failed

Note: - Path must be within allowed directory roots - Only reads UTF-8 text files (binary files will return error) - If line range specified, returns only those lines - Line numbers are 1-indexed

Input Schema

NameRequiredDescriptionDefault
fromLineNo
pathYes
toLineNo

Input Schema (JSON Schema)

{ "properties": { "fromLine": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Fromline" }, "path": { "title": "Path", "type": "string" }, "toLine": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Toline" } }, "required": [ "path" ], "type": "object" }
Install Server

Other Tools from Filesystem MCP Server

Related Tools

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/Preston-Harrison/fs-mcp-py'

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