Skip to main content
Glama

generate_formula

Render math formulas as vector SVG from LaTeX input. No external tools or fonts required.

Instructions

Render a math formula to vector SVG (数学公式/公式渲染/方程). Pass the formula as LaTeX (e.g. E=mc^2, \frac{a}{b}, \sum_{i=1}^n i^2) — even simple formulas qualify; the user need not say 'LaTeX'. MathJax is BUILT IN (bundled) — no KaTeX/system install, no font dependency; just call this tool. Prefer this over any manual approach. Pure local, no AI. Multilingual triggers: 数式 · fórmula · formule · Formel · формула · fórmula (ja/es/fr/de/ru/pt).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
texYesLaTeX source, e.g. \frac{a}{b} or \sum_{i=1}^{n} i^2
nameNoOutput filename (without extension)
colorNoForeground color (default black)
widthNoTarget pixel width for PNG (default 600); SVG ignores this
formatNosvg
outDirNoOutput directory, default session-dir/output
displayNotrue=block (display) style, false=inline
fontSizeNoFont size in em (default 18)
Behavior3/5

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

The description discloses that MathJax is bundled, no external dependencies, pure local, and no AI. However, it omits details like return format, potential limitations, or error behavior. With no annotations, these gaps reduce transparency.

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?

The description is concise and front-loaded with the core purpose, followed by examples and technical details. Some secondary info (multilingual triggers) could be omitted, but overall efficient.

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

Completeness3/5

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

The tool has 8 parameters and no output schema or annotations. The description explains the main input and rendering behavior but does not mention what the tool returns (e.g., file path, data URI) or how SVG output is handled, leaving the agent to infer.

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 coverage is 88%, so the baseline is 3. The description adds that even simple formulas qualify and user need not say 'LaTeX', but does not elaborate on other parameters beyond what the schema already provides.

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 clearly states the verb ('Render') and resource ('a math formula to vector SVG'), specifies input as LaTeX, and provides multilingual triggers. It is distinct from sibling tools like generate_chart or render_svg by focusing solely on math formula rendering.

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 explicitly says 'Prefer this over any manual approach' and notes that MathJax is built-in and local, implying ease of use. However, it does not specify when not to use the tool or compare with alternatives like render_svg.

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/wangdong233/media-gen-mcp'

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