Koskamo

AutoTuneMPC MCP server

AutoTuneMPC provides a remote MCP server for constrained nonlinear Model Predictive Control (MPC) and hyperparameter tuning using Optuna. It exposes endpoints to solve MPC problems, queue weight searches, and run autotuning on predefined plant templates like differential drive and battery peak shaving. The service uses CasADi and IPOPT for solving and supports payment via prepaid credit packs or x402 on Base USDC.

Endpoint and access

No sign-in to connect and list tools. Individual tools may still need a vendor account, credentials, or permissions; check the documented prerequisites.

AutoTuneMPC logo, by AutoTuneMPCVendor evidenceStreamable HTTPNo sign-inEndpoint checked 2026-11-23Operated by AutoTuneMPC
You need:Send your pack key or pay the HTTP 402 challenge.Your API key appears immediately after checkout.X-API-Key and x402 are the same gate.
MCP endpoint (Streamable HTTP)
https://api.autotunempc.com/mcp
Vendor documentation

What its tools do

10 tools, grouped by the hints the server advertises. Hints are self-declared, not verified behavior.

10 of 10 have a description · 10 of 10 declare behavior hints · 10 of 10 with parameters document them all

Checks and signals

Each line is separate evidence, not a trust score.

  • Passed Endpoint answered the live check ·
  • Passed Official MCP Registry namespace is tied to autotunempc.com ·
  • Passed Endpoint is on the registry namespace domain ·
  • Availability 2 of 2 checks passed in 30 days

What you can do with it

  • Solve constrained nonlinear MPC steps for control systems
  • Queue and monitor Optuna weight search jobs for tuning
  • Run autotuning on registered plant templates like differential drive
  • Validate plant configurations before incurring paid solve costs

Source and maintenance

Vendor evidenceRegistry 1.0.1
Maintenance checked

Protocol and capabilities

Server
general-mpc-engine 4.2.1
MCP protocol negotiated in check
2025-11-25
Tools
10 advertised
Resources
0 advertised
Resource templates
0 advertised
Prompts
0 advertised
Server-advertised capabilities
{
  "tools": {
    "listChanged": true
  },
  "logging": {},
  "prompts": {
    "listChanged": true
  },
  "resources": {
    "subscribe": false,
    "listChanged": true
  }
}

Tools

10 advertised

identify_discrete_plant — Identify a discrete plant
Advertised by the server during the last successful anonymous check.
Advertised read-only

Fit a discrete linear A, B, and dt from logged (t, u, y) samples. This tool stays free when payment enforcement is on. It does not call IPOPT. Pass the returned matrices to ``solve_mpc`` as a linear system. Send 4 to 2000 samples. Each ``y`` has length 1..24 and each ``u`` has length 1..12, the same widths on every row, all finite, with strictly increasing timestamps. Anything else is rejected before the fit.

identify_discrete_plant input schema
{
  "type": "object",
  "required": [
    "request"
  ],
  "properties": {
    "request": {
      "type": "object",
      "required": [
        "samples"
      ],
      "properties": {
        "samples": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "t",
              "u",
              "y"
            ],
            "properties": {
              "t": {
                "type": "number",
                "description": "Sample time. Must be finite, and strictly increasing from row to row. Use one time unit for the whole log."
              },
              "u": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "maxItems": 12,
                "minItems": 1,
                "description": "Input sample, length 1 to 12. A scalar is wrapped as a one-element list. Every row uses the same length."
              },
              "y": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "maxItems": 24,
                "minItems": 1,
                "description": "Output sample, length 1 to 24. A scalar is wrapped as a one-element list. Every row uses the same length."
              }
            },
            "description": "One logged sample. ``u`` and ``y`` are scalars or vectors.",
            "additionalProperties": false
          },
          "maxItems": 2000,
          "minItems": 4,
          "description": "Logged (t, u, y) rows. Length 4 to 2000. This fit is free: no X-API-Key and no x402 charge."
        }
      },
      "description": "Logged (t, u, y) samples for a free discrete linear fit. No X-API-Key and no x402 charge. Pass A, B, and dt to solve_mpc after a free validate_problem.",
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
identify_discrete_plant output schema
{
  "type": "object",
  "additionalProperties": true
}
identify_discrete_plant annotations
{
  "title": "Identify a discrete plant",
  "readOnlyHint": true,
  "openWorldHint": false,
  "idempotentHint": true,
  "destructiveHint": false
}
validate_problem — Validate a problem
Advertised by the server during the last successful anonymous check.
Advertised read-only

Check dimensions, bounds, and linear controllability before a solve. This is POST /v1/validate and stays free when payment enforcement is on. It does not use X-API-Key and it does not return HTTP 402. Call it before solve_mpc when you want the plant rejected without spending a credit.

