Skip to main content
Glama

render_library_item

Render a KiCad symbol or footprint as PNG images to visually check layout, texts, pin 1 mark, and silkscreen.

Instructions

Render a symbol or a footprint of a KiCad library as PNG images.

Use the images for a visual check: the layout, the texts, the pin 1 mark, the silkscreen on the pads, items that overlap. get_library_symbol and get_library_footprint give the exact values.

kicad-cli of the installed KiCad draws the item as SVG, with the color theme "KiCad Default". The tool draws each SVG as PNG images with the background of that theme. The library comes from the library tables of the installed KiCad and of the project, as in the chooser of KiCad.

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": {
      "lib_id": "<lib_id>",
      "item_type": "<item_type>",
      "max_width_px": "<max_width_px>",
      "max_height_px": "<max_height_px>"
    },
    "name": "render_library_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
pagesNoOptional names of the pages to draw, from the summary or from an error (a symbol has one page for each unit and body style, for example "74HC00_unit2"). All pages if empty.
layoutNo"tiles": the smallest text gets at least 15 pixels (the height of a 1.27 mm text at 300 DPI), never less than 300 DPI. An item that does not fit in one image at that scale is divided into tiles that overlap. An item that fits gets one image, as large as the limit permits. "overview": one image of the full item, as large as the limit permits; its text can be not legible.tiles
lib_idYesThe library ID, for example "Device:R" or "Resistor_SMD:R_0603_1608Metric".
regionNoOptional [x, y, width, height] in mm, a part of the page to draw (the origin is the top left corner of the page; the summary gives the page sizes). Use it to see a part in more detail. The region applies to each page: a page that it is not on gets no image.
item_typeYes"symbol" or "footprint".
max_imagesNoThe tool gives an error, not images, when the item needs more images than this.
output_dirNoOptional directory to keep the SVG and PNG files. The tool replaces files with the same names, and does not delete other files. The summary gives the files that it wrote.
max_width_pxYesThe largest image width that your vision input reads with no reduction, from 64 to 8192 pixels.
project_pathNoOptional project (.kicad_pro, .kicad_sch, .kicad_pcb or its directory), to include its libraries.
max_height_pxYesThe largest image height that your vision input reads with no reduction. If your input also has a limit of the pixel count, give a width and a height whose product is in that limit.
include_hiddenNoSymbol only: also draw the hidden pins and the hidden fields.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it explains that kicad-cli renders SVG and the tool rasterizes to PNG with the 'KiCad Default' background, that libraries come from the installed KiCad and project library tables, that exceeding max_images yields an error instead of images, and that output_dir files are overwritten but other files are not deleted. It stops short of stating whether the tool is read-only in the no-output_dir case or commenting on cost/latency of multi-tile renders.

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?

Purpose is front-loaded, then usage, then rendering mechanics and library resolution — a sensible order with no filler. The closing paragraph on kicad-cli internals and the awkward line-wrap artifacts cost it a point, since the agent only needs the theme/background fact, not the SVG pipeline detail.

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 an 11-parameter tool with no annotations and no output schema, the definition covers purpose, alternatives, rendering pipeline, library resolution, error behavior, and file side effects — enough to call it correctly. Minor gaps remain around return delivery (how the images are handed back) and permission or read-only implications when output_dir is used.

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 schema already documents every parameter, making 3 the baseline. The description adds only indirect hints ('the summary gives the files that it wrote', 'the summary gives the page sizes') but no syntax or format guidance that the schema does not already contain.

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 first sentence gives a specific verb and resource ('Render a symbol or a footprint of a KiCad library as PNG images') and the following sentences distinguish it from the sibling getters, which 'give the exact values'. An agent can tell this is a visual-rendering tool rather than a data-retrieval one without opening the 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?

It names the exact use case ('a visual check: the layout, the texts, the pin 1 mark, the silkscreen on the pads, items that overlap') and routes numeric/attribute questions to get_library_symbol and get_library_footprint. When-to-use and which-alternative are both stated explicitly.

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