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
| Name | Required | Description | Default |
|---|---|---|---|
| pages | No | Optional 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. | |
| layout | No | "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_id | Yes | The library ID, for example "Device:R" or "Resistor_SMD:R_0603_1608Metric". | |
| region | No | Optional [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_type | Yes | "symbol" or "footprint". | |
| max_images | No | The tool gives an error, not images, when the item needs more images than this. | |
| output_dir | No | Optional 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_px | Yes | The largest image width that your vision input reads with no reduction, from 64 to 8192 pixels. | |
| project_path | No | Optional project (.kicad_pro, .kicad_sch, .kicad_pcb or its directory), to include its libraries. | |
| max_height_px | Yes | The 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_hidden | No | Symbol only: also draw the hidden pins and the hidden fields. |