validate_problem input schema
{
  "type": "object",
  "required": [
    "request"
  ],
  "properties": {
    "request": {
      "type": "object",
      "required": [
        "system"
      ],
      "properties": {
        "Q": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number",
                  "maximum": 1000000000000,
                  "minimum": -1000000000000
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Stage state weight, shape nx by nx. Omit to skip the weight check."
        },
        "R": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number",
                  "maximum": 1000000000000,
                  "minimum": -1000000000000
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Input weight, shape nu by nu. Omit to skip the weight check."
        },
        "Qf": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number",
                  "maximum": 1000000000000,
                  "minimum": -1000000000000
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Terminal state weight, shape nx by nx. Omit to skip the weight check."
        },
        "Rd": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number",
                  "maximum": 1000000000000,
                  "minimum": -1000000000000
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Slew weight, shape nu by nu. Omit to skip the weight check."
        },
        "x0": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number",
                "maximum": 1000000000000,
                "minimum": -1000000000000
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Initial state, length nx. Omit to skip that length check."
        },
        "costs": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "path": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "One path sample per state node, length N+1. Each sample is along, across, and heading, in the position indexes' units and the heading state's units."
                },
                "zones": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "state",
                      "center",
                      "half_width",
                      "weight"
                    ],
                    "properties": {
                      "state": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "State index this band applies to."
                      },
                      "center": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000,
                        "description": "Band center, in that state's units."
                      },
                      "weight": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": 0,
                        "description": "Quadratic weight on the band slack. Zero leaves the band unpaid. Must be >= 0."
                      },
                      "half_width": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": 0,
                        "description": "Half width of the band. Must be >= 0."
                      }
                    },
                    "description": "One slack band. Inside the band the residual is zero.",
                    "additionalProperties": false
                  },
                  "maxItems": 8,
                  "description": "Slack bands, at most 8. Each band is two inequalities and one slack."
                },
                "path_frame": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "position",
                        "heading"
                      ],
                      "properties": {
                        "heading": {
                          "type": "integer",
                          "description": "State index of the heading. Must differ from both position indexes."
                        },
                        "position": {
                          "type": "array",
                          "items": {
                            "type": "integer"
                          },
                          "maxItems": 2,
                          "minItems": 2,
                          "description": "Two distinct state indexes of the plane the path is written in. Example: [0, 1]."
                        },
                        "heading_weight": {
                          "type": "number",
                          "default": 1,
                          "maximum": 1000000000000,
                          "minimum": 0,
                          "description": "Weight on both squared heading residuals, sin(heading error) and 1 - cos(heading error). Must be >= 0. Default 1. The two residuals share this weight."
                        },
                        "lateral_weight": {
                          "type": "number",
                          "default": 1,
                          "maximum": 1000000000000,
                          "minimum": 0,
                          "description": "Weight on the squared cross-track residual. Must be >= 0. Default 1."
                        },
                        "longitudinal_weight": {
                          "type": "number",
                          "default": 1,
                          "maximum": 1000000000000,
                          "minimum": 0,
                          "description": "Weight on the squared along-track residual. Must be >= 0. Default 1."
                        }
                      },
                      "description": "Squared path residuals. Heading uses both sin and 1 - cos.",
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Along-track, cross-track, and heading residuals. Omit for none."
                }
              },
              "description": "Path-frame and zone residuals. Economic prices stay the linear stage vectors.\n\n``linear_state_cost`` and ``linear_input_cost`` are the economic term. They are\nlinear in the node. Path samples, zone centers, half-widths, and weights are\nparameters of the compiled problem.",
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Path-frame and zone residuals to check. Omit to skip that check."
        },
        "d_hat": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number",
                "maximum": 1000000000000,
                "minimum": -1000000000000
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Disturbance estimate, length nd. Omit to skip that length check."
        },
        "x_ref": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number",
                "maximum": 1000000000000,
                "minimum": -1000000000000
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "State reference, length nx. Omit to skip that length check."
        },
        "z_ref": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number",
                "maximum": 1000000000000,
                "minimum": -1000000000000
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Output reference, length ny. Omit to skip that check."
        },
        "solver": {
          "type": "string",
          "default": "auto",
          "description": "Leave this at auto. The server selects the numerical method."
        },
        "system": {
          "oneOf": [
            {
              "type": "object",
              "required": [
                "A",
                "B",
                "dt",
                "N",
                "kind"
              ],
              "properties": {
                "A": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "number",
                      "maximum": 1000000000000,
                      "minimum": -1000000000000
                    }
                  },
                  "description": "State matrix, shape nx by nx, with nx <= 24. Discrete map or continuous xdot, matching time_mode."
                },
                "B": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "number",
                      "maximum": 1000000000000,
                      "minimum": -1000000000000
                    }
                  },
                  "description": "Input matrix, shape nx by nu, with nu <= 12."
                },
                "C": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Output matrix, shape ny by nx. Omit for identity, which uses the full state."
                },
                "D": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Feedthrough matrix, shape ny by nu. Omit when there is no direct term."
                },
                "N": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Prediction horizon in steps. Must be >= 1. Values above 100 are rejected."
                },
                "Bd": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Disturbance matrix, shape nx by nd, with nd <= 12. Omit to reuse B as an input disturbance."
                },
                "dt": {
                  "type": "number",
                  "maximum": 1000000,
                  "description": "Sample time. Must be > 0. Continuous plants are zero-order-hold discretized at this step. Use seconds unless A is written in another time unit.",
                  "exclusiveMinimum": 0
                },
                "kind": {
                  "type": "string",
                  "const": "linear",
                  "default": "linear",
                  "description": "Plant kind. Must be \"linear\" for matrices A and B."
                },
                "u_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper input bounds, length nu, in the plant's input units. Omit for 1e6 on each input. Input bounds are hard."
                },
                "u_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower input bounds, length nu, in the plant's input units. Omit for -1e6 on each input. Input bounds are hard."
                },
                "x_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper state bounds, length nx, in the plant's state units. Omit for 1e6 on each state. State bounds are soft."
                },
                "x_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower state bounds, length nx, in the plant's state units. Omit for -1e6 on each state. State bounds are soft."
                },
                "du_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper slew bounds on delta-u, length nu. Omit for 1e6 on each input. Slew bounds are hard."
                },
                "du_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
                },
                "time_mode": {
                  "enum": [
                    "discrete",
                    "continuous"
                  ],
                  "type": "string",
                  "default": "discrete",
                  "description": "discrete uses A and B as given. continuous is zero-order-hold discretized at dt. Default discrete."
                }
              },
              "description": "Discrete or continuous linear plant.\n\nContinuous ``(A, B, Bd)`` are converted with a matrix exponential / zero-order\nhold at ``dt``. Discrete matrices are used as given. ``Bd`` defaults to ``B``\n(input disturbance) when omitted.",
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "name",
                "parameters",
                "N",
                "kind"
              ],
              "properties": {
                "N": {
                  "type": "integer",
                  "maximum": 100,
                  "minimum": 1,
                  "description": "Prediction horizon in steps. Must be >= 1 and <= 100."
                },
                "kind": {
                  "type": "string",
                  "const": "nonlinear",
                  "default": "nonlinear",
                  "description": "Plant kind. Must be \"nonlinear\" for a registered template."
                },
                "name": {
                  "enum": [
                    "double_integrator",
                    "thermal_rc_zone",
                    "soil_moisture_cascade",
                    "unicycle_kinematics",
                    "gravity_tank",
                    "cart_pendulum",
                    "icr_skid_steer",
                    "ackermann"
                  ],
                  "type": "string",
                  "description": "Registered template: double_integrator, thermal_rc_zone, soil_moisture_cascade, unicycle_kinematics, gravity_tank, cart_pendulum, icr_skid_steer, or ackermann."
                },
                "u_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper input bounds, length nu, in the plant's input units. Omit for 1e6 on each input. Input bounds are hard."
                },
                "u_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower input bounds, length nu, in the plant's input units. Omit for -1e6 on each input. Input bounds are hard."
                },
                "x_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper state bounds, length nx, in the plant's state units. Omit for 1e6 on each state. State bounds are soft."
                },
                "x_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower state bounds, length nx, in the plant's state units. Omit for -1e6 on each state. State bounds are soft."
                },
                "du_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper slew bounds on delta-u, length nu. Omit for 1e6 on each input. Slew bounds are hard."
                },
                "du_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
                },
                "parameters": {
                  "type": "object",
                  "description": "Template knobs, one number per required key. double_integrator and unicycle_kinematics: dt > 0 (seconds). thermal_rc_zone: dt > 0, capacity > 0, time_constant > 0, and ambient. soil_moisture_cascade: dt > 0, capacity > 0, tau_1 > 0, tau_2 > 0, tau_3 > 0, k_12 >= 0, k_23 >= 0. gravity_tank: dt > 0, discharge > 0, inflow_gain > 0. cart_pendulum: dt, cart_mass, pole_mass, friction, inertia, gravity, and length, each > 0. icr_skid_steer: dt > 0 and slip, a signed length with abs(slip) <= 10. Body-frame lateral velocity equals slip * yaw_rate. If x_icr is the forward coordinate of the instantaneous center, positive ahead of the reference point, slip = -x_icr. ackermann: dt > 0 and wheelbase > 0. The steer component of u_min and u_max must lie inside ±1.2 rad. Unknown keys are rejected.",
                  "additionalProperties": {
                    "type": "number",
                    "maximum": 1000000000000,
                    "minimum": -1000000000000
                  }
                }
              },
              "description": "Registered dynamics template plus a validated parameter dictionary.",
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "nx",
                "nu",
                "nd",
                "np",
                "f",
                "dt",
                "N",
                "kind"
              ],
              "properties": {
                "C": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Output matrix, shape ny by nx, with ny <= 8. Omit for identity."
                },
                "N": {
                  "type": "integer",
                  "maximum": 60,
                  "minimum": 1,
                  "description": "Prediction horizon in steps. Must be >= 1 and <= 60."
                },
                "f": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 8,
                  "minItems": 1,
                  "description": "One scalar expression per state, length nx. Each string is at most 512 characters and the set is at most 4096. Symbols are x[i], u[i], d[i], p[i], pi, and the smooth allowlist sin, cos, tan, atan, atan2, exp, log, tanh, sqrt, hypot, sq, plus + - * / and ^2 ^3 ^4."
                },
                "p": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "maximum": 1000000000000,
                    "minimum": -1000000000000
                  },
                  "maxItems": 8,
                  "description": "Numeric parameter values, length np. Baked into the discrete map."
                },
                "dt": {
                  "type": "number",
                  "maximum": 1000000,
                  "description": "Sample time. Must be > 0. Continuous plants are zero-order-hold discretized at this step. Use seconds unless A is written in another time unit.",
                  "exclusiveMinimum": 0
                },
                "nd": {
                  "type": "integer",
                  "maximum": 4,
                  "minimum": 0,
                  "description": "Disturbance dimension. Must be >= 0 and <= 4. Zero is a plant with no disturbance channel. An unused d[i] when nd is positive does not change the map and reports detectable false."
                },
                "np": {
                  "type": "integer",
                  "maximum": 8,
                  "minimum": 0,
                  "description": "Parameter dimension. Must be >= 0 and <= 8."
                },
                "nu": {
                  "type": "integer",
                  "maximum": 4,
                  "minimum": 1,
                  "description": "Input dimension. Must be >= 1 and <= 4."
                },
                "nx": {
                  "type": "integer",
                  "maximum": 8,
                  "minimum": 1,
                  "description": "State dimension. Must be >= 1 and <= 8."
                },
                "kind": {
                  "type": "string",
                  "const": "expression",
                  "default": "expression",
                  "description": "Plant kind. Must be \"expression\" for allowlisted scalar expressions."
                },
                "u_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper input bounds, length nu, in the plant's input units. Omit for 1e6 on each input. Input bounds are hard."
                },
                "u_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower input bounds, length nu, in the plant's input units. Omit for -1e6 on each input. Input bounds are hard."
                },
                "x_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper state bounds, length nx, in the plant's state units. Omit for 1e6 on each state. State bounds are soft."
                },
                "x_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower state bounds, length nx, in the plant's state units. Omit for -1e6 on each state. State bounds are soft."
                },
                "du_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper slew bounds on delta-u, length nu. Omit for 1e6 on each input. Slew bounds are hard."
                },
                "du_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
                },
                "time_mode": {
                  "enum": [
                    "continuous",
                    "discrete"
                  ],
                  "type": "string",
                  "default": "continuous",
                  "description": "continuous integrates the expressions with classical RK4 at dt. discrete uses each expression as the next state. Default continuous."
                }
              },
              "description": "Allowlisted scalar expressions, one per state row.\n\n``time_mode`` ``continuous`` is integrated with classical RK4 at ``dt``.\n``discrete`` means each expression is already the next state. ``p`` is a\nnumeric parameter vector baked into the discrete map. ``nd`` may be 0.\nDeclaring ``nd >= 1`` and never using ``d[i]`` is accepted; detectability\nis then false because the disturbance columns of the discrete Jacobian are zero.",
              "additionalProperties": false
            }
          ],
          "description": "Plant to check. This call is free: no X-API-Key and no x402 charge. Run it before the paid solve, and before autotune."
        },
        "qf_source": {
          "enum": [
            "caller",
            "discrete_riccati"
          ],
          "type": "string",
          "default": "caller",
          "description": "caller checks Qf only. discrete_riccati also requires a linear plant."
        },
        "tube_bound": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number",
                "maximum": 1000000000000,
                "minimum": -1000000000000
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Tube disturbance magnitude, length nx. Omit to skip that check."
        },
        "constraints": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "h": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 8,
                  "description": "Scalar rows, each h(x, u, p) <= 0. At most 8. Symbols are x[i], u[i], p[i], and pi. Same length, depth, and node caps as expression dynamics."
                },
                "p": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "maximum": 1000000000000,
                    "minimum": -1000000000000
                  },
                  "maxItems": 8,
                  "description": "Caller parameters for h, length 0 to 8. On an expression plant, omit this to use the plant p. Obstacle slots do not use this vector and do not count toward the cap."
                },
                "hard": {
                  "type": "boolean",
                  "default": false,
                  "description": "True enforces the rows with no slack. Default false."
                },
                "slack_l1": {
                  "anyOf": [
                    {
                      "type": "number",
                      "maximum": 1000000000000,
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "L1 weight on each inequality slack. Omit for 1000. Ignored when hard is true."
                },
                "slack_l2": {
                  "anyOf": [
                    {
                      "type": "number",
                      "maximum": 1000000000000,
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "L2 weight on each inequality slack. Omit for 100. Ignored when hard is true."
                },
                "obstacles": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "position",
                        "slots"
                      ],
                      "properties": {
                        "slots": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "cx",
                              "cy",
                              "r",
                              "active"
                            ],
                            "properties": {
                              "r": {
                                "type": "number",
                                "maximum": 1000000000000,
                                "minimum": 0,
                                "description": "Radius. Must be >= 0."
                              },
                              "cx": {
                                "type": "number",
                                "maximum": 1000000000000,
                                "minimum": -1000000000000,
                                "description": "Center along the first position index, in the plant's state units."
                              },
                              "cy": {
                                "type": "number",
                                "maximum": 1000000000000,
                                "minimum": -1000000000000,
                                "description": "Center along the second position index, in the plant's state units."
                              },
                              "active": {
                                "type": "number",
                                "maximum": 1000000000000,
                                "minimum": -1000000000000,
                                "description": "1 keeps the circle. 0 drops the row. No other value is accepted."
                              }
                            },
                            "description": "One fixed circle. ``active`` is 0 or 1 and is not part of caller ``p``.",
                            "additionalProperties": false
                          },
                          "maxItems": 8,
                          "minItems": 1,
                          "description": "Circle slots. Length 1 to 8. Each is cx, cy, r, active."
                        },
                        "position": {
                          "type": "array",
                          "items": {
                            "type": "integer"
                          },
                          "maxItems": 2,
                          "minItems": 2,
                          "description": "Two distinct state indexes for the circle plane. Example: [0, 1]."
                        }
                      },
                      "description": "At most eight circles. Their four numbers each sit outside ``np <= 8``.",
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Fixed circles. Omit for none. The row is active * (r^2 - squared distance) <= 0."
                }
              },
              "description": "Allowlisted rows ``h(x, u, p) <= 0`` and fixed obstacle slots.\n\nSoft rows use one slack per node. ``hard`` true removes those slacks.\nA linear plant with any row here uses the nonlinear solver. The linear-only solver option is rejected.",
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "h rows and obstacle slots to check. Omit to skip that check. The linear-only solver option is rejected."
        },
        "output_weight": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number",
                  "maximum": 1000000000000,
                  "minimum": -1000000000000
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Output residual weight, shape ny by ny. Omit to skip that check."
        },
        "linear_input_cost": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number",
                "maximum": 1000000000000,
                "minimum": -1000000000000
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Linear input stage cost, length nu. Omit to skip that check."
        },
        "linear_state_cost": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number",
                "maximum": 1000000000000,
                "minimum": -1000000000000
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Linear state stage cost, length nx. Omit to skip that check."
        },
        "scenario_forecasts": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "maximum": 1000000000000,
                    "minimum": -1000000000000
                  }
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Scenario forecasts, each N by nd. Omit to skip that check."
        }
      },
      "description": "Free plant check. No X-API-Key and no x402 charge. Call this before the paid solve_mpc, and before autotune.",
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
validate_problem output schema
{
  "type": "object",
  "additionalProperties": true
}
validate_problem annotations
{
  "title": "Validate a problem",
  "readOnlyHint": true,
  "openWorldHint": false,
  "idempotentHint": true,
  "destructiveHint": false
}
solve_mpc — Solve MPC
Advertised by the server during the last successful anonymous check.

