Skip to main content
Glama

Write Markdown to Overleaf

write_markdown

Convert Markdown drafts into LaTeX and insert them into Overleaf projects by replacing sections, overwriting, or appending files.

Instructions

Write in Markdown, publish as LaTeX. Converts Markdown to LaTeX and writes it into the project: a new/overwritten .tex file, an existing section replaced by title, or appended to a file. Supports headings ({#sec:label}, {-} for unnumbered), $math$ and $$display$$ ({#eq:label}), citations [@key; @key2, p. 3], cross refs @fig:x/@sec:x/@eq:x/@tbl:x, figures caption{#fig:x width=60%}, pipe tables with 'Table: caption {#tbl:x}', footnotes, lists, code, and raw LaTeX (\commands and \begin..\end blocks pass through). Set dry_run to preview the LaTeX first. Writing uses Git; falls back to the opt-in web mode if enabled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoFor a file target: overwrite (default) or append before \end{document}.
pathNoTarget .tex file in the project. Required unless `section` is given.
dry_runNoOnly return the converted LaTeX and what would change; do not push.
md_pathNoAbsolute path of a local .md file to convert instead of `markdown`.
projectNoProject ID or Overleaf project URL (or project name in web mode). Defaults to OVERLEAF_PROJECT_ID.
sectionNoTitle of an existing section to replace. If the Markdown starts with a heading it replaces the heading too; otherwise only the body.
markdownNoMarkdown text. Use this or md_path.
top_levelNoLaTeX command for the shallowest Markdown heading. Defaults to section, or the replaced section's own level.
commit_messageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/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 substantial work: it discloses that writing goes through Git with an opt-in web-mode fallback, that a file target is overwritten by default, and that dry_run only previews without pushing. It does not mention permission/auth requirements or failure modes, but the mutation semantics are well covered.

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?

Front-loaded with the core action, followed by the supported Markdown syntax, then dry_run and Git behavior. The dense syntax enumeration is long but earns its place by telling the agent which constructs survive conversion; minimal filler.

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 nine-parameter, no-output-schema, unannotated tool, the description is nearly complete: it covers the conversion contract, targeting modes, preview path, and write mechanism. It stops just short of stating return shape or auth prerequisites, but nothing critical to a correct invocation is missing.

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 89%, so the schema already documents the nine parameters thoroughly. The description adds some useful glue (dry_run previews LaTeX, section replacement interact with top_level defaults) but mostly restates schema-level behavior rather than adding per-parameter meaning beyond it.

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?

States a specific verb+resource: converts Markdown to LaTeX and writes it into the project, with three concrete targeting modes (new/overwritten .tex, replace existing section, append). An agent understands exactly what the tool does. However, it never contrasts itself against close siblings like write_file or edit_file, so sibling differentiation is only implied by the 'Markdown' framing.

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

Usage Guidelines3/5

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

Usage context is implied (write Markdown when you want LaTeX output) and it usefully recommends dry_run to preview first. But it gives no explicit when-to-use/when-not guidance against alternatives such as write_file, edit_file, or write_markdown vs raw LaTeX paths, leaving the selection decision to inference.

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