Skip to main content
Glama

lqr_controller_design

Design an optimal Linear Quadratic Regulator (LQR) controller by computing state-feedback gain that minimizes a quadratic cost function, for given system and weighting matrices.

Instructions

Design Linear Quadratic Regulator (LQR) optimal controller.

Computes optimal state-feedback gain K that minimizes the cost function: J = integral(x'Qx + u'Ru) dt

Args: A_matrix: State matrix (n x n) - system dynamics B_matrix: Input matrix (n x m) - control influence Q_matrix: State weighting matrix (n x n) - penalizes state deviation R_matrix: Input weighting matrix (m x m) - penalizes control effort state_names: Optional names for states (for display) input_names: Optional names for control inputs (for display)

Returns: Formatted string with optimal gain matrix K, closed-loop eigenvalues, stability analysis, and controllability assessment.

Raises: No exceptions are raised directly; errors are returned as formatted strings or JSON error objects (e.g., when system is not controllable).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
A_matrixYes
B_matrixYes
Q_matrixYes
R_matrixYes
state_namesNo
input_namesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Discloses return values (gain matrix, eigenvalues, stability, controllability) and error handling (returns formatted strings or JSON errors). No annotations, so description bears full burden; it covers key behaviors without missing critical info.

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?

Well-structured with intro, cost function, Args, Returns, Raises sections. Slightly verbose but all sentences earn their place. Could be more concise.

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?

Given LQR complexity and no annotations, the description covers purpose, parameters, return, errors, and even controllability assessment. Output schema exists but description already explains return well. Complete for agent selection.

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

Parameters5/5

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

Schema description coverage is 0%, but the description provides thorough explanations: matrix dimensions, roles (system dynamics, control influence, weighting), and optional use of state/input names. Adds meaning beyond schema types.

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 description clearly states 'Design Linear Quadratic Regulator (LQR) optimal controller' with a specific verb and resource. It explains the cost function and output, distinguishing it from sibling aerospace tools.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives or prerequisites like system controllability. The description assumes user knowledge without context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cheesejaguar/aerospace-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server