Solve a multi-step constrained MPC problem on the server. Use this when the horizon has soft state bounds, hard input and slew limits, and an offset-free disturbance rejection term. Pass the same ``session_id`` on later calls of one closed loop so the shifted primal and dual warm start is restored. Omit ``session_id`` for a single stateless solve. Do not call this for a one-step linear update you can do locally (a matrix multiply, a threshold, or reading a sensor). Those do not need IPOPT. CasADi and IPOPT return u0 and the predicted trajectory for robotics, energy storage, and process control. session_id is the warm start. This is POST /v1/solve at $0.02. Send header X-API-Key when a $29 pack still has solve credits. With no key, or when those credits are gone, the call is HTTP 402 and an agent pays with x402. There is no second payment path. Set ``reset_warm_start`` or call the ``reset_warm_start`` tool to drop the seed for that session. The compiled solver stays. A reset only clears the seed stored for the caller who owns it.

solve_mpc input schema
{
  "type": "object",
  "required": [
    "request"
  ],
  "properties": {
    "request": {
      "type": "object",
      "required": [
        "system",
        "x0",
        "x_ref",
        "Q",
        "R",
        "Rd",
        "Qf"
      ],
      "properties": {
        "Q": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number",
              "maximum": 1000000000000,
              "minimum": -1000000000000
            }
          },
          "description": "Stage state weight, shape nx by nx."
        },
        "R": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number",
              "maximum": 1000000000000,
              "minimum": -1000000000000
            }
          },
          "description": "Input weight, shape nu by nu."
        },
        "Qf": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number",
              "maximum": 1000000000000,
              "minimum": -1000000000000
            }
          },
          "description": "Terminal state weight, shape nx by nx."
        },
        "Rd": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number",
              "maximum": 1000000000000,
              "minimum": -1000000000000
            }
          },
          "description": "Slew weight on delta-u, shape nu by nu."
        },
        "x0": {
          "type": "array",
          "items": {
            "type": "number",
            "maximum": 1000000000000,
            "minimum": -1000000000000
          },
          "maxItems": 24,
          "description": "Initial state, length nx, at most 24 entries, in the plant's state units."
        },
        "U_ref": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number",
                  "maximum": 1000000000000,
                  "minimum": -1000000000000
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Input reference over the horizon, shape N by nu. Omit for the equilibrium input."
        },
        "X_ref": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number",
                  "maximum": 1000000000000,
                  "minimum": -1000000000000
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "State reference over the horizon, shape (N+1) by nx. Omit to hold x_ref."
        },
        "costs": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "path": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "One path sample per state node, length N+1. Each sample is along, across, and heading, in the position indexes' units and the heading state's units."
                },
                "zones": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "state",
                      "center",
                      "half_width",
                      "weight"
                    ],
                    "properties": {
                      "state": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "State index this band applies to."
                      },
                      "center": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000,
                        "description": "Band center, in that state's units."
                      },
                      "weight": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": 0,
                        "description": "Quadratic weight on the band slack. Zero leaves the band unpaid. Must be >= 0."
                      },
                      "half_width": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": 0,
                        "description": "Half width of the band. Must be >= 0."
                      }
                    },
                    "description": "One slack band. Inside the band the residual is zero.",
                    "additionalProperties": false
                  },
                  "maxItems": 8,
                  "description": "Slack bands, at most 8. Each band is two inequalities and one slack."
                },
                "path_frame": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "position",
                        "heading"
                      ],
                      "properties": {
                        "heading": {
                          "type": "integer",
                          "description": "State index of the heading. Must differ from both position indexes."
                        },
                        "position": {
                          "type": "array",
                          "items": {
                            "type": "integer"
                          },
                          "maxItems": 2,
                          "minItems": 2,
                          "description": "Two distinct state indexes of the plane the path is written in. Example: [0, 1]."
                        },
                        "heading_weight": {
                          "type": "number",
                          "default": 1,
                          "maximum": 1000000000000,
                          "minimum": 0,
                          "description": "Weight on both squared heading residuals, sin(heading error) and 1 - cos(heading error). Must be >= 0. Default 1. The two residuals share this weight."
                        },
                        "lateral_weight": {
                          "type": "number",
                          "default": 1,
                          "maximum": 1000000000000,
                          "minimum": 0,
                          "description": "Weight on the squared cross-track residual. Must be >= 0. Default 1."
                        },
                        "longitudinal_weight": {
                          "type": "number",
                          "default": 1,
                          "maximum": 1000000000000,
                          "minimum": 0,
                          "description": "Weight on the squared along-track residual. Must be >= 0. Default 1."
                        }
                      },
                      "description": "Squared path residuals. Heading uses both sin and 1 - cos.",
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Along-track, cross-track, and heading residuals. Omit for none."
                }
              },
              "description": "Path-frame and zone residuals. Economic prices stay the linear stage vectors.\n\n``linear_state_cost`` and ``linear_input_cost`` are the economic term. They are\nlinear in the node. Path samples, zone centers, half-widths, and weights are\nparameters of the compiled problem.",
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional path-frame and zone least-squares residuals. Omit for the quadratic cost only. Needs the nonlinear solver when a path frame or a zone is set."
        },
        "d_hat": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number",
                "maximum": 1000000000000,
                "minimum": -1000000000000
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Constant disturbance estimate, length nd. Omit for zeros."
        },
        "x_ref": {
          "type": "array",
          "items": {
            "type": "number",
            "maximum": 1000000000000,
            "minimum": -1000000000000
          },
          "maxItems": 24,
          "description": "Constant state reference, length nx, at most 24 entries. Ignored for the trajectory when X_ref is set."
        },
        "z_ref": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number",
                "maximum": 1000000000000,
                "minimum": -1000000000000
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Output reference, length ny, held at every stage. Omit for zeros."
        },
        "solver": {
          "type": "string",
          "default": "auto",
          "description": "Leave this at auto. The server selects the numerical method."
        },
        "system": {
          "oneOf": [
            {
              "type": "object",
              "required": [
                "A",
                "B",
                "dt",
                "N",
                "kind"
              ],
              "properties": {
                "A": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "number",
                      "maximum": 1000000000000,
                      "minimum": -1000000000000
                    }
                  },
                  "description": "State matrix, shape nx by nx, with nx <= 24. Discrete map or continuous xdot, matching time_mode."
                },
                "B": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "number",
                      "maximum": 1000000000000,
                      "minimum": -1000000000000
                    }
                  },
                  "description": "Input matrix, shape nx by nu, with nu <= 12."
                },
                "C": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Output matrix, shape ny by nx. Omit for identity, which uses the full state."
                },
                "D": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Feedthrough matrix, shape ny by nu. Omit when there is no direct term."
                },
                "N": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Prediction horizon in steps. Must be >= 1. Values above 100 are rejected."
                },
                "Bd": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Disturbance matrix, shape nx by nd, with nd <= 12. Omit to reuse B as an input disturbance."
                },
                "dt": {
                  "type": "number",
                  "maximum": 1000000,
                  "description": "Sample time. Must be > 0. Continuous plants are zero-order-hold discretized at this step. Use seconds unless A is written in another time unit.",
                  "exclusiveMinimum": 0
                },
                "kind": {
                  "type": "string",
                  "const": "linear",
                  "default": "linear",
                  "description": "Plant kind. Must be \"linear\" for matrices A and B."
                },
                "u_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper input bounds, length nu, in the plant's input units. Omit for 1e6 on each input. Input bounds are hard."
                },
                "u_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower input bounds, length nu, in the plant's input units. Omit for -1e6 on each input. Input bounds are hard."
                },
                "x_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper state bounds, length nx, in the plant's state units. Omit for 1e6 on each state. State bounds are soft."
                },
                "x_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower state bounds, length nx, in the plant's state units. Omit for -1e6 on each state. State bounds are soft."
                },
                "du_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper slew bounds on delta-u, length nu. Omit for 1e6 on each input. Slew bounds are hard."
                },
                "du_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
                },
                "time_mode": {
                  "enum": [
                    "discrete",
                    "continuous"
                  ],
                  "type": "string",
                  "default": "discrete",
                  "description": "discrete uses A and B as given. continuous is zero-order-hold discretized at dt. Default discrete."
                }
              },
              "description": "Discrete or continuous linear plant.\n\nContinuous ``(A, B, Bd)`` are converted with a matrix exponential / zero-order\nhold at ``dt``. Discrete matrices are used as given. ``Bd`` defaults to ``B``\n(input disturbance) when omitted.",
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "name",
                "parameters",
                "N",
                "kind"
              ],
              "properties": {
                "N": {
                  "type": "integer",
                  "maximum": 100,
                  "minimum": 1,
                  "description": "Prediction horizon in steps. Must be >= 1 and <= 100."
                },
                "kind": {
                  "type": "string",
                  "const": "nonlinear",
                  "default": "nonlinear",
                  "description": "Plant kind. Must be \"nonlinear\" for a registered template."
                },
                "name": {
                  "enum": [
                    "double_integrator",
                    "thermal_rc_zone",
                    "soil_moisture_cascade",
                    "unicycle_kinematics",
                    "gravity_tank",
                    "cart_pendulum",
                    "icr_skid_steer",
                    "ackermann"
                  ],
                  "type": "string",
                  "description": "Registered template: double_integrator, thermal_rc_zone, soil_moisture_cascade, unicycle_kinematics, gravity_tank, cart_pendulum, icr_skid_steer, or ackermann."
                },
                "u_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper input bounds, length nu, in the plant's input units. Omit for 1e6 on each input. Input bounds are hard."
                },
                "u_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower input bounds, length nu, in the plant's input units. Omit for -1e6 on each input. Input bounds are hard."
                },
                "x_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper state bounds, length nx, in the plant's state units. Omit for 1e6 on each state. State bounds are soft."
                },
                "x_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower state bounds, length nx, in the plant's state units. Omit for -1e6 on each state. State bounds are soft."
                },
                "du_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper slew bounds on delta-u, length nu. Omit for 1e6 on each input. Slew bounds are hard."
                },
                "du_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
                },
                "parameters": {
                  "type": "object",
                  "description": "Template knobs, one number per required key. double_integrator and unicycle_kinematics: dt > 0 (seconds). thermal_rc_zone: dt > 0, capacity > 0, time_constant > 0, and ambient. soil_moisture_cascade: dt > 0, capacity > 0, tau_1 > 0, tau_2 > 0, tau_3 > 0, k_12 >= 0, k_23 >= 0. gravity_tank: dt > 0, discharge > 0, inflow_gain > 0. cart_pendulum: dt, cart_mass, pole_mass, friction, inertia, gravity, and length, each > 0. icr_skid_steer: dt > 0 and slip, a signed length with abs(slip) <= 10. Body-frame lateral velocity equals slip * yaw_rate. If x_icr is the forward coordinate of the instantaneous center, positive ahead of the reference point, slip = -x_icr. ackermann: dt > 0 and wheelbase > 0. The steer component of u_min and u_max must lie inside ±1.2 rad. Unknown keys are rejected.",
                  "additionalProperties": {
                    "type": "number",
                    "maximum": 1000000000000,
                    "minimum": -1000000000000
                  }
                }
              },
              "description": "Registered dynamics template plus a validated parameter dictionary.",
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "nx",
                "nu",
                "nd",
                "np",
                "f",
                "dt",
                "N",
                "kind"
              ],
              "properties": {
                "C": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Output matrix, shape ny by nx, with ny <= 8. Omit for identity."
                },
                "N": {
                  "type": "integer",
                  "maximum": 60,
                  "minimum": 1,
                  "description": "Prediction horizon in steps. Must be >= 1 and <= 60."
                },
                "f": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 8,
                  "minItems": 1,
                  "description": "One scalar expression per state, length nx. Each string is at most 512 characters and the set is at most 4096. Symbols are x[i], u[i], d[i], p[i], pi, and the smooth allowlist sin, cos, tan, atan, atan2, exp, log, tanh, sqrt, hypot, sq, plus + - * / and ^2 ^3 ^4."
                },
                "p": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "maximum": 1000000000000,
                    "minimum": -1000000000000
                  },
                  "maxItems": 8,
                  "description": "Numeric parameter values, length np. Baked into the discrete map."
                },
                "dt": {
                  "type": "number",
                  "maximum": 1000000,
                  "description": "Sample time. Must be > 0. Continuous plants are zero-order-hold discretized at this step. Use seconds unless A is written in another time unit.",
                  "exclusiveMinimum": 0
                },
                "nd": {
                  "type": "integer",
                  "maximum": 4,
                  "minimum": 0,
                  "description": "Disturbance dimension. Must be >= 0 and <= 4. Zero is a plant with no disturbance channel. An unused d[i] when nd is positive does not change the map and reports detectable false."
                },
                "np": {
                  "type": "integer",
                  "maximum": 8,
                  "minimum": 0,
                  "description": "Parameter dimension. Must be >= 0 and <= 8."
                },
                "nu": {
                  "type": "integer",
                  "maximum": 4,
                  "minimum": 1,
                  "description": "Input dimension. Must be >= 1 and <= 4."
                },
                "nx": {
                  "type": "integer",
                  "maximum": 8,
                  "minimum": 1,
                  "description": "State dimension. Must be >= 1 and <= 8."
                },
                "kind": {
                  "type": "string",
                  "const": "expression",
                  "default": "expression",
                  "description": "Plant kind. Must be \"expression\" for allowlisted scalar expressions."
                },
                "u_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper input bounds, length nu, in the plant's input units. Omit for 1e6 on each input. Input bounds are hard."
                },
                "u_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower input bounds, length nu, in the plant's input units. Omit for -1e6 on each input. Input bounds are hard."
                },
                "x_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper state bounds, length nx, in the plant's state units. Omit for 1e6 on each state. State bounds are soft."
                },
                "x_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower state bounds, length nx, in the plant's state units. Omit for -1e6 on each state. State bounds are soft."
                },
                "du_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper slew bounds on delta-u, length nu. Omit for 1e6 on each input. Slew bounds are hard."
                },
                "du_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
                },
                "time_mode": {
                  "enum": [
                    "continuous",
                    "discrete"
                  ],
                  "type": "string",
                  "default": "continuous",
                  "description": "continuous integrates the expressions with classical RK4 at dt. discrete uses each expression as the next state. Default continuous."
                }
              },
              "description": "Allowlisted scalar expressions, one per state row.\n\n``time_mode`` ``continuous`` is integrated with classical RK4 at ``dt``.\n``discrete`` means each expression is already the next state. ``p`` is a\nnumeric parameter vector baked into the discrete map. ``nd`` may be 0.\nDeclaring ``nd >= 1`` and never using ``d[i]`` is accepted; detectability\nis then false because the disturbance columns of the discrete Jacobian are zero.",
              "additionalProperties": false
            }
          ],
          "description": "Plant to control. Free validate_problem first, then this paid solve, then autotune if the weights are still unknown."
        },
        "u_prev": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number",
                "maximum": 1000000000000,
                "minimum": -1000000000000
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Previous applied input, length nu, used by the slew penalty. Omit for zeros."
        },
        "max_iter": {
          "type": "integer",
          "default": 200,
          "maximum": 500,
          "minimum": 1,
          "description": "IPOPT iteration cap. Default 200, must be >= 1 and <= 500."
        },
        "slack_l1": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 1000000000000,
              "minimum": 0
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "L1 penalty on soft state-bound slack. Must be >= 0. Omit for the solver default 1000."
        },
        "slack_l2": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 1000000000000,
              "minimum": 0
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "L2 penalty on soft state-bound slack. Must be >= 0. Omit for the solver default 100."
        },
        "qf_source": {
          "enum": [
            "caller",
            "discrete_riccati"
          ],
          "type": "string",
          "default": "caller",
          "description": "Terminal weight source. caller uses Qf as sent. discrete_riccati replaces Qf with the discrete algebraic Riccati solution of (A, B, Q, R) on a linear plant."
        },
        "timeout_s": {
          "type": "number",
          "default": 2,
          "maximum": 5,
          "description": "IPOPT wall-clock budget in seconds. Default 2, must be > 0 and <= 5.",
          "exclusiveMinimum": 0
        },
        "d_forecast": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number",
                  "maximum": 1000000000000,
                  "minimum": -1000000000000
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Disturbance forecast, shape N by nd. Omit for a zero forecast."
        },
        "session_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Reuse this id across solve_mpc calls so the shifted primal and dual warm start stays with this closed loop. Omit it for a stateless solve. Max length 128. The seed is stored for this caller only."
        },
        "tube_bound": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number",
                "maximum": 1000000000000,
                "minimum": -1000000000000
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Elementwise magnitude of an additive state disturbance for tube tightening. Length nx. Omit to leave the bounds unchanged. Linear plants only."
        },
        "constraints": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "h": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 8,
                  "description": "Scalar rows, each h(x, u, p) <= 0. At most 8. Symbols are x[i], u[i], p[i], and pi. Same length, depth, and node caps as expression dynamics."
                },
                "p": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "maximum": 1000000000000,
                    "minimum": -1000000000000
                  },
                  "maxItems": 8,
                  "description": "Caller parameters for h, length 0 to 8. On an expression plant, omit this to use the plant p. Obstacle slots do not use this vector and do not count toward the cap."
                },
                "hard": {
                  "type": "boolean",
                  "default": false,
                  "description": "True enforces the rows with no slack. Default false."
                },
                "slack_l1": {
                  "anyOf": [
                    {
                      "type": "number",
                      "maximum": 1000000000000,
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "L1 weight on each inequality slack. Omit for 1000. Ignored when hard is true."
                },
                "slack_l2": {
                  "anyOf": [
                    {
                      "type": "number",
                      "maximum": 1000000000000,
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "L2 weight on each inequality slack. Omit for 100. Ignored when hard is true."
                },
                "obstacles": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "position",
                        "slots"
                      ],
                      "properties": {
                        "slots": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "cx",
                              "cy",
                              "r",
                              "active"
                            ],
                            "properties": {
                              "r": {
                                "type": "number",
                                "maximum": 1000000000000,
                                "minimum": 0,
                                "description": "Radius. Must be >= 0."
                              },
                              "cx": {
                                "type": "number",
                                "maximum": 1000000000000,
                                "minimum": -1000000000000,
                                "description": "Center along the first position index, in the plant's state units."
                              },
                              "cy": {
                                "type": "number",
                                "maximum": 1000000000000,
                                "minimum": -1000000000000,
                                "description": "Center along the second position index, in the plant's state units."
                              },
                              "active": {
                                "type": "number",
                                "maximum": 1000000000000,
                                "minimum": -1000000000000,
                                "description": "1 keeps the circle. 0 drops the row. No other value is accepted."
                              }
                            },
                            "description": "One fixed circle. ``active`` is 0 or 1 and is not part of caller ``p``.",
                            "additionalProperties": false
                          },
                          "maxItems": 8,
                          "minItems": 1,
                          "description": "Circle slots. Length 1 to 8. Each is cx, cy, r, active."
                        },
                        "position": {
                          "type": "array",
                          "items": {
                            "type": "integer"
                          },
                          "maxItems": 2,
                          "minItems": 2,
                          "description": "Two distinct state indexes for the circle plane. Example: [0, 1]."
                        }
                      },
                      "description": "At most eight circles. Their four numbers each sit outside ``np <= 8``.",
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Fixed circles. Omit for none. The row is active * (r^2 - squared distance) <= 0."
                }
              },
              "description": "Allowlisted rows ``h(x, u, p) <= 0`` and fixed obstacle slots.\n\nSoft rows use one slack per node. ``hard`` true removes those slacks.\nA linear plant with any row here uses the nonlinear solver. The linear-only solver option is rejected.",
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional h(x, u, p) <= 0 rows and fixed obstacle slots. Omit for none. Needs the nonlinear solver. The linear-only solver option is rejected."
        },
        "output_weight": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "number",
                  "maximum": 1000000000000,
                  "minimum": -1000000000000
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Weight on the output residual z - z_ref, with z = C x + D u. Shape ny by ny. Omit for a zero weight, which leaves the quadratic cost on x and u unchanged."
        },
        "reset_warm_start": {
          "type": "boolean",
          "default": false,
          "description": "Drop this session_id's warm-start seed before the solve. Default false. The compiled solver stays."
        },
        "linear_input_cost": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number",
                "maximum": 1000000000000,
                "minimum": -1000000000000
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Economic stage price on each input node, length nu. Linear, not squared. Omit for zeros."
        },
        "linear_state_cost": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number",
                "maximum": 1000000000000,
                "minimum": -1000000000000
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Economic stage price on each state node, length nx. Linear, not squared. Omit for zeros."
        },
        "scenario_forecasts": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "maximum": 1000000000000,
                    "minimum": -1000000000000
                  }
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Disturbance scenarios, each shaped N by nd. Omit for one forecast. One input is shared across the scenarios. Linear plants only."
        }
      },
      "description": "Paid constrained solve at $0.02. Send X-API-Key while the pack has solve credits, or pay HTTP 402 with x402 on Base USDC. Validate free first. Autotune is the later step when the weights are unknown.",
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
solve_mpc output schema
{
  "type": "object",
  "additionalProperties": true
}
solve_mpc annotations
{
  "title": "Solve MPC",
  "readOnlyHint": false,
  "openWorldHint": false,
  "idempotentHint": false,
  "destructiveHint": false
}
reset_warm_start — Reset warm start
Advertised by the server during the last successful anonymous check.

