gds2palace-mcp
v0.11.0MCP server for gds2palace: inspect GDSII layouts and stackups, check and generate AWS Palace models
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_stackups
List the IHP stackup XML files that ship with gds2palace (SG13G2, SG13CMOS5L), with their paths and descriptions. A model can use one of these names or a path to its own stackup file. Also returns the installed versions of this MCP server, gds2palace and the packages its tools use.
inspect_stackup
Summarize a gds2palace XML stackup: variables, materials, dielectrics, conductor/via/sheet layers with GDS layer numbers and z positions (bottom to top), derived layers, and free GDS layer numbers for ports. stackup_file: path, or the name of a bundled stackup such as 'SG13G2_FEM_200um.xml'. variable_overrides: e.g. {"total_thickness": 100}, the same as read_substrate() takes.
| Parameter | Type | Description |
|---|---|---|
stackup_file * | string | |
variable_overrides |
inspect_gds
Summarize a GDSII layout per layer/datatype: shape count, extent, smallest shape side and smallest gap (for choosing refined_cellsize and merge_polygon_size). The cell is chosen like gds2palace's read_gds(): cellname, else the first top-level cell. With stackup_file, each layer also shows its role in the stackup (conductor, via, derived layer operand, ...) or that gds2palace ignores it, and stackup layers without shapes are listed.
| Parameter | Type | Description |
|---|---|---|
gds_file * | string | |
cellname | string | |
stackup_file | string | |
variable_overrides |
check_layout_complexity
Estimate how complex a layout is for FEM before meshing: polygon count per layer (only layers the stackup uses, from the cell hierarchy without flattening, so it is fast even for dense fill and via arrays), layout size, polygon density, which layers dominate, and hints for simplify_layout. A report, not a pass/fail verdict: there is no measured polygon limit. Run it on unknown or tape-out layouts before writing the model script.
| Parameter | Type | Description |
|---|---|---|
gds_file * | string | |
stackup_file * | string | |
cellname | string | |
variable_overrides |
measure_holes
Measure the openings in ground planes BEFORE simplify_layout fills them: per metal layer the repeated opening sizes (at least mincount of one size: cheesing, tiled meshes - holes inside tiles and gaps between side-by-side tiles alike, measured on the merged layer) and the other openings, which stay (circuit openings, pads). Show the result to the user; hole sizes are measured, never assumed.
| Parameter | Type | Description |
|---|---|---|
gds_file * | string | |
stackup_file * | string | |
cellname | string | |
mincount | integer | |
variable_overrides |
simplify_layout
Simplify a layout for EM simulation and write it to a new GDS file (default <name>_simplified.gds; the original is never changed). Same operations as setupEM's Tools > Simplify GDS (gds_prepare_for_EM), with metal and via layers from the stackup: remove_floating_fill: remove unconnected dummy fill (groups of at least fill_mincount pieces of the same size, between fill_minsize and fill_maxsize um). fill_ground_holes: fill the repeated openings of ground planes, measured in the layout at run time (merged layers: holes inside tiles and gaps between tiles); openings of…
| Parameter | Type | Description |
|---|---|---|
gds_file * | string | |
stackup_file * | string | |
cellname | string | |
exclude_layers | ||
fill_cutouts | boolean | |
fill_ground_holes | boolean | |
fill_maxsize | ||
fill_mincount | integer | |
fill_minsize | number | |
ground_hole_mincount | integer | |
max_hole_area | ||
merge_per_layer | boolean | |
merge_vias | boolean | |
output_file | string | |
remove_floating_fill | boolean | |
variable_overrides | ||
via_merge_size | number |
suggest_mesh_size
Suggest refined_cellsize from the layout, BEFORE asking the user about mesh settings. Looks at the top 2 conductor layers of the stackup that have shapes in the layout for traces (length >= 10x width and >= 20 % of the larger layout side) and coupled lines (gap <= 2x the narrower line width, parallel for >= 20 % of the larger layout side), and suggests refined_cellsize for accurate (default 2 um) and quick (default 5 um) models. Quick: the smallest flagged width or gap, rounded down to 0.5 um, if that is smaller than the default (one cell across it, enough for design work).…
| Parameter | Type | Description |
|---|---|---|
gds_file * | string | |
stackup_file * | string | |
cellname | string | |
variable_overrides |
check_ports
Check the ports against the layout BEFORE meshing, with gds2palace's port geometry: a via port line must lie on metal of both its layers (from/to), an in-plane port rectangle must touch metal of its target layer at both ends along its direction. Also: port layer collisions with the stackup, several shapes on one port layer (only one is used), unknown layer names, direction. Either script_path (ports, layout and stackup taken from the model script), or gds_file + stackup_file + ports_list ([{portnumber, source_layernum, from_layername, to_layername, direction} or {...,…
| Parameter | Type | Description |
|---|---|---|
cellname | string | |
gds_file | string | |
ports_list | ||
script_path | string | |
stackup_file | string |
propose_ports
Propose via ports for a layout without port shapes: from IHP pin shapes (datatype 2) and text labels on metal layers (a label beside a line end marks that end; integer labels give the port numbers), else from open trace ends at the outer edge of the top 2 metal layers. The reference is the closest solid ground metal below the port, else SUBGND. Proposals only: show them to the user (e.g. preview_layout) and let them confirm positions, references and Z0 before add_ports.
| Parameter | Type | Description |
|---|---|---|
gds_file * | string | |
stackup_file * | string | |
cellname | string |
add_ports
Write a copy of the layout (default <name>_ports.gds; the original is never changed) with via port lines on their port layers. ports_list: [{"portnumber": 1, "line": [x1, y1, x2, y2], "source_layernum": 201}] (horizontal or vertical lines, e.g. from propose_ports; layer default 200 + portnumber). Only after the user confirmed the ports. Then add the add_port lines to the script and run check_ports.
| Parameter | Type | Description |
|---|---|---|
gds_file * | string | |
ports_list * | array | |
cellname | string | |
output_file | string |
check_model_script
Check a gds2palace model script without running it: settings keys that gds2palace doesn't read (gds2palace silently ignores typos such as 'nogui'), missing required settings, port layers not added to the layer list, removed or legacy settings. Run it before generate_model.
| Parameter | Type | Description |
|---|---|---|
script_path * | string |
generate_model
Run a gds2palace model script (python model.py) without gmsh windows and check its output: config.json, mesh, port_information.json and run_sim in palace_model/<model>_data, with mesh node/tetrahedron counts and an estimate of the Palace unknowns and peak RAM (estimate: tell the user before they start Palace, especially for AMR). Does not run the Palace solver: that is submit_simulation's job. Run check_repeated_patterns first: if it recommends preprocessing, ask the user before meshing. The output goes to <script>_generate.log; show_log (default) opens a window on the…
| Parameter | Type | Description |
|---|---|---|
script_path * | string | |
save_geometry | boolean | |
show_log | boolean | |
timeout_s | integer |
wait_for_model
Keep waiting for a model generation that generate_model reported as still_running (after the user said to keep waiting). Returns the full result when it finished, else the status again.
| Parameter | Type | Description |
|---|---|---|
job_id * | string | |
timeout_s | integer |
check_repeated_patterns
Check a layout for repeated patterns BEFORE generate_model: via fields, dummy fill, tiles with holes (cheesing) - the patterns that can make meshing take very long. Read from the cell hierarchy without flattening (each cell inspected once, counted as often as it is placed), so it is fast even for huge layouts. Returns preprocessing_candidates with the suggested simplify_layout option each, and recommend_preprocessing. If preprocessing is recommended, show the candidates to the user and ask whether to simplify first; don't mesh before they decided.
| Parameter | Type | Description |
|---|---|---|
gds_file * | string | |
stackup_file * | string | |
cellname | string | |
mincount | integer | |
variable_overrides |
show_in_gmsh
Open the model in the gmsh GUI on the user's screen, so that they can look at it. Returns at once; the window stays open. You (the assistant) don't see the window: ask the user. path: the model script, its palace_model/<model>_data folder, or a .msh / .geo_unrolled file. what: "mesh" (the meshed model) or "geometry" (the unmeshed geometry, which needs generate_model with save_geometry=True first).
| Parameter | Type | Description |
|---|---|---|
path * | string | |
what | string |
preview_layout
Render the layout as a PNG with ports labelled, so that you can see it: check port positions against the feed lines, see the structure type. Colors: for IHP SG13G2 (no stackup_file, or an SG13... stackup) the KLayout colors and fill patterns. For any other technology pass stackup_file: colors then come from the stackup materials, semi-transparent and drawn bottom to top, and the result has a legend (layer, name, color). style forces "sg13g2" or "stackup". Without a stackup, IHP layer numbers are assumed: other technologies get misleading colors. The image is sent…
| Parameter | Type | Description |
|---|---|---|
gds_file * | string | |
cellname | string | |
fill_alpha | number | |
pattern_scale | integer | |
ports | ||
save_png | string | |
send_image | boolean | |
stackup_file | string | |
style | string | |
variable_overrides | ||
width_px | integer |
list_targets
The computers where submit_simulation may run Palace, as the user configured them in their targets file (~/.gds2palace_mcp/targets.toml): simulation servers (ssh) and the local machine (WSL on Windows, Linux). Without that file, Palace isn't run by these tools: the user runs run_sim on their Linux machine as before. check: also connect to each target: reachable, run command found, RAM, and the Palace processes running there now (counts and user names). A target refuses to start a run while Palace runs there.
| Parameter | Type | Description |
|---|---|---|
check | boolean |
submit_simulation
Run Palace for a generated model on a target from list_targets. Returns at once; the run takes minutes to hours. BEFORE calling it, tell the user which target, the unknowns and RAM estimate from generate_model, and, for an ssh target, that the mesh and config.json are copied to that computer; submit only after the user agreed. Never pick a target the user didn't name when several are configured. path: the model script or its palace_model/<model>_data folder (after generate_model). target: a target name from list_targets (may be left empty when only one is configur…
| Parameter | Type | Description |
|---|---|---|
path * | string | |
overwrite | boolean | |
show_log | boolean | |
target | string |
simulation_status
State of a run started with submit_simulation: running, finished, failed or stopped; progress from the Palace log (MPI processes, port n/m, frequency step, AMR iteration), RAM of the run, 'did NOT converge' lines, the last log lines, and the Palace processes of others on the target (counts and user names). path: the model script or its palace_model/<model>_data folder.
| Parameter | Type | Description |
|---|---|---|
path * | string |
fetch_results
After a run finished: copy its results back from an ssh target into palace_model/<model>_data (the log is saved there as palace.log), make the Touchstone files (combine_snp) and return the summarize_results summary. include_fields: also copy the paraview field dumps (large). partial: copy what is there while the run still goes (e.g. finished AMR iterations). delete_remote: delete the run folder on the ssh target afterwards - only when the user asks.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
delete_remote | boolean | |
include_fields | boolean | |
partial | boolean |
summarize_results
Summary of finished (or running) Palace simulations, with gds2palace's palace_summary: unknowns (degrees of freedom), mesh elements, run time, peak RAM, error indicator, and for adaptive mesh refinement (AMR) the change of S between iterations (Max |dS|). Also lists the Touchstone files found, and counts 'did NOT converge' in log files saved in the run folder. path: the model script, its palace_model/<model>_data folder (with the results in it: fetched by fetch_results, or copied back by the user), or a folder with several runs (searched recursively). plot: also return…
| Parameter | Type | Description |
|---|---|---|
path * | string | |
plot | boolean |
sparameter_summary
Numbers from Touchstone files (.s1p, .s2p, ... from Palace/combine_snp, other simulators or a VNA): ports, frequency range, reference impedances, passivity and reciprocity checks, and per S-parameter the dB minimum/maximum with frequency, plus dB/phase at the given frequencies. parameters: e.g. ["S11", "S21"]; default all Smn with m >= n (up to 4 ports). Prefer this over plots when you need exact values.
| Parameter | Type | Description |
|---|---|---|
files * | array | |
frequencies_ghz | ||
parameters |
plot_sparameters
Plot S-parameters as images for you to look at, with plot_snp: dB and phase per parameter, one curve per file (e.g. simulated vs measured), optionally Smith charts of the reflection parameters (smith; zoom = |Gamma| <= 0.5). The images are sent to the assistant. send_image=False with save_png only saves them locally. parameters: default ["S11", "S21"]. For a window on the user's screen, use show_sparameters.
| Parameter | Type | Description |
|---|---|---|
files * | array | |
parameters | ||
save_png | string | |
send_image | boolean | |
smith | boolean | |
width_px | integer | |
zoom | boolean |
show_sparameters
Open the interactive plot_snp window(s) on the user's screen (zoom, pan, save). Returns at once. You don't see the windows; ask the user. parameters: default S11.
| Parameter | Type | Description |
|---|---|---|
files * | array | |
parameters | ||
smith | boolean | |
zoom | boolean |
transform_sparameters
Make a new Touchstone file from one (the input is never changed), and return how its ports relate to the input's. The other S-parameter tools then work on the new file. operation: - "mixed_mode": differential and common-mode S-parameters. pairs: [[positive, negative], ...], e.g. [[1, 3], [2, 4]] for a differential line on 4 ports, [[2, 3]] for a balun with single-ended port 1. Returns names (file S21 -> Sdd21), Sdd/Sds, mode conversion (Scd, Scs) and CMRR per pair, and the values at frequencies_ghz. Reference impedances: differential 2 x z0 (100 ohm), commo…
| Parameter | Type | Description |
|---|---|---|
file * | string | |
operation * | string | |
frequencies_ghz | ||
output_file | string | |
pairs | ||
second_file | string | |
terminations | ||
z0_ohm |
figures_of_merit
Figures of merit of a passive from its Touchstone file: values at frequencies_ghz, and min/max (and the worst case) inside fmin_ghz-fmax_ghz. device and ports (port roles; defaults in brackets): - "transformer" {"primary": 1, "secondary": 2}: L1, L2, k, Q1, Q2, maximum available gain / minimum insertion loss, optimum source and load impedance, self-resonances. - "balun" {"input": 1, "outputs": [2, 3]} (positive output first): insertion loss, amplitude and phase imbalance, CMRR, return losses. - "coupler" (input, through, coupled, isolated: no defaults): couplin…
| Parameter | Type | Description |
|---|---|---|
device * | string | |
file * | string | |
fmax_ghz | ||
fmin_ghz | ||
frequencies_ghz | ||
length_um | ||
pairs | ||
plot | boolean | |
ports |
passive_values
L (or C), R and Q of an inductor or capacitor from a 1-port or 2-port Touchstone file: low-frequency value, peak Q and its frequency, self-resonance frequency (SRF), and values at the given frequencies. device: "inductor" or "capacitor". connection (required for 2-port files, not used for 1-port files): "differential" (Z11-Z12-Z21+Z22, port to port, floating), "single_ended" (1/Y11, port 2 grounded) or "series" (-2/(Y12+Y21), pi-model series branch). Peak Q and SRF differ a lot between them: ask the user how the device is connected in the circuit, don't pick one yo…
| Parameter | Type | Description |
|---|---|---|
file * | string | |
connection | string | |
device | string | |
frequencies_ghz | ||
plot | boolean |
fit_equivalent_circuit
Lumped-element equivalent circuit (SPICE subcircuit) from a Touchstone file, with snp2le (https://github.com/iic-jku/snp2le, command-line mode; must be installed: pip install snp2le). structure: a physical model, one of inductor-pi, inductor-wideband, inductor-ct (3-port), mim-cap, tline-rlgc, wilkinson-inphase, wilkinson, balun (4-port), branchline (4-port). universal=True instead: a vector-fit model of any network (order = max model order, default 6). Propose the structure (from the device and port count) and the extraction frequency fext_ghz (structure mode, default…
| Parameter | Type | Description |
|---|---|---|
file * | string | |
fext_ghz | ||
fmax_ghz | ||
fmin_ghz | ||
netlist_format | string | |
order | ||
output_file | string | |
show_plot | boolean | |
structure | string | |
universal | boolean |