Skip to main content
Glama
sdiehl
by sdiehl

matrix_inverse

Compute the inverse of a matrix using SymPy's inv method. Input a matrix key to receive the key for its inverted form, enabling efficient symbolic algebra operations.

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

TableJSON Schema
NameRequiredDescriptionDefault
matrix_keyYes
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the computational method (SymPy's inv) and the return format (a key for the inverted matrix), which is helpful. However, it doesn't mention potential limitations like non-invertible matrices, numerical stability, or performance characteristics that would be valuable for an agent.

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 perfectly structured with purpose statement, parameter documentation, example, and return explanation - all in minimal space. Every sentence earns its place, and the information is front-loaded with the core functionality stated first.

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 single-parameter mathematical operation tool with no annotations or output schema, the description provides good coverage of what the tool does, how to use it, and what it returns. The example is particularly helpful. It could be more complete by mentioning mathematical constraints (e.g., square matrices only, determinant non-zero), but overall it's quite adequate.

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?

The schema description coverage is 0%, so the description must compensate. It provides a clear explanation of the single parameter ('matrix_key: The key of the matrix to invert') and shows its usage in the example. This adds substantial meaning beyond the bare schema, though it doesn't detail what constitutes a valid matrix_key format.

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 the specific action ('Calculates the inverse of a matrix') and the method used ('using SymPy's inv method'), which distinguishes it from sibling tools like matrix_determinant or matrix_eigenvalues. It provides a precise verb+resource combination that leaves no ambiguity about the tool's function.

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

Usage Guidelines4/5

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

The description includes an example showing prerequisite usage (create_matrix first) and the expected workflow, providing clear context for when to use this tool. However, it doesn't explicitly state when NOT to use it or mention alternatives like solving linear systems directly, which would elevate it to a 5.

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

Related 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/sdiehl/sympy-mcp'

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