Skip to main content
Glama

Matrix diagonal and trace

bpj_matrix_trace
Read-onlyIdempotent

Extract a square matrix’s main diagonal and sum it to obtain the trace.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "matrix": "<matrix>"
    },
    "name": "bpj_matrix_trace"
  }
}

Input Schema

NameRequiredDescriptionDefault
matrixYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so safety is covered. The description contributes the behavioral fact that both the diagonal and the summed trace are produced. However, it says nothing about error handling for non-square or malformed input, and nothing about the shape of the result, which is the main remaining unknown for a no-annotations-gap read 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?

A single compact sentence with no filler, front-loading the extraction and then the summing step. It is appropriately sized for a one-parameter tool. Nothing is wasted, though nothing is elaborated either.

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 simple one-parameter, no-output-schema tool, the description covers what is computed and what is returned (diagonal plus trace). The unresolved square-versus-rectangular discrepancy is the one piece an agent genuinely needs clarified, which keeps it short of a 5.

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?

There is a single parameter with 0% schema description coverage, so the description must carry the burden and only partly does. It adds the requirement that the matrix be square, but this sits in tension with the schema's own title 'Rectangular numeric matrix (JSON)', leaving the agent unsure which shape constraint applies. No detail is given on serialization format beyond the schema's bare '(JSON)' note.

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?

The description names two concrete operations on a specific resource: extracting the main diagonal of a square matrix and summing it to produce the trace. The verb and result are unambiguous. It does not differentiate itself from likely siblings such as bpj_sheet_diagonal_cells or bpj_matrix_direct_sum, which would have pushed this to a 5.

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?

Usage is only implied: the math operation is self-explanatory, so an agent can infer it wants this when it needs a trace. There is no explicit when-to-use, no exclusion of similar tools, and no statement about input requirements or prerequisites. Adequate but with a clear gap.

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.