Skip to main content
Glama

Aman-Amith-Shastry-scientific_computation_mcp

qr_decompose

Read-onlyIdempotent
    Computes the QR decomposition of a stored matrix.

    Decomposes the matrix A into A = Q @ R, where Q is an orthogonal matrix
    and R is an upper triangular matrix.

    Args:
        name (str): The name of the matrix to decompose.

    Returns:
        dict: A dictionary with keys:
            - 'q': the orthogonal matrix Q, as nested lists
            - 'r': the upper triangular matrix R, as nested lists

    Raises:
        ValueError: If the matrix is not found or decomposition fails.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the stored matrix to decompose.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / name / description
      Added value: +"Name of the stored matrix to decompose."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "qr_decomposeDictOutput",
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds behavioral context by specifying the return format (keys 'q' and 'r' as nested lists) and raising ValueError for missing matrices or decomposition failure, which goes beyond the annotations.

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 well-structured with a clear summary, mathematical definition, args section, returns section, and raises section. Every sentence earns its place, and the core purpose is front-loaded. It is appropriately sized for a tool with one parameter and a defined output.

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?

The description is complete for a single-parameter read-only tool: it explains the operation, the return structure, and error conditions. The output schema exists, so return values are already structured. It could mention prerequisites (e.g., matrix must be square) but the ValueError for decomposition failure covers the failure mode adequately.

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%, so the schema already documents the 'name' parameter as 'Name of the stored matrix to decompose.' The description repeats this information without adding new semantic detail, such as expected matrix format or constraints. Baseline 3 is appropriate since the schema carries the parameter documentation burden.

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 tool computes the QR decomposition of a stored matrix, specifies the mathematical relationship A = Q @ R, and defines Q as orthogonal and R as upper triangular. This distinguishes it from siblings like svd_decompose, determinant, and matrix_inverse, which perform different matrix operations.

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 implies usage context: it operates on a stored matrix identified by name, and the mathematical definition makes clear it is for QR factorization. It does not explicitly state when to prefer this over svd_decompose or other decompositions, but the mathematical clarity and sibling context provide adequate guidance.

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.