Skip to main content
Glama

Matrix Inverse

matrix_inverse
Read-onlyIdempotent

Compute the inverse of a square matrix provided as a 2D list. Requires a non-singular matrix.

Instructions

Calculate the inverse of a square matrix.

Note: Requires NumPy. Raises ValueError if NumPy is unavailable.

Examples: matrix_inverse([[1, 2], [3, 4]]) matrix_inverse([[2, 0], [0, 2]]) # Diagonal matrix

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
matrixYes2D list of numbers representing a square matrix. Each inner list is a row. Example: [[1, 2], [3, 4]]

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeYes
errorNo
topicYes
successYes
difficultyYes
result_matrixNo
Behavior3/5

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

Annotations already indicate readOnlyHint=true and idempotentHint=true, establishing safety. The description adds a specific error condition (ValueError if NumPy unavailable) which is useful. However, it does not disclose behavior for singular (non-invertible) matrices or other edge cases, which is a notable gap beyond what annotations cover.

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?

The description is succinct with three labeled sections: purpose, note, and examples. Every sentence contributes value. There is no redundancy or filler. The structure aids quick parsing, fitting within a few lines.

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?

With a single parameter and existing output schema, the description is largely complete. It covers the core operation, a dependency note, and examples. Minor omission: no mention of what happens for singular matrices or the output format (though output schema likely handles that). Overall, it meets the needs for this straightforward tool.

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?

The input schema has 100% description coverage, so the baseline is 3. The description's examples mirror the schema's example, adding no new semantic information. No additional detail about matrix constraints (e.g., size, value ranges) is provided. The description adds marginal value over the schema.

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 explicitly states 'Calculate the inverse of a square matrix,' which is a specific verb+resource combination. It clearly distinguishes from sibling tools like matrix_determinant and matrix_multiply by specifying 'inverse' and 'square matrix'. Examples further clarify the intended input format.

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 is provided on when to use this tool versus alternatives such as matrix_determinant or matrix_multiply. The description lacks information about prerequisites (e.g., matrix must be invertible) or when to choose another matrix operation. Examples show typical usage but do not help the agent decide contextually.

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/clouatre-labs/math-mcp-learning-server'

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