Clear one session's shifted primal and dual. Next ``solve_mpc`` / ``POST /v1/solve`` with this ``session_id`` is cold. The compiled solver stays. Stateless calls omit ``session_id`` and already clear warm-start memory, so they do not use this tool.

reset_warm_start input schema
{
  "type": "object",
  "required": [
    "session_id"
  ],
  "properties": {
    "session_id": {
      "type": "string",
      "description": "Session id whose warm-start seed to drop. Required, and at most 128 characters. Free: it does not spend a credit. The compiled solver stays. The next solve_mpc with this id is a cold start. Clearing an unknown id changes nothing."
    }
  },
  "additionalProperties": false
}
reset_warm_start output schema
{
  "type": "object",
  "additionalProperties": true
}
reset_warm_start annotations
{
  "title": "Reset warm start",
  "readOnlyHint": false,
  "openWorldHint": false,
  "idempotentHint": true,
  "destructiveHint": false
}
start_autotune_job — Autotune weights
Advertised by the server during the last successful anonymous check.

Queue an Optuna search for Q, R, Rd, and Qf. Then poll ``get_autotune_job``. The tuner needs discrete or continuous linear matrices A and B, one of double_integrator, thermal_rc_zone, soil_moisture_cascade, cart_pendulum, unicycle_kinematics, gravity_tank, icr_skid_steer, and ackermann, or a kind expression plant with one allowlisted scalar expression per state row. Expressions outside that allowlist are rejected. Optional h rows and fixed obstacle slots, path-frame residuals, and zone bands are accepted. Call this when the weights are unknown and you can afford a closed-loop study with plant mismatch. Optuna tunes Q, R, Rd, and Qf on the single scenario in the request and reports overshoot and settling time. There is no scenario bank and no never-worse check: the result is the best trial of that study, not a comparison with weights you already have. It is an alternative to manual PID or hand-tuned MPC. The reply is a ``job_id``. When payment enforcement is on it also includes a ``job_token`` for ``get_autotune_job``. It does not contain the weights. Poll until ``status`` is ``complete`` or ``failed``. The finished result's ``Q``, ``R``, ``Rd``, and ``Qf`` are the physical weights. ``normalized_Q`` and its siblings are the unitless search box. Payment settles when the job is accepted onto the queue, not when the study finishes. This is POST /v1/autotune at $1.50. Send header X-API-Key when a $29 pack still has an autotune credit. With no key, or when those credits are gone, the call is HTTP 402 and an agent pays with x402. A full queue is HTTP 429 and is not charged. The template study uses sampler seed 7. The study itself stops at ``timeout_seconds``. A process restart marks leftover ``running`` rows ``failed`` with ``interrupted_by_restart`` instead of deleting a paid job.

