Skip to main content
Glama

Matrix Multiplication

matrix_multiply
Read-onlyIdempotent

Multiply two matrices (A × B).

Input Schema

NameRequiredDescriptionDefault
matrix_aYes2D list of numbers representing the first matrix. Each inner list is a row. Example: [[1, 2], [3, 4]]
matrix_bYes2D list of numbers representing the second matrix. Each inner list is a row. Example: [[5, 6], [7, 8]]

Output Schema

NameRequiredDescriptionDefault
topicYes
cols_aYes
cols_bYes
rows_aYes
rows_bYes
difficultyYes
result_matrixYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / matrix_a / description
      Added value: +"2D list of numbers representing the first matrix. Each inner list is a row. Example: [[1, 2], [3, 4]]"
    • addedInput schema / properties / matrix_b / description
      Added value: +"2D list of numbers representing the second matrix. Each inner list is a row. Example: [[5, 6], [7, 8]]"
  2. Changed4 schema fields changed
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / description
      Added value: +"Result of matrix multiplication operation."
    • addedOutput schema / properties
      Added value: +{
      +  "cols_a": {
      +    "type": "integer"
      +  },
      +  "cols_b": {
      +    "type": "integer"
      +  },
      +  "difficulty": {
      +    "type": "string"
      +  },
      +  "result_matrix": {
      +    "items": {
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    },
      +    "type": "array"
      +  },
      +  "rows_a": {
      +    "type": "integer"
      +  },
      +  "rows_b": {
      +    "type": "integer"
      +  },
      +  "topic": {
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "rows_a",
      +  "cols_a",
      +  "rows_b",
      +  "cols_b",
      +  "result_matrix",
      +  "difficulty",
      +  "topic"
      +]
  3. Changed3 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / matrix_a / title
      Removed value: -"Matrix A"
    • removedInput schema / properties / matrix_b / title
      Removed value: -"Matrix B"
  4. Changed2 schema fields changed
    • addedInput schema / properties / matrix_a / maxItems
      Added value: +10000
    • addedInput schema / properties / matrix_b / maxItems
      Added value: +10000
  5. First observed

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare readOnlyHint and idempotentHint, so the safety profile is covered. Beyond that the description adds nothing: no dimension-compatibility requirement, no behavior for invalid shapes, no note on size limits (maxItems 10000) or computational cost. The '(A × B)' ordering is the only added detail.

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?

A single front-loaded sentence with zero wasted words. It is grammatically complete, though its terseness borders on under-specification for a tool with real constraints (shape compatibility, size caps).

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?

An output schema exists so return values need no explanation, and the operation is simple. Still, the description omits the dimension-compatibility rule that determines whether a call succeeds, which is material for a matrix-multiply 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?

Schema description coverage is 100% with both parameters documented and exemplified, so the schema carries the load and a 3 is the baseline. The description contributes no extra meaning about matrix_a or matrix_b beyond what the schema already says.

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 and resource ('Multiply two matrices'), which cleanly separates it from matrix_determinant, matrix_inverse, matrix_transpose, and matrix_eigenvalues. However, it never names or references those siblings, so differentiation is implied rather than stated.

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, no prerequisites, no mention of alternatives such as matrix_inverse for solving systems. The only hint is the '(A × B)' notation, which does not tell an agent when this tool is the right pick.

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.