Skip to main content
Glama

lib_set_model_source

Writes the datafile-link Location on a footprint model so it embeds in compiled libraries and no longer goes missing from used output. Use the exact source-library string from a known-good model.

Instructions

Write the datafile-link Location (source library) on a footprint model.

A footprint whose datafile link has an empty Location resolves in the SchLib editor by name but cannot embed into a self-contained compiled library, so the footprint goes missing in the used/compiled output even though the package's own compile reports no error. This writes Location so the model is embeddable. Location is set in place (never through AddDataFileLink with a path, which wedges AD26). Targets PCBLIB models matching model_name, or all PCBLIB models when it is empty.

IMPORTANT: get the exact source_library string from a known-good model that already embeds correctly. Read it via lib_get_component_details, whose models array now shows each model's location and use_component_library. This tool writes exactly what you pass; it does not infer the format.

Args: component_name: the component's LibReference. source_library: the source-library reference written into Location. model_name: optional footprint model name to target one model. use_component_library: optional; sets the embed-vs-search flag. library_path: optional .SchLib path; defaults to the focused lib.

Returns: {"success": true, "component": "...", "source_library": "...", "models_updated": N}.

Input Schema

NameRequiredDescriptionDefault
model_nameNo
library_pathNo
component_nameYes
source_libraryYes
use_component_libraryNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.7/5.0
Behavior4/5

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

No annotations, so the description carries the full load, and it does so well: it discloses the in-place write semantics, the blast radius (all PCBLIB models when model_name is empty), the AD26 wedging hazard, and that the tool writes exactly what is passed without inferring format. It omits failure modes such as a nonexistent component or an unopened library, so it is not fully exhaustive.

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?

Front-loaded with the action sentence, then the rationale, the hazard warning, and a structured Args/Returns block. Slightly long, and some of the rationale is repeated in spirit, but nearly every sentence carries actionable information.

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, yet the description still states the return shape, and it covers prerequisites, scoping, hazards, and defaults. For a five-parameter mutation tool with no annotations, this leaves an agent nothing essential to guess.

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

Parameters5/5

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

Schema coverage is 0%, and the description compensates for every parameter: component_name as the LibReference, source_library as the reference written into Location, model_name as the single-model filter with empty meaning all, use_component_library as the embed-vs-search flag, and library_path defaulting to the focused library.

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?

States a specific verb and resource: "Write the datafile-link Location (source library) on a footprint model." It also distinguishes itself from the related write path used elsewhere (AddDataFileLink with a path), so an agent can tell it apart from siblings like lib_set_model_name, lib_remove_model, and lib_clear_source_library.

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?

Gives an explicit when: footprints with empty Location resolve by name but cannot embed into a compiled library and silently go missing. Gives an explicit when-not: never use AddDataFileLink with a path (wedges AD26). And routes the agent to lib_get_component_details to obtain a known-good string before calling.

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