Skip to main content
Glama

Lilia Editor

Put an image in a figure

add_figure_image

Put an image you have in a figure, from the file itself (a plot or diagram you made, a picture the author gave you): PNG, JPEG or PDF (its first page prints), up to 10 MB, sent as base64. Lilia stores it as the editor's upload does and adds a figure block after afterId (or at the end); with blockId it puts the image in that figure instead, keeping its caption, label and width unless you give new ones. Lilia never fetches a link: send the file. SVG, GIF, WebP and other formats are refused: convert to PNG, or to PDF for a vector drawing. Then check_document.

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": {
      "documentId": "<documentId>",
      "filename": "<filename>",
      "contentBase64": "<contentBase64>"
    },
    "name": "add_figure_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
altNoOptional short description for readers who can't see the image (ACM asks for one). Default: the file name.
labelNoOptional label to refer to it, e.g. fig:results (in text: Figure~(fig:results)).
widthNoOptional width as a fraction of the line, 0.05 to 1 (default 0.8).
afterIdNoAdd the new figure after this block id; omit to add it at the end.
blockIdNoPut the image in this existing figure block (from get_outline) instead of adding one.
captionNoOptional caption. Lilia marks work in it, e.g. @cite{key}.
filenameYesThe file name, e.g. results-plot.png. The file's own bytes decide its type.
documentIdYesThe document id.
contentBase64YesThe file as base64 (a data: prefix is fine).

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnly=false, destructive=false, idempotent=false) by disclosing the 10 MB cap, accepted formats, PDF first-page-only behavior, that storage mirrors the editor's upload, and that blockId reuses an existing figure while preserving caption/label/width. Non-idempotency is effectively explained: each call without blockId adds a new block after afterId or at the end.

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/limits, placement semantics, the link prohibition, format refusals, and the next step — a logical order with no filler sentences. It is dense with parentheticals ("its first page prints", "or at the end") and reads slightly run-on, costing a point.

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 9-parameter mutation tool with no output schema, the definition covers format constraints, size limit, payload encoding, placement rules, and verification (check_document). Nothing an agent needs to call it correctly 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 100%, so the baseline is 3. The description does add real meaning for afterId (new figure placed after that block, else at end) and for blockId (image replaces content in that figure while inherited caption, label and width survive unless overridden), but the remaining seven parameters are left to 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?

States a specific verb and resource ("Put an image you have in a figure") plus the concrete mechanism (base64 file bytes) and the effect (creates or fills a figure block). An agent can immediately tell this apart from add_block, paste_content, or import_document.

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?

Gives clear when-to-use framing (an image you already have as a file, not a link) and explicit when-not cases (SVG/GIF/WebP refused, links never fetched) with a remediation path (convert to PNG or PDF). It also routes the agent to check_document afterward, though it does not explicitly contrast itself with add_block for non-image content.

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