Skip to main content
Glama

Read a file from the open Overleaf project

read_file
Read-only

Access file contents in an Overleaf project by relative path, receiving full text for text documents or base64 for binaries, plus metadata on version, lines, and tracked changes.

Instructions

Reads the contents of a file by project-relative path. For text docs (.tex, .bib, .md, etc.) the full text appears in both the content array and structuredContent.text; metadata (version, line/byte counts, ranges, tracked-change/comment counts) is in structuredContent. For binary files (images, PDFs) base64 is in content and structuredContent.base64, with MIME type alongside.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoProject-relative path of the file, e.g. 'main.tex' or 'chapters/intro.tex'. If omitted, defaults to the project's root doc (visible as `root_doc_path` in `open_project`'s response).
Behavior5/5

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

The description goes beyond the readOnlyHint annotation by detailing output structure: full text in content and structuredContent.text for text files, base64 and MIME type for binaries, and metadata (version, counts, ranges). This gives the agent a clear picture of what to expect, despite not covering error cases.

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?

Two sentences, front-loaded with the action, then structured details about output formats. No filler words; every phrase adds information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given there is no output schema, the description fully inventories the response structure (content, structuredContent, metadata, MIME type) and covers both file types. It also mentions the default path behavior, making the tool self-contained enough for an agent to use correctly.

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?

The sole parameter 'path' is fully described in the schema, and the description adds the default value (root doc) and references open_project's response for discovering it. This is valuable context beyond the schema.

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 uses the specific verb 'Reads' and identifies the resource as 'a file by project-relative path', distinguishing it from sibling tools like list_files (which lists) and edit_file (which modifies). It also clarifies the handling of text vs binary files, making the tool's scope unambiguous.

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 implies when to use this tool (when file contents are needed) and notes the default behavior when path is omitted, referencing open_project's response. However, it does not explicitly contrast with alternatives (e.g., 'use list_files to see available files'), so it stops short of full differentiation.

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/netique/overleaf-mcp'

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