start_autotune_job input schema
{
  "type": "object",
  "required": [
    "request"
  ],
  "properties": {
    "request": {
      "type": "object",
      "required": [
        "system",
        "scenario",
        "kpi"
      ],
      "properties": {
        "kpi": {
          "type": "object",
          "required": [
            "target_max_overshoot_pct",
            "settling_time_weight",
            "control_effort_weight",
            "slew_penalty_weight",
            "max_optuna_trials",
            "timeout_seconds"
          ],
          "properties": {
            "timeout_seconds": {
              "type": "number",
              "maximum": 120,
              "description": "Study wall-clock limit in seconds. Must be > 0 and <= 120. The study stops at this budget.",
              "exclusiveMinimum": 0
            },
            "max_optuna_trials": {
              "type": "integer",
              "maximum": 40,
              "minimum": 1,
              "description": "Optuna trials in the study. Must be >= 1 and <= 40."
            },
            "slew_penalty_weight": {
              "type": "number",
              "minimum": 0,
              "description": "Weight on input slew in the score. Must be >= 0."
            },
            "settling_time_weight": {
              "type": "number",
              "minimum": 0,
              "description": "Weight on settling time in the score. Must be >= 0."
            },
            "control_effort_weight": {
              "type": "number",
              "minimum": 0,
              "description": "Weight on control effort in the score. Must be >= 0."
            },
            "target_max_overshoot_pct": {
              "type": "number",
              "minimum": 0,
              "description": "Overshoot target in percent. Must be >= 0."
            }
          },
          "description": "Scorecard weights and the Optuna trial and time budget.",
          "additionalProperties": false
        },
        "costs": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "path": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "One path sample per state node, length N+1. Each sample is along, across, and heading, in the position indexes' units and the heading state's units."
                },
                "zones": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "state",
                      "center",
                      "half_width",
                      "weight"
                    ],
                    "properties": {
                      "state": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "State index this band applies to."
                      },
                      "center": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000,
                        "description": "Band center, in that state's units."
                      },
                      "weight": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": 0,
                        "description": "Quadratic weight on the band slack. Zero leaves the band unpaid. Must be >= 0."
                      },
                      "half_width": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": 0,
                        "description": "Half width of the band. Must be >= 0."
                      }
                    },
                    "description": "One slack band. Inside the band the residual is zero.",
                    "additionalProperties": false
                  },
                  "maxItems": 8,
                  "description": "Slack bands, at most 8. Each band is two inequalities and one slack."
                },
                "path_frame": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "position",
                        "heading"
                      ],
                      "properties": {
                        "heading": {
                          "type": "integer",
                          "description": "State index of the heading. Must differ from both position indexes."
                        },
                        "position": {
                          "type": "array",
                          "items": {
                            "type": "integer"
                          },
                          "maxItems": 2,
                          "minItems": 2,
                          "description": "Two distinct state indexes of the plane the path is written in. Example: [0, 1]."
                        },
                        "heading_weight": {
                          "type": "number",
                          "default": 1,
                          "maximum": 1000000000000,
                          "minimum": 0,
                          "description": "Weight on both squared heading residuals, sin(heading error) and 1 - cos(heading error). Must be >= 0. Default 1. The two residuals share this weight."
                        },
                        "lateral_weight": {
                          "type": "number",
                          "default": 1,
                          "maximum": 1000000000000,
                          "minimum": 0,
                          "description": "Weight on the squared cross-track residual. Must be >= 0. Default 1."
                        },
                        "longitudinal_weight": {
                          "type": "number",
                          "default": 1,
                          "maximum": 1000000000000,
                          "minimum": 0,
                          "description": "Weight on the squared along-track residual. Must be >= 0. Default 1."
                        }
                      },
                      "description": "Squared path residuals. Heading uses both sin and 1 - cos.",
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Along-track, cross-track, and heading residuals. Omit for none."
                }
              },
              "description": "Path-frame and zone residuals. Economic prices stay the linear stage vectors.\n\n``linear_state_cost`` and ``linear_input_cost`` are the economic term. They are\nlinear in the node. Path samples, zone centers, half-widths, and weights are\nparameters of the compiled problem.",
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Same path-frame and zone residuals as solve. Omit to tune the quadratic cost only."
        },
        "system": {
          "oneOf": [
            {
              "type": "object",
              "required": [
                "A",
                "B",
                "dt",
                "N",
                "kind"
              ],
              "properties": {
                "A": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "number",
                      "maximum": 1000000000000,
                      "minimum": -1000000000000
                    }
                  },
                  "description": "State matrix, shape nx by nx, with nx <= 24. Discrete map or continuous xdot, matching time_mode."
                },
                "B": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "number",
                      "maximum": 1000000000000,
                      "minimum": -1000000000000
                    }
                  },
                  "description": "Input matrix, shape nx by nu, with nu <= 12."
                },
                "C": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Output matrix, shape ny by nx. Omit for identity, which uses the full state."
                },
                "D": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Feedthrough matrix, shape ny by nu. Omit when there is no direct term."
                },
                "N": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Prediction horizon in steps. Must be >= 1. Values above 100 are rejected."
                },
                "Bd": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Disturbance matrix, shape nx by nd, with nd <= 12. Omit to reuse B as an input disturbance."
                },
                "dt": {
                  "type": "number",
                  "maximum": 1000000,
                  "description": "Sample time. Must be > 0. Continuous plants are zero-order-hold discretized at this step. Use seconds unless A is written in another time unit.",
                  "exclusiveMinimum": 0
                },
                "kind": {
                  "type": "string",
                  "const": "linear",
                  "default": "linear",
                  "description": "Plant kind. Must be \"linear\" for matrices A and B."
                },
                "u_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper input bounds, length nu, in the plant's input units. Omit for 1e6 on each input. Input bounds are hard."
                },
                "u_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower input bounds, length nu, in the plant's input units. Omit for -1e6 on each input. Input bounds are hard."
                },
                "x_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper state bounds, length nx, in the plant's state units. Omit for 1e6 on each state. State bounds are soft."
                },
                "x_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower state bounds, length nx, in the plant's state units. Omit for -1e6 on each state. State bounds are soft."
                },
                "du_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper slew bounds on delta-u, length nu. Omit for 1e6 on each input. Slew bounds are hard."
                },
                "du_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
                },
                "time_mode": {
                  "enum": [
                    "discrete",
                    "continuous"
                  ],
                  "type": "string",
                  "default": "discrete",
                  "description": "discrete uses A and B as given. continuous is zero-order-hold discretized at dt. Default discrete."
                }
              },
              "description": "Discrete or continuous linear plant.\n\nContinuous ``(A, B, Bd)`` are converted with a matrix exponential / zero-order\nhold at ``dt``. Discrete matrices are used as given. ``Bd`` defaults to ``B``\n(input disturbance) when omitted.",
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "name",
                "parameters",
                "N",
                "kind"
              ],
              "properties": {
                "N": {
                  "type": "integer",
                  "maximum": 100,
                  "minimum": 1,
                  "description": "Prediction horizon in steps. Must be >= 1 and <= 100."
                },
                "kind": {
                  "type": "string",
                  "const": "nonlinear",
                  "default": "nonlinear",
                  "description": "Plant kind. Must be \"nonlinear\" for a registered template."
                },
                "name": {
                  "enum": [
                    "double_integrator",
                    "thermal_rc_zone",
                    "soil_moisture_cascade",
                    "unicycle_kinematics",
                    "gravity_tank",
                    "cart_pendulum",
                    "icr_skid_steer",
                    "ackermann"
                  ],
                  "type": "string",
                  "description": "Registered template: double_integrator, thermal_rc_zone, soil_moisture_cascade, unicycle_kinematics, gravity_tank, cart_pendulum, icr_skid_steer, or ackermann."
                },
                "u_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper input bounds, length nu, in the plant's input units. Omit for 1e6 on each input. Input bounds are hard."
                },
                "u_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower input bounds, length nu, in the plant's input units. Omit for -1e6 on each input. Input bounds are hard."
                },
                "x_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper state bounds, length nx, in the plant's state units. Omit for 1e6 on each state. State bounds are soft."
                },
                "x_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower state bounds, length nx, in the plant's state units. Omit for -1e6 on each state. State bounds are soft."
                },
                "du_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper slew bounds on delta-u, length nu. Omit for 1e6 on each input. Slew bounds are hard."
                },
                "du_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
                },
                "parameters": {
                  "type": "object",
                  "description": "Template knobs, one number per required key. double_integrator and unicycle_kinematics: dt > 0 (seconds). thermal_rc_zone: dt > 0, capacity > 0, time_constant > 0, and ambient. soil_moisture_cascade: dt > 0, capacity > 0, tau_1 > 0, tau_2 > 0, tau_3 > 0, k_12 >= 0, k_23 >= 0. gravity_tank: dt > 0, discharge > 0, inflow_gain > 0. cart_pendulum: dt, cart_mass, pole_mass, friction, inertia, gravity, and length, each > 0. icr_skid_steer: dt > 0 and slip, a signed length with abs(slip) <= 10. Body-frame lateral velocity equals slip * yaw_rate. If x_icr is the forward coordinate of the instantaneous center, positive ahead of the reference point, slip = -x_icr. ackermann: dt > 0 and wheelbase > 0. The steer component of u_min and u_max must lie inside ±1.2 rad. Unknown keys are rejected.",
                  "additionalProperties": {
                    "type": "number",
                    "maximum": 1000000000000,
                    "minimum": -1000000000000
                  }
                }
              },
              "description": "Registered dynamics template plus a validated parameter dictionary.",
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "nx",
                "nu",
                "nd",
                "np",
                "f",
                "dt",
                "N",
                "kind"
              ],
              "properties": {
                "C": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "maximum": 1000000000000,
                          "minimum": -1000000000000
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Output matrix, shape ny by nx, with ny <= 8. Omit for identity."
                },
                "N": {
                  "type": "integer",
                  "maximum": 60,
                  "minimum": 1,
                  "description": "Prediction horizon in steps. Must be >= 1 and <= 60."
                },
                "f": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 8,
                  "minItems": 1,
                  "description": "One scalar expression per state, length nx. Each string is at most 512 characters and the set is at most 4096. Symbols are x[i], u[i], d[i], p[i], pi, and the smooth allowlist sin, cos, tan, atan, atan2, exp, log, tanh, sqrt, hypot, sq, plus + - * / and ^2 ^3 ^4."
                },
                "p": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "maximum": 1000000000000,
                    "minimum": -1000000000000
                  },
                  "maxItems": 8,
                  "description": "Numeric parameter values, length np. Baked into the discrete map."
                },
                "dt": {
                  "type": "number",
                  "maximum": 1000000,
                  "description": "Sample time. Must be > 0. Continuous plants are zero-order-hold discretized at this step. Use seconds unless A is written in another time unit.",
                  "exclusiveMinimum": 0
                },
                "nd": {
                  "type": "integer",
                  "maximum": 4,
                  "minimum": 0,
                  "description": "Disturbance dimension. Must be >= 0 and <= 4. Zero is a plant with no disturbance channel. An unused d[i] when nd is positive does not change the map and reports detectable false."
                },
                "np": {
                  "type": "integer",
                  "maximum": 8,
                  "minimum": 0,
                  "description": "Parameter dimension. Must be >= 0 and <= 8."
                },
                "nu": {
                  "type": "integer",
                  "maximum": 4,
                  "minimum": 1,
                  "description": "Input dimension. Must be >= 1 and <= 4."
                },
                "nx": {
                  "type": "integer",
                  "maximum": 8,
                  "minimum": 1,
                  "description": "State dimension. Must be >= 1 and <= 8."
                },
                "kind": {
                  "type": "string",
                  "const": "expression",
                  "default": "expression",
                  "description": "Plant kind. Must be \"expression\" for allowlisted scalar expressions."
                },
                "u_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper input bounds, length nu, in the plant's input units. Omit for 1e6 on each input. Input bounds are hard."
                },
                "u_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower input bounds, length nu, in the plant's input units. Omit for -1e6 on each input. Input bounds are hard."
                },
                "x_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper state bounds, length nx, in the plant's state units. Omit for 1e6 on each state. State bounds are soft."
                },
                "x_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower state bounds, length nx, in the plant's state units. Omit for -1e6 on each state. State bounds are soft."
                },
                "du_max": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Upper slew bounds on delta-u, length nu. Omit for 1e6 on each input. Slew bounds are hard."
                },
                "du_min": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "maximum": 1000000000000,
                        "minimum": -1000000000000
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
                },
                "time_mode": {
                  "enum": [
                    "continuous",
                    "discrete"
                  ],
                  "type": "string",
                  "default": "continuous",
                  "description": "continuous integrates the expressions with classical RK4 at dt. discrete uses each expression as the next state. Default continuous."
                }
              },
              "description": "Allowlisted scalar expressions, one per state row.\n\n``time_mode`` ``continuous`` is integrated with classical RK4 at ``dt``.\n``discrete`` means each expression is already the next state. ``p`` is a\nnumeric parameter vector baked into the discrete map. ``nd`` may be 0.\nDeclaring ``nd >= 1`` and never using ``d[i]`` is accepted; detectability\nis then false because the disturbance columns of the discrete Jacobian are zero.",
              "additionalProperties": false
            }
          ],
          "description": "Plant for the study. Free validate_problem first. This request is the paid autotune step after a solve, when the quadratic weights are still unknown."
        },
        "scenario": {
          "type": "object",
          "required": [
            "x0",
            "step_reference"
          ],
          "properties": {
            "x0": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "description": "Initial state for the rollout, length nx, in the plant's state units."
            },
            "seed": {
              "type": "integer",
              "default": 0,
              "description": "Seed for the sensor noise. Default 0."
            },
            "n_steps": {
              "type": "integer",
              "default": 40,
              "maximum": 200,
              "minimum": 1,
              "description": "Closed-loop steps in the scored rollout. Default 40, must be >= 1 and <= 200."
            },
            "step_reference": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "description": "Step state reference held for the rollout, length nx."
            },
            "sensor_noise_std": {
              "type": "number",
              "default": 0,
              "minimum": 0,
              "description": "Sensor noise standard deviation, in the plant's state units. Default 0, must be >= 0."
            },
            "step_disturbance": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Constant disturbance applied from disturbance_onset_step, length nd. Omit for none."
            },
            "disturbance_onset_step": {
              "type": "integer",
              "default": 0,
              "minimum": 0,
              "description": "Closed-loop step index when step_disturbance turns on. Default 0, must be >= 0."
            },
            "plant_model_mismatch_pct": {
              "type": "number",
              "default": 0,
              "description": "Plant-model mismatch in percent. The plant is scaled by 1 + pct/100. Default 0."
            }
          },
          "description": "Closed-loop rollout the tuner scores, including mismatch and noise.",
          "additionalProperties": false
        },
        "curriculum": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "stages",
                "held_out",
                "timeout_seconds"
              ],
              "properties": {
                "stages": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "scenarios",
                      "validation",
                      "trials"
                    ],
                    "properties": {
                      "trials": {
                        "type": "integer",
                        "maximum": 40,
                        "minimum": 1,
                        "description": "Optuna trials for this stage. Must be >= 1 and <= 40."
                      },
                      "scenarios": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "x0",
                            "step_reference"
                          ],
                          "properties": {
                            "x0": {
                              "type": "array",
                              "items": {
                                "type": "number"
                              },
                              "description": "Initial state for the rollout, length nx, in the plant's state units."
                            },
                            "seed": {
                              "type": "integer",
                              "default": 0,
                              "description": "Seed for the sensor noise. Default 0."
                            },
                            "n_steps": {
                              "type": "integer",
                              "default": 40,
                              "maximum": 200,
                              "minimum": 1,
                              "description": "Closed-loop steps in the scored rollout. Default 40, must be >= 1 and <= 200."
                            },
                            "step_reference": {
                              "type": "array",
                              "items": {
                                "type": "number"
                              },
                              "description": "Step state reference held for the rollout, length nx."
                            },
                            "sensor_noise_std": {
                              "type": "number",
                              "default": 0,
                              "minimum": 0,
                              "description": "Sensor noise standard deviation, in the plant's state units. Default 0, must be >= 0."
                            },
                            "step_disturbance": {
                              "anyOf": [
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "number"
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "default": null,
                              "description": "Constant disturbance applied from disturbance_onset_step, length nd. Omit for none."
                            },
                            "disturbance_onset_step": {
                              "type": "integer",
                              "default": 0,
                              "minimum": 0,
                              "description": "Closed-loop step index when step_disturbance turns on. Default 0, must be >= 0."
                            },
                            "plant_model_mismatch_pct": {
                              "type": "number",
                              "default": 0,
                              "description": "Plant-model mismatch in percent. The plant is scaled by 1 + pct/100. Default 0."
                            }
                          },
                          "description": "Step-reference rollout used by the auto-tuner.",
                          "additionalProperties": false
                        },
                        "maxItems": 12,
                        "minItems": 1,
                        "description": "Training scenarios for this stage. Length 1 to 12. The stage does not add scenarios of its own."
                      },
                      "validation": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "x0",
                            "step_reference"
                          ],
                          "properties": {
                            "x0": {
                              "type": "array",
                              "items": {
                                "type": "number"
                              },
                              "description": "Initial state for the rollout, length nx, in the plant's state units."
                            },
                            "seed": {
                              "type": "integer",
                              "default": 0,
                              "description": "Seed for the sensor noise. Default 0."
                            },
                            "n_steps": {
                              "type": "integer",
                              "default": 40,
                              "maximum": 200,
                              "minimum": 1,
                              "description": "Closed-loop steps in the scored rollout. Default 40, must be >= 1 and <= 200."
                            },
                            "step_reference": {
                              "type": "array",
                              "items": {
                                "type": "number"
                              },
                              "description": "Step state reference held for the rollout, length nx."
                            },
                            "sensor_noise_std": {
                              "type": "number",
                              "default": 0,
                              "minimum": 0,
                              "description": "Sensor noise standard deviation, in the plant's state units. Default 0, must be >= 0."
                            },
                            "step_disturbance": {
                              "anyOf": [
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "number"
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "default": null,
                              "description": "Constant disturbance applied from disturbance_onset_step, length nd. Omit for none."
                            },
                            "disturbance_onset_step": {
                              "type": "integer",
                              "default": 0,
                              "minimum": 0,
                              "description": "Closed-loop step index when step_disturbance turns on. Default 0, must be >= 0."
                            },
                            "plant_model_mismatch_pct": {
                              "type": "number",
                              "default": 0,
                              "description": "Plant-model mismatch in percent. The plant is scaled by 1 + pct/100. Default 0."
                            }
                          },
                          "description": "Step-reference rollout used by the auto-tuner.",
                          "additionalProperties": false
                        },
                        "maxItems": 12,
                        "minItems": 1,
                        "description": "Cap scenarios for this stage. Length 1 to 12. Used by the regression cap, not as the held-out block."
                      }
                    },
                    "description": "One fixed bank. The numbers are the only plant the stage trains on.",
                    "additionalProperties": false
                  },
                  "maxItems": 4,
                  "minItems": 1,
                  "description": "Ordered stages. Length 1 to 4. Each stage warm-starts from the previous stage's best feasible trial."
                },
                "held_out": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "x0",
                      "step_reference"
                    ],
                    "properties": {
                      "x0": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        },
                        "description": "Initial state for the rollout, length nx, in the plant's state units."
                      },
                      "seed": {
                        "type": "integer",
                        "default": 0,
                        "description": "Seed for the sensor noise. Default 0."
                      },
                      "n_steps": {
                        "type": "integer",
                        "default": 40,
                        "maximum": 200,
                        "minimum": 1,
                        "description": "Closed-loop steps in the scored rollout. Default 40, must be >= 1 and <= 200."
                      },
                      "step_reference": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        },
                        "description": "Step state reference held for the rollout, length nx."
                      },
                      "sensor_noise_std": {
                        "type": "number",
                        "default": 0,
                        "minimum": 0,
                        "description": "Sensor noise standard deviation, in the plant's state units. Default 0, must be >= 0."
                      },
                      "step_disturbance": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "number"
                            }
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "Constant disturbance applied from disturbance_onset_step, length nd. Omit for none."
                      },
                      "disturbance_onset_step": {
                        "type": "integer",
                        "default": 0,
                        "minimum": 0,
                        "description": "Closed-loop step index when step_disturbance turns on. Default 0, must be >= 0."
                      },
                      "plant_model_mismatch_pct": {
                        "type": "number",
                        "default": 0,
                        "description": "Plant-model mismatch in percent. The plant is scaled by 1 + pct/100. Default 0."
                      }
                    },
                    "description": "Step-reference rollout used by the auto-tuner.",
                    "additionalProperties": false
                  },
                  "maxItems": 12,
                  "minItems": 1,
                  "description": "Required scenarios scored after the last stage. They are not used to train or to apply the cap."
                },
                "timeout_seconds": {
                  "type": "number",
                  "maximum": 120,
                  "description": "Wall-clock budget for every stage and the held-out scoring, in seconds. Must be > 0 and <= 120.",
                  "exclusiveMinimum": 0
                }
              },
              "description": "Declarative stages. JSON only: there is no code to run.",
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional JSON stages. Omit to tune the single scenario in this request. When set, each stage uses only its supplied scenarios and the held-out block is scored afterward."
        },
        "constraints": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "h": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 8,
                  "description": "Scalar rows, each h(x, u, p) <= 0. At most 8. Symbols are x[i], u[i], p[i], and pi. Same length, depth, and node caps as expression dynamics."
                },
                "p": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "maximum": 1000000000000,
                    "minimum": -1000000000000
                  },
                  "maxItems": 8,
                  "description": "Caller parameters for h, length 0 to 8. On an expression plant, omit this to use the plant p. Obstacle slots do not use this vector and do not count toward the cap."
                },
                "hard": {
                  "type": "boolean",
                  "default": false,
                  "description": "True enforces the rows with no slack. Default false."
                },
                "slack_l1": {
                  "anyOf": [
                    {
                      "type": "number",
                      "maximum": 1000000000000,
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "L1 weight on each inequality slack. Omit for 1000. Ignored when hard is true."
                },
                "slack_l2": {
                  "anyOf": [
                    {
                      "type": "number",
                      "maximum": 1000000000000,
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "L2 weight on each inequality slack. Omit for 100. Ignored when hard is true."
                },
                "obstacles": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "position",
                        "slots"
                      ],
                      "properties": {
                        "slots": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "cx",
                              "cy",
                              "r",
                              "active"
                            ],
                            "properties": {
                              "r": {
                                "type": "number",
                                "maximum": 1000000000000,
                                "minimum": 0,
                                "description": "Radius. Must be >= 0."
                              },
                              "cx": {
                                "type": "number",
                                "maximum": 1000000000000,
                                "minimum": -1000000000000,
                                "description": "Center along the first position index, in the plant's state units."
                              },
                              "cy": {
                                "type": "number",
                                "maximum": 1000000000000,
                                "minimum": -1000000000000,
                                "description": "Center along the second position index, in the plant's state units."
                              },
                              "active": {
                                "type": "number",
                                "maximum": 1000000000000,
                                "minimum": -1000000000000,
                                "description": "1 keeps the circle. 0 drops the row. No other value is accepted."
                              }
                            },
                            "description": "One fixed circle. ``active`` is 0 or 1 and is not part of caller ``p``.",
                            "additionalProperties": false
                          },
                          "maxItems": 8,
                          "minItems": 1,
                          "description": "Circle slots. Length 1 to 8. Each is cx, cy, r, active."
                        },
                        "position": {
                          "type": "array",
                          "items": {
                            "type": "integer"
                          },
                          "maxItems": 2,
                          "minItems": 2,
                          "description": "Two distinct state indexes for the circle plane. Example: [0, 1]."
                        }
                      },
                      "description": "At most eight circles. Their four numbers each sit outside ``np <= 8``.",
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Fixed circles. Omit for none. The row is active * (r^2 - squared distance) <= 0."
                }
              },
              "description": "Allowlisted rows ``h(x, u, p) <= 0`` and fixed obstacle slots.\n\nSoft rows use one slack per node. ``hard`` true removes those slacks.\nA linear plant with any row here uses the nonlinear solver. The linear-only solver option is rejected.",
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Same h rows and obstacle slots as solve. Omit for an unconstrained study."
        }
      },
      "description": "Paid Optuna study at $1.50. Send X-API-Key while the pack has an autotune credit, or pay HTTP 402 with x402 on Base USDC. Validate the plant free first, then solve, then this job when Q, R, Rd, and Qf are unknown. Each call starts a new job. Poll get_autotune_job with the returned job_id.",
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
start_autotune_job output schema
{
  "type": "object",
  "additionalProperties": {
    "type": "string"
  }
}
start_autotune_job annotations
{
  "title": "Autotune weights",
  "readOnlyHint": false,
  "openWorldHint": false,
  "idempotentHint": false,
  "destructiveHint": false
}
get_autotune_job — Read an autotune job
Advertised by the server during the last successful anonymous check.
Advertised read-only

