Skip to main content
Glama

render_hwp_equation_svg

Converts OWPML equation scripts into SVG format for use in HWP documents, supporting custom font size and color.

Instructions

Render an OWPML equation script (e.g. 'TIMES LEFT ( {a} over {b} RIGHT )') to SVG. Args: script, font_size (HWP units, default 1300), color (default 0).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYes
font_sizeNo
colorNo

Implementation Reference

  • The actual handler function that renders an OWPML equation script to SVG. Initializes the rhwp WASM runtime, creates an empty document, and calls doc.renderEquationPreview().
    export async function renderHwpEquationSvg(args: RenderEqArgs): Promise<string> {
      await initRhwp();
      const { HwpDocument } = await import("@rhwp/core");
      const doc = HwpDocument.createEmpty();
      try {
        const fontSize = args.font_size ?? 1300;
        const color = args.color ?? 0;
        return doc.renderEquationPreview(args.script, fontSize, color);
      } catch (e) {
        return `수식 렌더 오류 (equation render error): ${(e as Error).message}`;
      } finally {
        doc.free();
      }
    }
  • Type definition for the equation render arguments (script, optional font_size, optional color).
    export interface RenderEqArgs {
      script: string;
      font_size?: number;
      color?: number;
    }
  • src/server.ts:480-483 (registration)
    Tool registration in the TOOLS array with name, description, and JSON Schema input validation.
    {
      name: "render_hwp_equation_svg",
      description:
        "Render an OWPML equation script (e.g. 'TIMES LEFT ( {a} over {b} RIGHT )') to SVG. Args: script, font_size (HWP units, default 1300), color (default 0).",
  • src/server.ts:543-543 (registration)
    Mapping from tool name to handler function in the HANDLERS record.
    render_hwp_equation_svg: renderHwpEquationSvg,
  • src/server.ts:36-36 (registration)
    Import of the renderHwpEquationSvg function from the render-extra module.
    import { renderHwpHtml, renderHwpEquationSvg } from "./tools/render-extra.js";
Behavior2/5

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

With no annotations, the description should disclose behavioral traits, but it only lists default values. It does not mention safety, side effects, or error conditions. While rendering is likely safe, the description lacks sufficient 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 brief and front-loaded with the action and resource. However, the args list is somewhat inline, and the structure could be more clearly separated. Every sentence is useful, but there is room for slight improvement in organization.

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

Completeness2/5

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

Given no output schema, no annotations, and 0% schema coverage, the description is too sparse. It does not explain the output SVG format, error handling, or any dependencies, making it incomplete for an agent to fully understand the tool's behavior.

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 0%, so the description must fill the gap. It provides an example for 'script' and default values for 'font_size' and 'color', adding some meaning beyond the schema. However, it does not specify formats or constraints for the numeric parameters, limiting completeness.

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 the resource 'OWPML equation script' with an example, and it distinguishes from sibling tools like render_hwp_page or render_hwp_all_pages because it specifically targets equation scripts to SVG.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives such as render_hwp_html or render_hwp_page. It does not mention contexts or prerequisites, leaving the agent without usage direction.

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/treesoop/hwp-mcp'

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