Skip to main content
Glama

lib_set_current_component

Sets a named component as the active SchLib selection so bulk pin, rectangle, or parameter edits target that component instead of the last UI-selected one.

Instructions

Make a named component the editor's current selection in the active SchLib.

Required before bulk-editing a specific component's pins, rectangle, or parameters via obj_modify / obj_batch_modify on a SchLib. The asymmetry it fixes: lib_get_component_details is a read-only fetch and does NOT update the editor's current component, so subsequent obj_modify on the SchLib's ePin / eRectangle / eParameter iterators silently hits whatever component was last UI-selected -- usually NOT the one you just read.

Use this between switching components: lib_set_current_component("MyIC") modify_objects("ePin", scope="active_doc", filter="Location.X=200", set="Orientation=2") lib_set_current_component("MyOtherPart") modify_objects("ePin", scope="active_doc", filter="Location.X=200", set="Orientation=2")

Args: component_name: Component name (LibRef) in the active SchLib.

Returns: Dict with success + name, or an error if no SchLib is active or the component name isn't found in it.

Input Schema

NameRequiredDescriptionDefault
component_nameYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does most of it: it discloses that the tool mutates editor selection state, why that matters for subsequent obj_modify calls, and the two error conditions (no active SchLib, name not found). It does not address undo/state persistence across document switching, so a small gap remains.

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 purpose, then motivation, then a worked example, then args/returns — well organized. The prose sentence introducing the example slightly duplicates what the code shows, so it is a touch longer than strictly necessary, but every block is useful.

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?

Despite an output schema existing (so return values need not be explained), the description still notes the success/name dict and error paths. Purpose, prerequisite ordering, side effects, and argument meaning are all present — an agent could call it correctly on first try.

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 0%, so the description must compensate, and it does: 'component_name: Component name (LibRef) in the active SchLib' establishes that the value is a LibRef string and must resolve within the active document. It stops short of case-sensitivity or naming-convention detail, but the meaning is clear.

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?

Names a specific verb and resource ('Make a named component the editor's current selection in the active SchLib') and explicitly contrasts it with the sibling lib_get_component_details, which is read-only and does not move the editor's selection. An agent can tell exactly what this does and what it is not.

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-to-use rule ('Required before bulk-editing a specific component's pins, rectangle, or parameters via obj_modify / obj_batch_modify on a SchLib') plus the failure mode if skipped (modify hits whatever component was last UI-selected). The four-line code snippet shows the correct interleaving with modify_objects, leaving nothing to inference.

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