Read one autotune job started by ``start_autotune_job``. ``status`` is ``running``, ``complete``, or ``failed``. On ``complete``, ``result`` holds the Pareto-best weights, overshoot, settling time, RMSE, and solve time. Poll again while it is ``running``. When payment enforcement is on, pass the ``job_token`` from the start call or the ``X-Job-Token`` header. A failed job reports ``autotune_failed``.

get_autotune_job input schema
{
  "type": "object",
  "required": [
    "job_id"
  ],
  "properties": {
    "job_id": {
      "type": "string",
      "description": "Job id returned by start_autotune_job."
    },
    "job_token": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Token returned with the job when payment enforcement is on. Omit it when the X-Job-Token header carries the same token. This poll is free and does not spend a credit."
    }
  },
  "additionalProperties": false
}
get_autotune_job output schema
{
  "type": "object",
  "additionalProperties": true
}
get_autotune_job annotations
{
  "title": "Read an autotune job",
  "readOnlyHint": true,
  "openWorldHint": false,
  "idempotentHint": true,
  "destructiveHint": false
}
autotune_root_zone_irrigation — Autotune root-zone irrigation
Advertised by the server during the last successful anonymous check.

Tune valve weights for the three-layer root-zone irrigation template. Same payment as autotune_template: X-API-Key spends 2 autotune credits, and a missing key or an empty pack is HTTP 402 for x402. The default study is physics-v1. Pass study_version published to run the older scenario.

