Skip to main content
Glama

Aman-Amith-Shastry-scientific_computation_mcp

scale_matrix

    Scales a stored tensor by a scalar factor.

    Args:
        name (str): The name of the tensor to scale.
        scale_factor (float): The scalar value to multiply the tensor by.
        in_place (bool): If True, updates the stored tensor; otherwise, returns a new scaled tensor.

    Returns:
        Tensor: The scaled tensor.

    Raises:
        ValueError: If the tensor name is not found in the store.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the stored tensor to scale.
in_placeNoOverwrite the stored tensor with the scaled result. False returns the result and leaves the store untouched.
scale_factorYesScalar value to multiply every element by.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / in_place / description
      Added value: +"Overwrite the stored tensor with the scaled result. False returns the result and leaves the store untouched."
    • addedInput schema / properties / name / description
      Added value: +"Name of the stored tensor to scale."
    • addedInput schema / properties / scale_factor / description
      Added value: +"Scalar value to multiply every element by."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "result": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "items": {
      +            "type": "number"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "items": {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "items": {
      +            "items": {
      +              "items": {
      +                "type": "number"
      +              },
      +              "type": "array"
      +            },
      +            "type": "array"
      +          },
      +          "type": "array"
      +        }
      +      ],
      +      "title": "Result"
      +    }
      +  },
      +  "required": [
      +    "result"
      +  ],
      +  "title": "scale_matrixOutput",
      +  "type": "object"
      +}
  2. First observed

TDQS

A4/5.0
Behavior4/5

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

Beyond the annotations, the description discloses important behavior: the default in_place=True mutates the stored tensor, in_place=False returns a new tensor and leaves storage untouched, and a missing name raises ValueError. No contradiction with the annotations is present.

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?

The purpose sentence is front-loaded and the docstring is compact and well organized. The Args/Returns/Raises sections are mostly redundant with the schema, but the description still remains appropriately sized.

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

Completeness5/5

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

For a three-parameter tool with full schema coverage, an output schema, and annotations, the description covers the core operation, mutation versus non-mutation behavior, and the error case. Nothing necessary for correct invocation is missing.

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 baseline is 3. The Args section essentially restates the schema's parameter descriptions without adding meaningful new details about formats, edge cases, or usage constraints.

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 opens with 'Scales a stored tensor by a scalar factor,' which names a specific verb, the resource, and the exact operation. This clearly distinguishes it from sibling tools like add_matrices or multiply_matrices.

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?

The description implies when to use this tool: to scale a stored tensor by a scalar, with the in_place flag deciding mutation versus returning a new tensor. However, it does not explicitly mention alternatives or state when another sibling tool should be used instead.

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.