Skip to main content
Glama

Solve MPC

solve_mpc

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "request": "<request>"
    },
    "name": "solve_mpc"
  }
}

Input Schema

NameRequiredDescriptionDefault
requestYesPaid 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.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • addedInput schema / properties / request / properties / linear_input_cost
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Linear stage cost on each input node, length nu. Omit for zeros."
      +}
    • addedInput schema / properties / request / properties / linear_state_cost
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Linear stage cost on each state node, length nx. Omit for zeros."
      +}
    • addedInput schema / properties / request / properties / output_weight
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "items": {
      +          "type": "number"
      +        },
      +        "type": "array"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "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."
      +}
    • addedInput schema / properties / request / properties / qf_source
      Added value: +{
      +  "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.",
      +  "enum": [
      +    "caller",
      +    "discrete_riccati"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / request / properties / scenario_forecasts
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "items": {
      +          "items": {
      +            "type": "number"
      +          },
      +          "type": "array"
      +        },
      +        "type": "array"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "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."
      +}
    • addedInput schema / properties / request / properties / solver
      Added value: +{
      +  "default": "auto",
      +  "description": "Leave this at auto. The server selects the numerical method.",
      +  "type": "string"
      +}
    • changedInput schema / properties / request / properties / system / oneOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "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.",
      -    "properties": {
      -      "A": {
      -        "description": "State matrix, shape nx by nx, with nx <= 24. Discrete map or continuous xdot, matching time_mode.",
      -        "items": {
      -          "items": {
      -            "type": "number"
      -          },
      -          "type": "array"
      -        },
      -        "type": "array"
      -      },
      -      "B": {
      -        "description": "Input matrix, shape nx by nu, with nu <= 12.",
      -        "items": {
      -          "items": {
      -            "type": "number"
      -          },
      -          "type": "array"
      -        },
      -        "type": "array"
      -      },
      -      "Bd": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "items": {
      -                "type": "number"
      -              },
      -              "type": "array"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Disturbance matrix, shape nx by nd, with nd <= 12. Omit to reuse B as an input disturbance."
      -      },
      -      "C": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "items": {
      -                "type": "number"
      -              },
      -              "type": "array"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Output matrix, shape ny by nx. Omit for identity, which uses the full state."
      -      },
      -      "D": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "items": {
      -                "type": "number"
      -              },
      -              "type": "array"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Feedthrough matrix, shape ny by nu. Omit when there is no direct term."
      -      },
      -      "N": {
      -        "description": "Prediction horizon in steps. Must be >= 1. Values above 100 are rejected.",
      -        "minimum": 1,
      -        "type": "integer"
      -      },
      -      "dt": {
      -        "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,
      -        "type": "number"
      -      },
      -      "du_max": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "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": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
      -      },
      -      "kind": {
      -        "const": "linear",
      -        "default": "linear",
      -        "description": "Plant kind. Must be \"linear\" for matrices A and B.",
      -        "type": "string"
      -      },
      -      "time_mode": {
      -        "default": "discrete",
      -        "description": "discrete uses A and B as given. continuous is zero-order-hold discretized at dt. Default discrete.",
      -        "enum": [
      -          "discrete",
      -          "continuous"
      -        ],
      -        "type": "string"
      -      },
      -      "u_max": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "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": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "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": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "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": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "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."
      -      }
      -    },
      -    "required": [
      -      "A",
      -      "B",
      -      "dt",
      -      "N",
      -      "kind"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "description": "Registered dynamics template plus a validated parameter dictionary.",
      -    "properties": {
      -      "N": {
      -        "description": "Prediction horizon in steps. Must be >= 1 and <= 100.",
      -        "maximum": 100,
      -        "minimum": 1,
      -        "type": "integer"
      -      },
      -      "du_max": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "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": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
      -      },
      -      "kind": {
      -        "const": "nonlinear",
      -        "default": "nonlinear",
      -        "description": "Plant kind. Must be \"nonlinear\" for a registered template.",
      -        "type": "string"
      -      },
      -      "name": {
      -        "description": "Registered template: double_integrator, thermal_rc_zone, soil_moisture_cascade, or unicycle_kinematics.",
      -        "enum": [
      -          "double_integrator",
      -          "thermal_rc_zone",
      -          "soil_moisture_cascade",
      -          "unicycle_kinematics"
      -        ],
      -        "type": "string"
      -      },
      -      "parameters": {
      -        "additionalProperties": {
      -          "type": "number"
      -        },
      -        "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. Unknown keys are rejected.",
      -        "type": "object"
      -      },
      -      "u_max": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "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": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "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": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "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": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "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."
      -      }
      -    },
      -    "required": [
      -      "name",
      -      "parameters",
      -      "N",
      -      "kind"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "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.",
      +    "properties": {
      +      "A": {
      +        "description": "State matrix, shape nx by nx, with nx <= 24. Discrete map or continuous xdot, matching time_mode.",
      +        "items": {
      +          "items": {
      +            "type": "number"
      +          },
      +          "type": "array"
      +        },
      +        "type": "array"
      +      },
      +      "B": {
      +        "description": "Input matrix, shape nx by nu, with nu <= 12.",
      +        "items": {
      +          "items": {
      +            "type": "number"
      +          },
      +          "type": "array"
      +        },
      +        "type": "array"
      +      },
      +      "Bd": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "items": {
      +                "type": "number"
      +              },
      +              "type": "array"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Disturbance matrix, shape nx by nd, with nd <= 12. Omit to reuse B as an input disturbance."
      +      },
      +      "C": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "items": {
      +                "type": "number"
      +              },
      +              "type": "array"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Output matrix, shape ny by nx. Omit for identity, which uses the full state."
      +      },
      +      "D": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "items": {
      +                "type": "number"
      +              },
      +              "type": "array"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Feedthrough matrix, shape ny by nu. Omit when there is no direct term."
      +      },
      +      "N": {
      +        "description": "Prediction horizon in steps. Must be >= 1. Values above 100 are rejected.",
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "dt": {
      +        "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,
      +        "type": "number"
      +      },
      +      "du_max": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
      +      },
      +      "kind": {
      +        "const": "linear",
      +        "default": "linear",
      +        "description": "Plant kind. Must be \"linear\" for matrices A and B.",
      +        "type": "string"
      +      },
      +      "time_mode": {
      +        "default": "discrete",
      +        "description": "discrete uses A and B as given. continuous is zero-order-hold discretized at dt. Default discrete.",
      +        "enum": [
      +          "discrete",
      +          "continuous"
      +        ],
      +        "type": "string"
      +      },
      +      "u_max": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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."
      +      }
      +    },
      +    "required": [
      +      "A",
      +      "B",
      +      "dt",
      +      "N",
      +      "kind"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "description": "Registered dynamics template plus a validated parameter dictionary.",
      +    "properties": {
      +      "N": {
      +        "description": "Prediction horizon in steps. Must be >= 1 and <= 100.",
      +        "maximum": 100,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "du_max": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
      +      },
      +      "kind": {
      +        "const": "nonlinear",
      +        "default": "nonlinear",
      +        "description": "Plant kind. Must be \"nonlinear\" for a registered template.",
      +        "type": "string"
      +      },
      +      "name": {
      +        "description": "Registered template: double_integrator, thermal_rc_zone, soil_moisture_cascade, unicycle_kinematics, gravity_tank, or cart_pendulum.",
      +        "enum": [
      +          "double_integrator",
      +          "thermal_rc_zone",
      +          "soil_moisture_cascade",
      +          "unicycle_kinematics",
      +          "gravity_tank",
      +          "cart_pendulum"
      +        ],
      +        "type": "string"
      +      },
      +      "parameters": {
      +        "additionalProperties": {
      +          "type": "number"
      +        },
      +        "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. Unknown keys are rejected.",
      +        "type": "object"
      +      },
      +      "u_max": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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."
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "parameters",
      +      "N",
      +      "kind"
      +    ],
      +    "type": "object"
      +  }
      +]
    • addedInput schema / properties / request / properties / tube_bound
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "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."
      +}
    • addedInput schema / properties / request / properties / z_ref
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Output reference, length ny, held at every stage. Omit for zeros."
      +}
  2. Changed20 schema fields changed
    • addedInput schema / properties / request / description
      Added value: +"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."
    • addedInput schema / properties / request / properties / Q / description
      Added value: +"Stage state weight, shape nx by nx."
    • addedInput schema / properties / request / properties / Qf / description
      Added value: +"Terminal state weight, shape nx by nx."
    • addedInput schema / properties / request / properties / R / description
      Added value: +"Input weight, shape nu by nu."
    • addedInput schema / properties / request / properties / Rd / description
      Added value: +"Slew weight on delta-u, shape nu by nu."
    • addedInput schema / properties / request / properties / U_ref / description
      Added value: +"Input reference over the horizon, shape N by nu. Omit for the equilibrium input."
    • addedInput schema / properties / request / properties / X_ref / description
      Added value: +"State reference over the horizon, shape (N+1) by nx. Omit to hold x_ref."
    • addedInput schema / properties / request / properties / d_forecast / description
      Added value: +"Disturbance forecast, shape N by nd. Omit for a zero forecast."
    • addedInput schema / properties / request / properties / d_hat / description
      Added value: +"Constant disturbance estimate, length nd. Omit for zeros."
    • addedInput schema / properties / request / properties / max_iter / description
      Added value: +"IPOPT iteration cap. Default 200, must be >= 1 and <= 500."
    • changedInput schema / properties / request / properties / reset_warm_start / description
      Previous value: -"Drop this session_id's warm-start seed before the solve. The compiled solver stays."New value: +"Drop this session_id's warm-start seed before the solve. Default false. The compiled solver stays."
    • changedInput schema / properties / request / properties / session_id / description
      Previous value: -"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. The seed is stored for this caller only."New value: +"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."
    • addedInput schema / properties / request / properties / slack_l1 / description
      Added value: +"L1 penalty on soft state-bound slack. Must be >= 0. Omit for the solver default 1000."
    • addedInput schema / properties / request / properties / slack_l2 / description
      Added value: +"L2 penalty on soft state-bound slack. Must be >= 0. Omit for the solver default 100."
    • addedInput schema / properties / request / properties / system / description
      Added value: +"Plant to control. Free validate_problem first, then this paid solve, then autotune if the weights are still unknown."
    • changedInput schema / properties / request / properties / system / oneOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "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.",
      -    "properties": {
      -      "A": {
      -        "items": {
      -          "items": {
      -            "type": "number"
      -          },
      -          "type": "array"
      -        },
      -        "type": "array"
      -      },
      -      "B": {
      -        "items": {
      -          "items": {
      -            "type": "number"
      -          },
      -          "type": "array"
      -        },
      -        "type": "array"
      -      },
      -      "Bd": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "items": {
      -                "type": "number"
      -              },
      -              "type": "array"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "C": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "items": {
      -                "type": "number"
      -              },
      -              "type": "array"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "D": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "items": {
      -                "type": "number"
      -              },
      -              "type": "array"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "N": {
      -        "minimum": 1,
      -        "type": "integer"
      -      },
      -      "dt": {
      -        "exclusiveMinimum": 0,
      -        "type": "number"
      -      },
      -      "du_max": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "du_min": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "kind": {
      -        "const": "linear",
      -        "default": "linear",
      -        "type": "string"
      -      },
      -      "time_mode": {
      -        "default": "discrete",
      -        "enum": [
      -          "discrete",
      -          "continuous"
      -        ],
      -        "type": "string"
      -      },
      -      "u_max": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "u_min": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "x_max": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "x_min": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      }
      -    },
      -    "required": [
      -      "A",
      -      "B",
      -      "dt",
      -      "N",
      -      "kind"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "description": "Registered dynamics template plus a validated parameter dictionary.",
      -    "properties": {
      -      "N": {
      -        "maximum": 100,
      -        "minimum": 1,
      -        "type": "integer"
      -      },
      -      "du_max": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "du_min": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "kind": {
      -        "const": "nonlinear",
      -        "default": "nonlinear",
      -        "type": "string"
      -      },
      -      "name": {
      -        "enum": [
      -          "double_integrator",
      -          "thermal_rc_zone",
      -          "soil_moisture_cascade",
      -          "unicycle_kinematics"
      -        ],
      -        "type": "string"
      -      },
      -      "parameters": {
      -        "additionalProperties": {
      -          "type": "number"
      -        },
      -        "type": "object"
      -      },
      -      "u_max": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "u_min": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "x_max": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "x_min": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "number"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      }
      -    },
      -    "required": [
      -      "name",
      -      "parameters",
      -      "N",
      -      "kind"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "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.",
      +    "properties": {
      +      "A": {
      +        "description": "State matrix, shape nx by nx, with nx <= 24. Discrete map or continuous xdot, matching time_mode.",
      +        "items": {
      +          "items": {
      +            "type": "number"
      +          },
      +          "type": "array"
      +        },
      +        "type": "array"
      +      },
      +      "B": {
      +        "description": "Input matrix, shape nx by nu, with nu <= 12.",
      +        "items": {
      +          "items": {
      +            "type": "number"
      +          },
      +          "type": "array"
      +        },
      +        "type": "array"
      +      },
      +      "Bd": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "items": {
      +                "type": "number"
      +              },
      +              "type": "array"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Disturbance matrix, shape nx by nd, with nd <= 12. Omit to reuse B as an input disturbance."
      +      },
      +      "C": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "items": {
      +                "type": "number"
      +              },
      +              "type": "array"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Output matrix, shape ny by nx. Omit for identity, which uses the full state."
      +      },
      +      "D": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "items": {
      +                "type": "number"
      +              },
      +              "type": "array"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Feedthrough matrix, shape ny by nu. Omit when there is no direct term."
      +      },
      +      "N": {
      +        "description": "Prediction horizon in steps. Must be >= 1. Values above 100 are rejected.",
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "dt": {
      +        "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,
      +        "type": "number"
      +      },
      +      "du_max": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
      +      },
      +      "kind": {
      +        "const": "linear",
      +        "default": "linear",
      +        "description": "Plant kind. Must be \"linear\" for matrices A and B.",
      +        "type": "string"
      +      },
      +      "time_mode": {
      +        "default": "discrete",
      +        "description": "discrete uses A and B as given. continuous is zero-order-hold discretized at dt. Default discrete.",
      +        "enum": [
      +          "discrete",
      +          "continuous"
      +        ],
      +        "type": "string"
      +      },
      +      "u_max": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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."
      +      }
      +    },
      +    "required": [
      +      "A",
      +      "B",
      +      "dt",
      +      "N",
      +      "kind"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "description": "Registered dynamics template plus a validated parameter dictionary.",
      +    "properties": {
      +      "N": {
      +        "description": "Prediction horizon in steps. Must be >= 1 and <= 100.",
      +        "maximum": 100,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "du_max": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Lower slew bounds on delta-u, length nu. Omit for -1e6 on each input. Slew bounds are hard."
      +      },
      +      "kind": {
      +        "const": "nonlinear",
      +        "default": "nonlinear",
      +        "description": "Plant kind. Must be \"nonlinear\" for a registered template.",
      +        "type": "string"
      +      },
      +      "name": {
      +        "description": "Registered template: double_integrator, thermal_rc_zone, soil_moisture_cascade, or unicycle_kinematics.",
      +        "enum": [
      +          "double_integrator",
      +          "thermal_rc_zone",
      +          "soil_moisture_cascade",
      +          "unicycle_kinematics"
      +        ],
      +        "type": "string"
      +      },
      +      "parameters": {
      +        "additionalProperties": {
      +          "type": "number"
      +        },
      +        "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. Unknown keys are rejected.",
      +        "type": "object"
      +      },
      +      "u_max": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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": [
      +          {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "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."
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "parameters",
      +      "N",
      +      "kind"
      +    ],
      +    "type": "object"
      +  }
      +]
    • addedInput schema / properties / request / properties / timeout_s / description
      Added value: +"IPOPT wall-clock budget in seconds. Default 2, must be > 0 and <= 5."
    • addedInput schema / properties / request / properties / u_prev / description
      Added value: +"Previous applied input, length nu, used by the slew penalty. Omit for zeros."
    • addedInput schema / properties / request / properties / x0 / description
      Added value: +"Initial state, length nx, at most 24 entries, in the plant's state units."
    • addedInput schema / properties / request / properties / x_ref / description
      Added value: +"Constant state reference, length nx, at most 24 entries. Ignored for the trajectory when X_ref is set."
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only supply readOnly=false, idempotent=false, destructive=false, so the description has to carry cost and side-effect information, and it does: $0.02 per call, X-API-Key credit path versus HTTP 402 with x402, 'there is no second payment path', server-side state retained per session, and reset clearing only the seed while the compiled solver stays. The statement that it is a paid POST consuming credits is consistent with readOnlyHint=false and non-idempotent solving.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded and the when-not-to-use and payment paragraphs earn their place. There is some redundancy: the warm-start role of session_id is stated three times across paragraphs, and the reset_warm_start paragraph largely restates the parameter's schema description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, yet the description still names the key return values (u0 and the predicted trajectory). For a paid, stateful, nested-schema solver, the definition covers cost, auth, state persistence, reset behavior, and prerequisites, so an agent has everything needed to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the nested request object documents every field, so the baseline is 3. The description reinforces the two stateful parameters (session_id warm start restore across closed-loop calls, reset_warm_start dropping the seed for that caller) but adds little syntax or meaning the schema does not already state.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names a specific verb and resource (solving a multi-step constrained MPC problem server-side), and the description goes on to state the problem class it covers (soft state bounds, hard input and slew limits, offset-free disturbance rejection) and the return (u0 plus predicted trajectory). Siblings are implicitly separated by naming the free validate_problem step and the later autotune step.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit when-to-use conditions, an explicit exclusion ('Do not call this for a one-step linear update you can do locally... those do not need IPOPT'), and routes the agent through alternatives: validate_problem free first, autotune when weights are unknown, and the reset_warm_start tool as an alternative to the flag. This is about as complete as routing guidance gets.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.