autotune_root_zone_irrigation input schema
{
  "type": "object",
  "properties": {
    "max_trials": {
      "type": "integer",
      "default": 20,
      "description": "Optuna trials for the root-zone irrigation plant. Default 20. Values below 1 are raised to 1. Paid at $2.00: X-API-Key spends 2 autotune credits, or HTTP 402 is x402 Base USDC. Each call starts a new study."
    },
    "study_version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Omit for physics-v1 (start [0.17, 0.22, 0.22], horizon 9). published keeps the older start-on-reference horizon 24 scenario."
    }
  },
  "additionalProperties": false
}
autotune_root_zone_irrigation output schema
{
  "type": "object",
  "additionalProperties": true
}
autotune_root_zone_irrigation annotations
{
  "title": "Autotune root-zone irrigation",
  "readOnlyHint": false,
  "openWorldHint": false,
  "idempotentHint": false,
  "destructiveHint": false
}
autotune_battery_peak_shaving — Autotune battery peak shaving
Advertised by the server during the last successful anonymous check.

Tune charge power weights for the battery peak-shaving template. Same payment as autotune_template: X-API-Key spends 2 autotune credits, and a missing key or an empty pack is HTTP 402 for x402.

autotune_battery_peak_shaving input schema
{
  "type": "object",
  "properties": {
    "max_trials": {
      "type": "integer",
      "default": 20,
      "description": "Optuna trials for the battery peak-shaving plant. Default 20. Values below 1 are raised to 1. Paid at $2.00: X-API-Key spends 2 autotune credits, or HTTP 402 is x402 Base USDC. Each call starts a new study."
    }
  },
  "additionalProperties": false
}
autotune_battery_peak_shaving output schema
{
  "type": "object",
  "additionalProperties": true
}
autotune_battery_peak_shaving annotations
{
  "title": "Autotune battery peak shaving",
  "readOnlyHint": false,
  "openWorldHint": false,
  "idempotentHint": false,
  "destructiveHint": false
}
autotune_embedded_controller_with_c_codegen — Autotune an embedded controller
Advertised by the server during the last successful anonymous check.

