Skip to main content
Glama
eng-toolkit

eng-toolkit

by Lin830326

Control Discretize

control_discretize

Convert a continuous SISO transfer function G(s) to discrete G(z) with zoh, foh, tustin, or euler methods; returns z-polynomials, difference equation, pole map, and a Jury stability verdict.

Instructions

Convert a continuous SISO transfer function G(s) (numerator/denominator coefficient lists in descending powers or text) to discrete G(z) for a sample_time: method zoh (zero-order hold), foh (first-order hold), tustin (bilinear; optional prewarp_frequency in rad/s), forward_euler, backward_euler or matched (pole-zero). Returns the z-domain polynomials (monic denominator), the exact formula used, the difference equation, a pole map (each s-pole to its z-pole with |z| and stable/unstable), an exact Jury stability verdict, DC gain comparison and the frequency-response error. The transfer function must be proper.

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": {
      "numerator": "<numerator>",
      "denominator": "<denominator>",
      "sample_time": "<sample_time>"
    },
    "name": "control_discretize"
  }
}

Input Schema

NameRequiredDescriptionDefault
methodNo'zoh' (default), 'foh', 'tustin', 'forward_euler', 'backward_euler' or 'matched'zoh
numeratorYesNumerator polynomial: JSON list of coefficients in DESCENDING powers, e.g. '[1, 3]' for s+3, or text such as 's + 3'.
denominatorYesDenominator polynomial, same formats, e.g. '[1, 3, 2]' or 's^2 + 3 s + 2'. The leading coefficient must not be 0. Order at most 40, coefficients 1e-12..1e12 in magnitude.
sample_timeYesSample time with unit, e.g. '0.1 s' (1e-9 s .. 1e9 s)
prewarp_frequencyNoTustin only: prewarp frequency in rad/s (0 = none); must be below pi/T

Output Schema

NameRequiredDescriptionDefault
okYes
dataNoNon-quantity payload (reports, listings)
errorNo
valueNoPrimary quantity result
valuesNoAll named quantity results (includes the primary)
warningsNo
artifactsNo
provenanceYesWhat produced the result and from which inputs.
review_statusNounreviewed

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral burden, and it does disclose meaningful traits: default method zoh, Tustin/bilinear equivalence, matched as pole-zero, prewarp in rad/s, and the properness requirement. It is silent on failure behavior for improper or out-of-range inputs and on any computational limits beyond what the schema states.

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

Conciseness5/5

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

One dense but front-loaded block: purpose and inputs first, method taxonomy second, outputs last. Every clause carries technical content, and there is no filler or repetition.

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

Completeness4/5

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

For a five-parameter numerical transform tool with a full output schema, the description covers inputs, method semantics, constraints, and the character of the results (pole map, Jury verdict, DC gain, frequency-response error). The remaining gap is guidance on choosing this tool or method versus sibling discretization tools.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description genuinely adds meaning the schema does not: it spells out what each method value means (zero-order hold, first-order hold, bilinear, pole-zero) and constrains prewarp to Tustin in rad/s. That interpretive layer is exactly the value the description should provide on top of the enum-less method string.

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?

States a concrete verb and resource: convert a continuous SISO transfer function G(s) into a discrete G(z). It then enumerates the exact method set (zoh, foh, tustin, forward_euler, backward_euler, matched), which makes the tool's scope unmistakable against neighbors like digital_synthesize or digital_equivalent.

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

Usage Guidelines3/5

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

It gives one real precondition ("The transfer function must be proper") and notes prewarp is Tustin-only, which is useful gating. However, it never says when to pick this tool over alternatives or when each method is appropriate, so selection guidance is only implied by familiar method names.

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

Deploy Server

Other Tools