Skip to main content
Glama

Lilia Editor

Import a file

import_document

Import a file you have as a new Lilia document: .tex, .md or .lml as text; .docx, an Overleaf project .zip, a .pdf, or a scanned page as .jpg or .png (a photo of handwritten maths notes) as base64. Up to 10 MB. A zip's \input files are read as one document, its images and .bib kept with it. Lilia's importer runs as for a dropped file (no review step). Text, Word and zip files answer at once with the new document's id and address. A PDF or an image is read into LaTeX by Lilia's maths OCR, which takes up to about two minutes: the reply is an importId at once; call import_status with it every 10 to 20 seconds until it says done (the document) or failed (the reason). PDFs and images use the author's plan's monthly PDF pages (an image counts as one page), not the day's connector actions; a refusal says which limit and what is left. Then get_outline, check_document. When the file is with the author rather than with you, use start_import.

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": {
      "filename": "<filename>",
      "content": "<content>"
    },
    "name": "import_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
formatNoOptional: tex, docx, md, lml, pdf or image.
contentYesThe file: its text for .tex, .md and .lml; base64 for .docx, .zip, .pdf, .jpg and .png (a data: prefix is fine).
filenameYesThe file name, e.g. paper.tex, thesis.docx, notes.md, notes.lml, paper.pdf, notes-scan.jpg. Its extension gives the format unless format is set.

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.5/5.0
Behavior3/5

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

Adds substantial context beyond the annotations: no review step, synchronous replies for text/Word/zip versus an asynchronous importId for PDF/image, an OCR latency of about two minutes, and the billing distinction between monthly PDF pages and daily connector actions, including what a refusal message contains. This is far richer than the bare readOnly/openWorld/idempotent/destructive hints and is consistent with them (a new-document import is a write, non-idempotent, not destructive).

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 purpose then formats then async semantics, and nearly every sentence carries operational weight (polling cadence, billing, follow-ups). It is a dense run-on block with semicolons and parentheticals, however, and could be broken into lines for faster scanning.

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?

For a tool with no output schema and thin annotations, the description covers return shapes (id and address, or importId), the failure mode, cost implications, and the downstream calls. Nothing an agent needs to invoke and then correctly follow up on is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With schema coverage at 100% the baseline is 3, but the description still adds meaning the schema lacks — the 10 MB limit, the text-versus-base64 split per extension, and how a zip's \input files, images and .bib are consolidated into one document. That directly changes how an agent should prepare the content payload.

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 ('Import a file you have as a new Lilia document') and immediately enumerates the accepted formats and the 10 MB ceiling, so an agent knows exactly what the tool consumes. It also carves out the boundary with the sibling start_import, making it distinguishable without opening any schema.

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 routing: use this tool when the file is with you, use start_import when the file is with the author. It also prescribes the follow-up flow — call import_status every 10 to 20 seconds until done or failed, then get_outline and check_document — so there is no ambiguity about sequencing.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources