{
 "server": "https://circuit.synthcity.org/api/mcp",
 "transport": "streamable-http",
 "tools": [
  {
   "name": "new",
   "description": "Create an empty circuit; returns its netlist and share link.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "title": {
      "type": "string",
      "description": "Circuit title."
     }
    },
    "required": [],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "open",
   "description": "Open a gallery or preset circuit by name, netlist text, or a share link; returns its netlist and share link.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "source": {
      "type": "string",
      "description": "A gallery or preset name or file (see gallery), netlist text, or a share link."
     }
    },
    "required": [
     "source"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "addPart",
   "description": "Add a part: R, C, L, POT, D, NPN, PNP, NJF, PJF, OPAMP, OTA, V, I, IN (audio input), OUT (output probe), GND, RAIL, LABEL, or macro:<NAME> (built-ins: OPAMP_MACRO, OTA_PAIR, OTA_POLE, DIODE_LIMITER, SALLEN_KEY, or any .subckt in the document).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "type": {
      "type": "string",
      "description": "Part type (see summary)."
     },
     "value": {
      "type": "string",
      "description": "Value: 10k, 4k7, 2.2u, a model name, \"DC 12\" for rails / sources."
     },
     "name": {
      "type": "string",
      "description": "Card name (default: next free, e.g. R3; rails: Vcc)."
     },
     "at": {
      "type": [
       "string",
       "array",
       "object"
      ],
      "description": "Grid position: \"x,y\", [x, y] or {x, y}. Omit to auto-place."
     },
     "near": {
      "type": "string",
      "description": "Auto-place next to this part."
     },
     "rot": {
      "type": "integer",
      "description": "Quarter turns clockwise (0..3). Two-terminal parts are vertical at 0 (pin 1 on top).",
      "minimum": 0,
      "maximum": 3
     },
     "horizontal": {
      "type": "boolean",
      "description": "Lay a two-terminal part left to right (pin 1 on the left); same as rot 3."
     }
    },
    "required": [
     "doc",
     "type"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "removePart",
   "description": "Delete a part and the wire stubs that only served it (a module: its cables and its definition when unused).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "part": {
      "type": "string",
      "description": "Part name, e.g. R1."
     }
    },
    "required": [
     "doc",
     "part"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "setValue",
   "description": "Set a part value (engineering units), a pot (total value, or pos=0..1 for the wiper), or a .param by name.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "part": {
      "type": "string",
      "description": "Part name or .param name."
     },
     "value": {
      "type": "string",
      "description": "New value, e.g. 22k, 4.7n, pos=0.3, DC 9."
     }
    },
    "required": [
     "doc",
     "part",
     "value"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "rotate",
   "description": "Rotate a part by quarter turns (and/or mirror it); its wires re-route.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "part": {
      "type": "string",
      "description": "Part name."
     },
     "turns": {
      "type": "integer",
      "description": "Quarter turns clockwise (default 1)."
     },
     "flip": {
      "type": "boolean",
      "description": "Mirror horizontally."
     }
    },
    "required": [
     "doc",
     "part"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "move",
   "description": "Move a part to a grid position; its wires re-route.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "part": {
      "type": "string",
      "description": "Part name."
     },
     "at": {
      "type": [
       "string",
       "array",
       "object"
      ],
      "description": "Grid position: \"x,y\", [x, y] or {x, y}. Omit to auto-place."
     }
    },
    "required": [
     "doc",
     "part",
     "at"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "connect",
   "description": "Connect a pin to another pin or to a net (gnd, a rail name like Vcc, or any net name). Wires are auto-routed with the editor's A* router; long or blocked runs get net labels.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "from": {
      "type": "string",
      "description": "Pin: R1.2 (1-based) or R1.b, A1.out, A1.-, Q1.c."
     },
     "to": {
      "type": "string",
      "description": "Pin, or a net name: gnd, Vcc, out, ..."
     }
    },
    "required": [
     "doc",
     "from",
     "to"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "disconnect",
   "description": "Disconnect a pin from its net (the rest of the net stays connected and is re-routed).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "pin": {
      "type": "string",
      "description": "Pin, e.g. R1.2."
     }
    },
    "required": [
     "doc",
     "pin"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "macro_create",
   "description": "Collapse parts into a new .subckt macro block (nets leaving the group become ports).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "parts": {
      "type": "array",
      "items": {
       "type": "string",
       "description": "Part name"
      },
      "description": "Parts to collapse."
     },
     "name": {
      "type": "string",
      "description": "Macro name (becomes the .subckt name)."
     }
    },
    "required": [
     "doc",
     "parts",
     "name"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "macro_expand",
   "description": "Replace a macro block with its parts, laid out where the block was.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "part": {
      "type": "string",
      "description": "Macro instance name, e.g. X1."
     }
    },
    "required": [
     "doc",
     "part"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "layout",
   "description": "Re-arrange the whole schematic with the importer's automatic layout (layered placement, then routing).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "list",
   "description": "List parts (with pins and nets), nodes, knobs, ;@ bindings, .params, models and subcircuits, and for patches the modules, jacks and cables.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "what": {
      "type": "array",
      "items": {
       "type": "string",
       "enum": [
        "parts",
        "nodes",
        "knobs",
        "bindings",
        "params",
        "models",
        "modules"
       ],
       "description": ""
      },
      "description": "Sections (default all; modules = the patch level: modules, jacks, cables)."
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "netlist_export",
   "description": "Export the netlist: cir (circuit-runtime, with *@cs layout), spice (no layout) or ngspice (op-amp / OTA / inverter cards translated).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "format": {
      "type": "string",
      "enum": [
       "cir",
       "spice",
       "ngspice"
      ],
      "description": "Default cir."
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "simulate",
   "description": "Run the circuit on circuit-runtime: an input source, knob automation, audio out (wav/f32), node probes, and measures (level, spectrum peaks, frequency response with cutoff / slope / peak / notches).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "input": {
      "type": [
       "string",
       "object"
      ],
      "description": "Source: \"saw:A1\", \"square:110\", \"sine:1k@0.2\" (freq@amplitude V), \"noise\", \"impulse\", \"sweep\", \"silence\", \"file:in.wav\"; or {type, note|freq, amp, file}. Default saw:A2 @ 0.5 V. On this door, a recording is a data: URI (data:audio/wav;base64,…; mono, <= 48000 Hz, <= 10 s) instead of a file."
     },
     "duration": {
      "type": "number",
      "description": "Seconds to render (default 1; file inputs default to the file length).",
      "minimum": 0.001,
      "maximum": 120
     },
     "sampleRate": {
      "type": "integer",
      "description": "Default 48000.",
      "minimum": 8000,
      "maximum": 384000
     },
     "knobs": {
      "type": "array",
      "items": {
       "type": [
        "string",
        "object"
       ],
       "description": "\"cutoff=0..1:8s\", \"res=0.7\", or {name, from, to, start, end}. Positions are 0..1 like the knob tray."
      },
      "description": "Knob automation."
     },
     "probes": {
      "type": "array",
      "items": {
       "type": "string",
       "description": "Node name"
      },
      "description": "Nodes whose voltage to record."
     },
     "measures": {
      "type": "array",
      "items": {
       "type": "string",
       "enum": [
        "level",
        "spectrum",
        "response"
       ],
       "description": ""
      },
      "description": "Default level + spectrum; response adds the frequency response."
     },
     "response": {
      "type": "object",
      "properties": {
       "method": {
        "type": "string",
        "enum": [
         "impulse",
         "sweep"
        ],
        "description": "Default impulse."
       },
       "amp": {
        "type": "number",
        "description": "Excitation amplitude (V). Default 1 V impulse / 0.1 V sweep."
       },
       "seconds": {
        "type": "number",
        "description": "Excitation length."
       },
       "full": {
        "type": "boolean",
        "description": "Return every 1/12-octave point (default ~40)."
       }
      },
      "required": [],
      "additionalProperties": false
     },
     "preroll": {
      "type": "number",
      "description": "Seconds of silence first so the circuit settles (default 0.1)."
     },
     "notes": {
      "type": "array",
      "items": {
       "type": [
        "string",
        "number",
        "object"
       ],
       "description": "\"C4\", 60, or {note, start?, duration?, velocity?} (seconds, 1..127)."
      },
      "description": "Play notes on the patch's Keyboard (polyphonic patches get independent voices, like the app). Without input, a patch with an audio input gets the synth saw per voice."
     },
     "hold": {
      "type": "number",
      "description": "Default note length (s; default 60% of duration)."
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "fit",
   "description": "Fit component values / device parameters / pot positions so the circuit reproduces a recording: target audio + the input that produced it. Gradient-based (Levenberg-Marquardt in log-values, or L-BFGS / Adam), with bounds, optional E-series snapping and an identifiability report (which parameters the audio cannot pin down).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "target": {
      "type": "string",
      "description": "The recording to match as a data: URI (data:audio/wav;base64,…; mono, <= 48000 Hz, <= 10 s)."
     },
     "input": {
      "type": [
       "string",
       "object"
      ],
      "description": "The signal that produced the target: \"file:in.wav\", \"saw:A1\", \"noise@0.3\", ... (as simulate). Default: saw:A2 @ 0.5 V."
     },
     "params": {
      "type": "array",
      "items": {
       "type": [
        "string",
        "object"
       ],
       "description": "\"R1\", \"C3\", \"QPNP.bf\" (all devices with that model), \"Q1.is\", \"A1.gbp\", \"P1.pos\" (pot wiper), \"param:NAME\" (.param); or {name, min, max, init}."
      },
      "description": "Parameters to free."
     },
     "loss": {
      "type": "object",
      "properties": {
       "mrstft": {
        "type": "number",
        "description": "Multi-resolution STFT log-magnitude weight."
       },
       "time": {
        "type": "number",
        "description": "Time-domain weight."
       },
       "level": {
        "type": "number",
        "description": "RMS level weight."
       },
       "harmonics": {
        "type": "object",
        "properties": {
         "f0": {
          "type": "number",
          "description": "Fundamental (Hz)."
         },
         "n": {
          "type": "integer",
          "description": "Harmonics."
         },
         "weight": {
          "type": "number",
          "description": "Weight."
         }
        },
        "required": [],
        "additionalProperties": false
       }
      },
      "required": [],
      "additionalProperties": false
     },
     "method": {
      "type": "string",
      "enum": [
       "lm",
       "lbfgs",
       "adam"
      ],
      "description": "Default lm."
     },
     "iterations": {
      "type": "integer",
      "description": "Default 40.",
      "minimum": 1,
      "maximum": 500
     },
     "snap": {
      "type": "string",
      "enum": [
       "E12",
       "E24"
      ],
      "description": "Snap R/C/L to an E-series at the end (device parameters are re-fitted around them)."
     },
     "skip": {
      "type": "number",
      "description": "Seconds at the start ignored by the loss (start-up transient)."
     },
     "sampleRate": {
      "type": "integer",
      "description": "Simulation rate (default: the target file's rate).",
      "minimum": 8000,
      "maximum": 384000
     },
     "apply": {
      "type": "boolean",
      "description": "Write the fitted (or snapped) values into the document."
     }
    },
    "required": [
     "doc",
     "target",
     "params"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "sensitivity",
   "description": "How each part moves the small-signal response: cutoff (% per %), peak, prominence and passband (dB per %), from exact gradients of the simulator at its operating point.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "params": {
      "type": "array",
      "items": {
       "type": [
        "string",
        "object"
       ],
       "description": "Parameter (as fit). Default: every R, C and L."
      },
      "description": "Parameters to report."
     },
     "from": {
      "type": "number",
      "description": "Lowest frequency (Hz, default 10)."
     },
     "to": {
      "type": "number",
      "description": "Highest frequency (Hz, default 20k)."
     },
     "sampleRate": {
      "type": "integer",
      "description": "Default 48000.",
      "minimum": 8000,
      "maximum": 384000
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "ac",
   "description": "Small-signal response (dB, phase, complex) at chosen frequencies, at chosen knob positions, with its exact Jacobian with respect to the listed parameters (from the simulator's linearised step map, operating-point shift included).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "params": {
      "type": "array",
      "items": {
       "type": [
        "string",
        "object"
       ],
       "description": "Parameter (as fit) to differentiate by."
      },
      "description": "Parameters for the Jacobian (default: none)."
     },
     "freqs": {
      "type": "array",
      "items": {
       "type": "number"
      },
      "description": "Frequencies (Hz). Default: from..to log-spaced."
     },
     "from": {
      "type": "number",
      "description": "Lowest frequency (Hz, default 20)."
     },
     "to": {
      "type": "number",
      "description": "Highest frequency (Hz, default 20k)."
     },
     "points": {
      "type": "integer",
      "description": "Points (default 60).",
      "minimum": 2,
      "maximum": 2000
     },
     "knobs": {
      "type": "object",
      "description": "Knob settings: {P1: 0.3} (pot wiper 0..1) or {\"param:NAME\": value}."
     },
     "sampleRate": {
      "type": "integer",
      "description": "Default 48000.",
      "minimum": 8000,
      "maximum": 384000
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "optimize",
   "description": "Choose values so the small-signal response meets a target: a prototype (lowpass / highpass / bandpass, cutoff, Q, gain, order) or [Hz, dB] points, at one knob setting or at several at once (settings: one target per knob setting, one shared set of values). Optional E-series snapping (most sensitive part first, the rest re-polished after each rounding); apply writes the values into the document.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "params": {
      "type": "array",
      "items": {
       "type": [
        "string",
        "object"
       ],
       "description": "Parameter (as fit)."
      },
      "description": "Parameters to choose."
     },
     "target": {
      "type": "object",
      "description": "{type: \"lowpass\"|\"highpass\"|\"bandpass\", cutoffHz, q?, gainDb?, order?} or {points: [[Hz, dB], ...]}."
     },
     "settings": {
      "type": "array",
      "items": {
       "type": "object",
       "description": "{knobs: {P1: 0.2}, target: {...}, weight?, from?, to?}"
      },
      "description": "Targets at several knob settings (instead of target)."
     },
     "from": {
      "type": "number",
      "description": "Lowest frequency (Hz, default 20)."
     },
     "to": {
      "type": "number",
      "description": "Highest frequency (Hz, default 20k)."
     },
     "snap": {
      "type": "string",
      "enum": [
       "E12",
       "E24"
      ],
      "description": "Snap R/C/L to an E-series."
     },
     "iterations": {
      "type": "integer",
      "description": "Default 60.",
      "minimum": 1,
      "maximum": 500
     },
     "sampleRate": {
      "type": "integer",
      "description": "Default 48000.",
      "minimum": 8000,
      "maximum": 384000
     },
     "apply": {
      "type": "boolean",
      "description": "Write the chosen (or snapped) values into the document."
     }
    },
    "required": [
     "doc",
     "params"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "render_image",
   "description": "Draw the schematic with the editor's renderer: PNG (returned as an image) or SVG text.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "theme": {
      "type": "string",
      "enum": [
       "light",
       "dark"
      ],
      "description": "Default light."
     },
     "scale": {
      "type": "number",
      "description": "Pixels per grid unit (default 20).",
      "minimum": 4,
      "maximum": 80
     },
     "grid": {
      "type": "boolean",
      "description": "Draw the dot grid."
     },
     "format": {
      "type": "string",
      "enum": [
       "png",
       "svg"
      ],
      "description": "Default png (returned as an image)."
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "validate",
   "description": "Check connectivity (unconnected pins, floating nodes, ground), models and subcircuits, that circuit-runtime builds it, and that it converges on a test signal.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "simulate": {
      "type": "boolean",
      "description": "Also build and run 0.25 s of a saw (default true)."
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "gallery",
   "description": "List the bundled example circuits (open any by name).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "filter": {
      "type": "string",
      "description": "Only names / files containing this text."
     }
    },
    "required": [],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "blocks",
   "description": "List the modules addBlock can place: built-ins (VCO, LFO, Envelope, VCA, Mixer, Keyboard, ...) and every preset filter, oscillator and effect as a module.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "filter": {
      "type": "string",
      "description": "Only modules whose name, kind or file contains this text."
     }
    },
    "required": [],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "addBlock",
   "description": "Place a module (patch level): a built-in (vco, lfo, env, vca, mixer, keyboard, drive, ...) or any preset filter / oscillator / effect by name. Like the app, a new module gets the Keyboard's pitch / gate when it has those jacks (the Keyboard appears if missing).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "block": {
      "type": "string",
      "description": "Module: a built-in id or label, or a preset name / file (see blocks)."
     },
     "at": {
      "type": [
       "string",
       "array",
       "object"
      ],
      "description": "Grid position \"x,y\" (default: a free spot)."
     },
     "keyboard": {
      "type": "boolean",
      "description": "Patch it to the Keyboard (default true; ignored for the Keyboard itself)."
     }
    },
    "required": [
     "doc",
     "block"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "patch",
   "description": "Patch a cable between two module jacks (\"VCO1.out\" → \"VCF1.in\"; \"in\" / \"out\" are the audio input and output). Like the app, a cable onto an occupied input replaces the old one.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "from": {
      "type": "string",
      "description": "Jack: <module>.<jack>, e.g. VCO1.out, Keyboard1.gate, in."
     },
     "to": {
      "type": "string",
      "description": "Jack, e.g. VCF1.in, out."
     }
    },
    "required": [
     "doc",
     "from",
     "to"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "unpatch",
   "description": "Remove the cables on a jack (\"VCF1.in\").",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "jack": {
      "type": "string",
      "description": "Jack: <module>.<jack>."
     }
    },
    "required": [
     "doc",
     "jack"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "setKnob",
   "description": "Turn a knob (the knob tray / a module face): a 0..1 position, or a value in the knob's unit (\"1.2k\" Hz, \"40\" %). Module knobs are \"<module> <label>\" or the param (VCF1_IABC).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "knob": {
      "type": "string",
      "description": "Knob name, label or param (see list what: knobs)."
     },
     "position": {
      "type": "number",
      "description": "0..1.",
      "minimum": 0,
      "maximum": 1
     },
     "value": {
      "type": "string",
      "description": "In the knob's unit (Hz, %, s, ...)."
     }
    },
    "required": [
     "doc",
     "knob"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "swap",
   "description": "Swap a module, circuit block or device in place, keeping its connections (the app's swap menus): a module for another of its kind (cables re-patched by role, knobs carried by meaning), a schematic block for another circuit, or a device model (BBD chip, op-amp, transistor, diode, vactrol). Without \"to\", lists the choices.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "part": {
      "type": "string",
      "description": "Module (VCF1), block or device part (D1, Q2, BBD1)."
     },
     "to": {
      "type": "string",
      "description": "Replacement: module / preset name, or device model name."
     }
    },
    "required": [
     "doc",
     "part"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "bypass",
   "description": "Bypass a module (its audio input passes straight to its output; modules without audio are muted) or bring it back.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "module": {
      "type": "string",
      "description": "Module, e.g. VCF1."
     },
     "on": {
      "type": "boolean",
      "description": "Default true."
     }
    },
    "required": [
     "doc",
     "module"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "output",
   "description": "Output monitoring: mono or stereo (stereo adds the right Output), and pan (-1..1).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "mode": {
      "type": "string",
      "enum": [
       "mono",
       "stereo"
      ],
      "description": "Output mode."
     },
     "pan": {
      "type": "number",
      "description": "-1 (left) .. 1 (right).",
      "minimum": -1,
      "maximum": 1
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "mixer",
   "description": "Configure a Mixer module: channel count and mono / stereo (cables re-patched where they still fit).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "module": {
      "type": "string",
      "description": "Mixer module, e.g. Mixer1."
     },
     "channels": {
      "type": "integer",
      "description": "Inputs (1..8).",
      "minimum": 1,
      "maximum": 8
     },
     "mode": {
      "type": "string",
      "enum": [
       "mono",
       "stereo"
      ],
      "description": ""
     }
    },
    "required": [
     "doc",
     "module"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "voices",
   "description": "Keyboard voices: 1 (mono), 2 or 4 independent circuit voices, legato, or expand the voices into editable circuit copies.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "count": {
      "type": "integer",
      "description": "1, 2 or 4.",
      "minimum": 1,
      "maximum": 4
     },
     "legato": {
      "type": "boolean",
      "description": "Held notes glide (mono)."
     },
     "expand": {
      "type": "boolean",
      "description": "Make the voices visible, editable copies (explicit allocation)."
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "plugin_export",
   "description": "Export the circuit or patch as a WebCLAP plugin bundle (.wclap: frozen WASM engine + circuit + metadata), the same bundle as the app's plugin export. Effects take audio; patches with a Keyboard become instruments.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "name": {
      "type": "string",
      "description": "Plugin name (default the title)."
     },
     "kind": {
      "type": "string",
      "enum": [
       "effect",
       "instrument"
      ],
      "description": "Default: instrument when the patch has a Keyboard."
     },
     "exposed": {
      "type": "array",
      "items": {
       "type": "string",
       "description": ""
      },
      "description": "Knobs to expose as host parameters (names / labels; default every exportable knob)."
     },
     "outputGain": {
      "type": "number",
      "description": "Output gain (default 1)."
     },
     "inputGain": {
      "type": "number",
      "description": "Input gain (default 1)."
     },
     "sourceWave": {
      "type": "string",
      "enum": [
       "saw",
       "square",
       "noise"
      ],
      "description": "Instruments with an audio input: the oscillator fed per voice."
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "share",
   "description": "A share link: the whole document in the URL fragment (circuit.synthcity.org/#c=…, made offline, never sent to a server), or the preset page for an unedited gallery circuit. short: true also uploads an immutable snapshot (/s/<id>) — only when asked.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "short": {
      "type": "boolean",
      "description": "Upload a short-link snapshot to the server (network; default false)."
     },
     "base": {
      "type": "string",
      "description": "Site origin (default https://circuit.synthcity.org)."
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "bom",
   "description": "Bill of materials (a schematic inventory: reference, value, kind, quantity), as rows or CSV.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "analyse",
   "description": "The analysis panel's measurement in raw node volts (before output scale and limiter): a frequency response (stepped sine) or a transient (sine / step / DC) at any node.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "mode": {
      "type": "string",
      "enum": [
       "response",
       "transient"
      ],
      "description": "Default response."
     },
     "node": {
      "type": "string",
      "description": "Node to measure (default out)."
     },
     "referenceNode": {
      "type": "string",
      "description": "Differential reference (default 0)."
     },
     "amplitude": {
      "type": "number",
      "description": "Excitation (V, default 1 mV)."
     },
     "bias": {
      "type": "number",
      "description": "Input DC bias (V)."
     },
     "waveform": {
      "type": "string",
      "enum": [
       "sine",
       "step",
       "dc"
      ],
      "description": "transient excitation."
     },
     "frequency": {
      "type": "number",
      "description": "transient sine Hz."
     },
     "seconds": {
      "type": "number",
      "description": "Duration (s, ≤ 2)."
     },
     "settle": {
      "type": "number",
      "description": "Settling time (s)."
     },
     "sampleRate": {
      "type": "integer",
      "description": "48000..192000 (default 96000)."
     },
     "full": {
      "type": "boolean",
      "description": "Every point (default ~60)."
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "design_response",
   "description": "Response design (the app's Design tab): pick resistor / capacitor values within bounds so the measured response meets [Hz, dB] targets; E12/E24 values; apply writes them. A bounded local search on the real circuit (no small-signal assumption).",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "adjust": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "part": {
         "type": "string",
         "description": "R or C part."
        },
        "lo": {
         "type": "string",
         "description": "Lower bound (e.g. 1k)."
        },
        "hi": {
         "type": "string",
         "description": "Upper bound."
        },
        "standard": {
         "type": "string",
         "enum": [
          "E12",
          "E24"
         ],
         "description": "Snap to a series."
        }
       },
       "required": [
        "part"
       ],
       "additionalProperties": false
      },
      "description": "Parts to change (default bounds: value / 10 .. value × 10)."
     },
     "targets": {
      "type": "array",
      "items": {
       "type": "array",
       "items": {
        "type": "number"
       },
       "description": "[Hz, dB]"
      },
      "description": "Response targets."
     },
     "node": {
      "type": "string",
      "description": "Measured node (default out)."
     },
     "amplitude": {
      "type": "number",
      "description": "Excitation (V)."
     },
     "maxEvaluations": {
      "type": "integer",
      "description": "Search budget in circuit evaluations (default and maximum 34).",
      "minimum": 4,
      "maximum": 34
     },
     "apply": {
      "type": "boolean",
      "description": "Write the improved values into the document."
     }
    },
    "required": [
     "doc",
     "adjust",
     "targets"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "idempotentHint": false,
    "openWorldHint": false
   }
  },
  {
   "name": "diagnose_control",
   "description": "Measured control diagnostics (the app's Diagnose tab): does a knob change a node at nominal and quiet drive, or is its effect masked by clipping / compression? Gain, THD and a plain conclusion per node.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "knob": {
      "type": "string",
      "description": "Knob (param or pot)."
     },
     "node": {
      "type": "string",
      "description": "Node to watch (default out)."
     },
     "frequency": {
      "type": "number",
      "description": "Test sine Hz (default 1000)."
     },
     "amplitude": {
      "type": "number",
      "description": "Nominal drive (V, default 0.5)."
     },
     "low": {
      "type": "number",
      "description": "Low knob position (default 0.1)."
     },
     "high": {
      "type": "number",
      "description": "High knob position (default 0.9)."
     }
    },
    "required": [
     "doc",
     "knob"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  },
  {
   "name": "audit",
   "description": "Knob and stability audit: every knob at a few positions must change the sound measurably (inert knobs, release-only knobs, live/commit mismatches flagged), and a stability sweep across knob corners.",
   "inputSchema": {
    "type": "object",
    "properties": {
     "doc": {
      "type": "string",
      "description": "The circuit: netlist text (a .cir; starts with \"*\" or spans lines), a gallery or preset name (see gallery), or a share link (https://circuit.synthcity.org/#c=…, /p/<slug> or /s/<id>). Results of edits include the updated circuit to pass to the next call."
     },
     "knobs": {
      "type": "boolean",
      "description": "Knob sweep (default true)."
     },
     "stability": {
      "type": "boolean",
      "description": "Stability sweep (default true)."
     },
     "dense": {
      "type": "boolean",
      "description": "More stability cases (slower)."
     }
    },
    "required": [
     "doc"
    ],
    "additionalProperties": false
   },
   "annotations": {
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
   }
  }
 ]
}
