Skip to main content
Glama

rename_library_footprint

Give a footprint of a project library an other name, as "Rename" of the library tree of the footprint editor of KiCad 10 does.

Instructions

Give a footprint of a project library an other name, as "Rename" of the library tree of the footprint editor of KiCad 10 does.

KiCad saves the footprint as ".kicad_mod", then removes the old file. The Value gets the new name when it was equal to the old name. As the rename dialog, the tool removes the white space at the two ends of the name. A name with one of the characters \ / : " < > | * ? is an error: KiCad changes them to "_" in the file name, and reads the name from the file name.

A name that the library has already is an error: the tool does not replace a footprint. On a file system with no difference of case in file names (Windows, macOS), a change of only the case of the name is one file: KiCad 10.0.7 and later delete the old footprint first, then save the new one, and so does the tool. With KiCad 10.0.6 (it saves first, then deletes, and thus removes the footprint) the tool refuses such a rename: do it in two steps.

KiCad does not change the uses of the old name, and neither does the tool: the answer gives as a warning the Footprint fields of the placed symbols (also of their variants) and of the symbols of the project symbol libraries, and the footprints of the board of the project, that have the old library ID.

The library must be a footprint library of the project table, in the version of the installed KiCad (else: upgrade_project_libraries first). A footprint that is not on F.Cu is refused. KiCad saves the footprint (kicad-cli), and a second save must give the same bytes. KiCad must not have the project open. The installed KiCad must be KiCad 10.0.

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": {
      "project_path": "<project_path>",
      "lib_id": "<lib_id>",
      "new_name": "<new_name>"
    },
    "name": "rename_library_footprint"
  }
}

Input Schema

NameRequiredDescriptionDefault
lib_idYesThe footprint, "<library>:<footprint>", of a library of the project table.
new_nameYesThe new name.
project_pathYesThe .kicad_pro file or the project folder.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.0

TDQS

A4.2/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does: it discloses the underlying file mechanics (save as <new name>.kicad_mod, then delete the old file), the Value-field side effect, whitespace trimming, the illegal-character set and how KiCad maps it, refusal to overwrite an existing name, the platform-specific case-rename hazard, and the requirement that KiCad not have the project open. It also warns that references to the old library ID are not rewritten, which is exactly the kind of destructive side effect an agent must know before calling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The most important facts (what it does, file save/delete order, collision refusal, dangling-reference warning) are front-loaded, but the prose is lengthy, has awkward grammar, and some clauses restate the same idea twice ('KiCad does not change the uses of the old name, and neither does the tool'). It is informative rather than padded, yet an agent must wade through a lot of version-specific detail to reach the operational rules.

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?

An output schema exists, so the warning payload (placed symbols, variants, project symbol libraries, board footprints holding the old ID) needs no further explanation. Given the mutation's complexity, the definition covers failure modes, environment preconditions, and version gates thoroughly enough that an agent could decide and call correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline would be 3; the description earns more by constraining new_name semantically (leading/trailing whitespace stripped, nine forbidden characters become '_', a case-only change behaves differently per KiCad patch level) and by restricting lib_id to a library of the project table. project_path gets no additional detail beyond the schema, which keeps it from a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb+resource: renaming a footprint of a project library, anchored to KiCad's own 'Rename' action in the footprint editor. That makes the object ('footprint', not symbol) clear enough to separate it from rename_library_symbol, though the sibling is never named explicitly.

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?

Prerequisites and exclusions are spelled out concretely: the library must be in the project table for the installed KiCad version, otherwise upgrade_project_libraries must run first; footprints not on F.Cu are refused; KiCad must not have the project open. The one uncovered case (case-only rename on KiCad 10.0.6) is explicitly redirected to a two-step workflow.

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

Deploy Server

Other Tools