Skip to main content
Glama

Matrix Inverse

matrix_inverse
Read-onlyIdempotent

Calculate the inverse of a square matrix.

Input Schema

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

Output Schema

NameRequiredDescriptionDefault
sizeYes
errorNo
topicYes
successYes
difficultyYes
result_matrixNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / matrix / description
      Added value: +"2D list of numbers representing a square matrix. Each inner list is a row. Example: [[1, 2], [3, 4]]"
  2. Changed4 schema fields changed
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / description
      Added value: +"Result of matrix inverse calculation."
    • addedOutput schema / properties
      Added value: +{
      +  "difficulty": {
      +    "type": "string"
      +  },
      +  "error": {
      +    "anyOf": [
      +      {
      +        "type": "string"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ],
      +    "default": null
      +  },
      +  "result_matrix": {
      +    "anyOf": [
      +      {
      +        "items": {
      +          "items": {
      +            "type": "number"
      +          },
      +          "type": "array"
      +        },
      +        "type": "array"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ],
      +    "default": null
      +  },
      +  "size": {
      +    "type": "integer"
      +  },
      +  "success": {
      +    "type": "boolean"
      +  },
      +  "topic": {
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "size",
      +  "success",
      +  "difficulty",
      +  "topic"
      +]
  3. Changed2 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / matrix / title
      Removed value: -"Matrix"
  4. Changed1 schema field changed
    • addedInput schema / properties / matrix / maxItems
      Added value: +10000
  5. First observed

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint and idempotentHint, so safety is covered. The description adds the 'square matrix' precondition, but omits critical behavior: what happens for singular/non-invertible matrices, and numerical precision expectations. Adds some value but leaves the main edge case undocumented.

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 short sentence with the key constraint ('square') and purpose front-loaded. No filler, nothing to trim.

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

Completeness3/5

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

A simple tool with an output schema (so return-value explanation is unnecessary) and full annotation coverage. Still, for a matrix operation the most important behavior — failure on non-invertible input — is absent, which an agent would need to avoid erroring on user data.

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?

Schema description coverage is 100% and the single 'matrix' parameter is fully documented in the schema including row orientation and an example. The description's only addition is the 'square' constraint, so it matches the baseline for schema-covered parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('calculate') and resource ('inverse of a square matrix'), which is enough to separate it from siblings like matrix_determinant or matrix_transpose. However, it never names those alternatives, so the differentiation comes from the name rather than the description.

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 when-to-use guidance and no mention of alternatives such as matrix_determinant (to test invertibility) or matrix_multiply. An agent must infer the use case entirely from the tool name.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.