Skip to main content
Glama
Symbolic Algebra MCP Server

Symbolic Algebra MCP Server

matrix_inverse

Calculates the inverse of a matrix from its stored matrix key and returns a key for the inverted matrix.

Instructions

Calculates the inverse of a matrix using SymPy's inv method.

Args:
    matrix_key: The key of the matrix to invert.

Example:
    # Create a matrix
    matrix_key = create_matrix([[1, 2], [3, 4]])

    # Calculate its inverse
    inv_key = matrix_inverse(matrix_key)

Returns:
    A key for the inverted matrix.

Input Schema

NameRequiredDescriptionDefault
matrix_keyYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It does disclose the backend method (SymPy inv) and what is returned (a key for the inverted matrix), but it says nothing about error behavior for singular matrices or whether the original matrix is mutated. Adequate but with clear gaps for a zero-annotation tool.

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?

The one-line purpose is front-loaded and every section (Args, Example, Returns) is short and scannable. The example is slightly more verbose than strictly needed but demonstrates the key-passing pattern usefully.

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 only one parameter and an output schema present, the description needn't explain return shape further, and the purpose, input origin, and workflow are all covered. The remaining miss is failure semantics for non-invertible input, which an agent would want to know before calling.

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 description coverage is 0%, so the description must compensate, and it largely does: it explains that matrix_key is the key of the matrix to invert and the example shows it originating from create_matrix. The only remaining gap is validation/format detail (e.g., whether a stale or unknown key produces an error).

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 specific verb and resource ('Calculates the inverse of a matrix') plus the underlying method (SymPy's inv). This is unambiguously distinct from siblings like matrix_determinant, matrix_eigenvalues, and create_matrix.

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?

The example implies the prerequisite workflow (create_matrix then matrix_inverse) and the Args note that a matrix key is required, which gives some context for when to call it. However, there is no explicit when-not guidance, and nothing about singular/non-invertible matrices where this tool would fail or be inappropriate.

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