run_tcl
Executes a Tcl script inside OrCAD Capture's interpreter to access its database API and commands, returning the result. Use it for schematic tasks no dedicated tool covers.
Instructions
Run a Tcl script in Capture's interpreter (Tcl 8.4: no {*}, dict, lassign, lmap, min()/max() in expr) and return its result.
Gives full access to Capture's database API (DboSession, DboDesign, Dbo* classes; see Cadence's OrCAD_Capture_TclTk_Extensions.pdf) and Capture commands (Menu, PlaceWire, ...). Use only when no dedicated tool fits, and tell the user what the script changes. Disabled when ORCAD_MCP_ALLOW_TCL=0.
Refused when the script uses an undocumented Capture GUI command known to crash Capture (GetWindows, GetActiveWindow, GetActivePage, ...) unless allow_unsafe=true. Never call a method on a Dbo result without checking it for NULL (e.g. the net of an unconnected pin).
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": {
"script": "<script>"
},
"name": "run_tcl"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | ||
| timeout_s | No | ||
| allow_unsafe | No |