Skip to main content
Glama

Upload a binary file (figure, PDF, ...)

upload_file

Upload local or base64 files to a specified Overleaf project path, replacing existing files and creating parent folders as needed—ideal for figures and binary assets.

Instructions

Uploads a file from the local disk (local_path) or from base64 (content_base64) to path in the project, replacing an existing file of the same name. Use for figures and other binary assets; use create_doc / edit_file for text. local_path is only allowed inside the client's MCP roots or the directories in OL_UPLOAD_DIRS, and never for dotfiles.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "upload_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesDestination path in the project, e.g. 'figures/teaser.pdf'. An existing file at this path is replaced.
local_pathNoAbsolute path of a local file to upload. Must be inside the client's MCP roots or OL_UPLOAD_DIRS; dotfiles and dot-directories are refused.
project_idNoOverleaf project id from list_projects or open_project. Opens the project if it is not already active. Pass it on every call when MCP sessions may change between calls. Writes without it only go to the project last confirmed by open_project or by a write naming it.
content_base64NoFile content as base64, instead of local_path.
create_parentsNoCreate missing parent folders (default: true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose the key behavioral traits: overwrite-on-same-name, path allow-listing, and dotfile refusal. It stops short of behavior an agent might still need -- size limits, whether the write is atomic, and what a successful response reports.

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 what the tool does and the overwrite rule, followed by sibling routing and then the path constraint. Highly dense with no filler or redundant restatement.

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 mutation tool with zero annotations and no output schema, the description covers the essentials: source modes, destination, overwrite semantics, and access restrictions. The remaining gap is return/confirmation behavior, which matters more here because there is no output schema to explain it.

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 100%, so all five parameters are already documented, including the roots/OL_UPLOAD_DIRS restriction and create_parents default. The description restates the local_path restriction and notes content_base64 is an alternative to local_path, but adds little meaning beyond the schema, which sets the baseline at 3.

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?

States a specific verb and resource ('Uploads a file... to `path` in the project') plus the two input modes (local disk vs. base64) and the overwrite consequence. The closing sentence explicitly routes text assets to create_doc / edit_file, so an agent can distinguish this from siblings without reading schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use ('figures and other binary assets') and names concrete alternatives with the condition that selects them ('use create_doc / edit_file for text'). It also states the local_path constraint envelope (MCP roots or OL_UPLOAD_DIRS, no dotfiles), which is the main reason a call would fail.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.