Tune a linear plant and write a zero-heap C99 bundle. The reply's ``codegen`` object lists ``mpc_bundle.h`` and ``mpc_bundle.c`` plus ``usage_example_c`` and ``controller_kind``. A linear plant is a condensed QP (``linear_qp``). A nonlinear plant, including differential drive, is a linearized iteration (``linearized_rti``): Jacobians at the current state, then projected-gradient steps. That is not a full nonlinear SQP. Compile with ``gcc -O3 -std=c99 -Wall -Wextra -fPIC -shared -lm``. Each control step is ``mpc_compute_u0`` then, after the plant measurement, ``mpc_observer_update``. Neither function allocates on the heap. ``MPC_NX``, ``MPC_NU``, ``MPC_ND``, and ``MPC_HORIZON`` in the header are the array sizes. Same payment as autotune_template: X-API-Key spends 2 autotune credits, and a missing key or an empty pack is HTTP 402 for x402.

autotune_embedded_controller_with_c_codegen input schema
{
  "type": "object",
  "properties": {
    "max_trials": {
      "type": "integer",
      "default": 1,
      "description": "Optuna trials before the C99 bundle is written. Default 1. Values below 1 are raised to 1. Paid at $2.00: X-API-Key spends 2 autotune credits, or HTTP 402 is x402 Base USDC. Each call starts a new study and writes a new bundle."
    }
  },
  "additionalProperties": false
}
autotune_embedded_controller_with_c_codegen output schema
{
  "type": "object",
  "additionalProperties": true
}
autotune_embedded_controller_with_c_codegen annotations
{
  "title": "Autotune an embedded controller",
  "readOnlyHint": false,
  "openWorldHint": false,
  "idempotentHint": false,
  "destructiveHint": false
}
autotune_template — Autotune a template
Advertised by the server during the last successful anonymous check.

Tune differential_drive, battery_peak_shaving, or root_zone_irrigation. This is POST /v1/templates/autotune at $2.00. The name is differential_drive, battery_peak_shaving, or root_zone_irrigation. The reply returns tuned Q, R, Rd, and Qf. Send name and max_trials. Send header X-API-Key when a $29 pack still has autotune credits. One call spends 2 of those credits. With no key, or when the credits are gone, the call is HTTP 402 and an agent pays with x402. The reply returns the tuned weights for that template. Payment uses the same gate as the HTTP route.

autotune_template input schema
{
  "type": "object",
  "required": [
    "request"
  ],
  "properties": {
    "request": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "enum": [
            "root_zone_irrigation",
            "battery_peak_shaving",
            "differential_drive"
          ],
          "type": "string",
          "description": "Built-in plant: root_zone_irrigation, battery_peak_shaving, or differential_drive."
        },
        "max_trials": {
          "type": "integer",
          "default": 20,
          "maximum": 30,
          "minimum": 1,
          "description": "Optuna trials for that plant. Default 20, must be >= 1 and <= 30."
        },
        "study_version": {
          "anyOf": [
            {
              "enum": [
                "published",
                "physics-v1"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Irrigation only. Omit for physics-v1: start [0.17, 0.22, 0.22], comfort reference, horizon 9. published keeps the older start-on-reference horizon 24 scenario."
        }
      },
      "description": "Paid template tune at $2.00 for differential_drive, battery_peak_shaving, or root_zone_irrigation. Send X-API-Key (spends 2 autotune credits) or pay HTTP 402 with x402 on Base USDC. Validate a custom plant free first; these three names are built in. Each call starts a new study.",
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
autotune_template output schema
{
  "type": "object",
  "additionalProperties": true
}
autotune_template annotations
{
  "title": "Autotune a template",
  "readOnlyHint": false,
  "openWorldHint": false,
  "idempotentHint": false,
  "destructiveHint": false
}

Prompts

0 advertised

No prompt definitions available.

Resources

0 advertised

No resource definitions available.

90-day uptime

A lightweight connection check about every six hours, sampled on hosts with many listings. It shows the server answered, not that its tools work.

Too few checks for a percentage yet (7 of 7 answered).

  1. 2026-11-22: 1 of 1 checks answered
  2. 2026-11-23: 4 of 4 checks answered
  3. 2026-11-24: 2 of 2 checks answered

30-day availability

Aggregated from read-only remote checks; this is not a tool-execution or security guarantee.

Successful checks
2 of 2 (100%)
Average latency
927 ms
95th percentile latency
1127 ms

Maintenance history

Public check and source-refresh events. Editorial and ownership records remain private.

  • · probe · passed · 1149 ms · metadata changed · 10 tool(s), 0 resource(s), 0 resource template(s), 0 prompt(s)
  • · probe · passed · 704 ms · metadata changed · 10 tool(s), 0 resource(s), 0 resource template(s), 0 prompt(s)

Connect from your client

Each snippet registers the same endpoint; pick the client you use.

This server is operated by the named third party. Listing and endpoint checks are not an endorsement or a security audit. Review the operator's permissions, terms, and data handling before connecting. How listings are checked and corrected.

Claude Code

Run this once in a terminal. It registers the remote server. Use --scope project to write .mcp.json for the repo.
Claude Code configuration
claude mcp add --transport http autotunempc https://api.autotunempc.com/mcp

Codex

Run this once. Codex stores MCP servers in ~/.codex/config.toml (or .codex/config.toml in a trusted project).
Codex configuration
codex mcp add autotunempc --url https://api.autotunempc.com/mcp

Cursor

Merge this server into .cursor/mcp.json in your project, then enable autotunempc in your MCP settings.
Cursor configuration
{
  "mcpServers": {
    "autotunempc": {
      "url": "https://api.autotunempc.com/mcp"
    }
  }
}

Cline

Merge this into cline_mcp_settings.json (Cline → MCP Servers → Configure).
Cline configuration
{
  "mcpServers": {
    "autotunempc": {
      "type": "streamableHttp",
      "url": "https://api.autotunempc.com/mcp",
      "disabled": false
    }
  }
}

VS Code

Merge this server into .vscode/mcp.json. Use MCP: List Servers to start autotunempc and inspect its tools.
VS Code configuration
{
  "servers": {
    "autotunempc": {
      "type": "http",
      "url": "https://api.autotunempc.com/mcp"
    }
  }
}

Gemini CLI

Run this once. It writes .gemini/settings.json in the current project; pass --scope user for ~/.gemini/settings.json.
Gemini CLI configuration
gemini mcp add --transport http autotunempc https://api.autotunempc.com/mcp

Claude Desktop

Open Claude Settings > Connectors > Add custom connector, enter this server URL and enable it for the conversation. This is a manual remote-connector handoff, not a desktop JSON configuration.
Claude Desktop configuration
https://api.autotunempc.com/mcp

Windsurf

Merge this into ~/.codeium/windsurf/mcp_config.json, then refresh MCP in Cascade. Windsurf remote servers use serverUrl, not url.
Windsurf configuration
{
  "mcpServers": {
    "autotunempc": {
      "serverUrl": "https://api.autotunempc.com/mcp"
    }
  }
}

Let your agent find its tools

Find servers like AutoTuneMPC from your agent. Add Koskamo once to search the index for endpoints, access requirements, and client setup. Public discovery needs no key.

Do you run AutoTuneMPC?

Prove ownership with a DNS record, a well-known file, or your Official MCP Registry entry, and your edits publish immediately. Proofs are re-checked weekly; admins can still hide or remove a listing.

Claim this listing