Skip to main content
Glama

Aman-Amith-Shastry-scientific_computation_mcp

create_tensor

Idempotent
Creates a NumPy array (matrix) with a specified shape and values.

Args:
    shape (list[int]): The shape of the resulting array as a tuple(e.g., (2, 3)).
    values (list[float]): A flat list of values to populate the array.
    name (str): The name of the tensor to be stored.

Returns:
    Tensor: The stored tensor as nested lists.

Raises:
    ValueError: If the number of values does not match the product of the shape.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName to store the tensor under; other tools take this name as their argument.
shapeYesTensor shape as a list of dimension sizes, e.g. [2, 3] for a 2x3 matrix.
valuesYesFlat, row-major list of values; its length must equal the product of shape.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / name / description
      Added value: +"Name to store the tensor under; other tools take this name as their argument."
    • changedInput schema / properties / shape / description
      Previous value: -"Tensor shape as list of integers"New value: +"Tensor shape as a list of dimension sizes, e.g. [2, 3] for a 2x3 matrix."
    • changedInput schema / properties / values / description
      Previous value: -"Flat list of floats to fill the tensor"New value: +"Flat, row-major list of values; its length must equal the product of shape."
    • 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": "create_tensorOutput",
      +  "type": "object"
      +}
  2. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and idempotentHint=true. The description adds the ValueError condition for mismatched values and specifies the return format as nested lists, which are useful behavioral details beyond annotations. No contradiction exists.

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 description is well-structured with Args, Returns, and Raises sections, and is front-loaded with the core purpose. It avoids excessive detail while including important error handling information.

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?

The tool is simple and the description covers purpose and error conditions. However, it does not specify behavior when a tensor with the same name already exists (overwrite vs. error), which could be relevant for an agent. Given the output schema and annotations, this is a minor but notable gap.

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 coverage is 100% with descriptive text for each parameter. The description's Args section merely repeats parameter names without adding new semantics. It even inaccurately describes shape as a 'tuple' while the schema expects a list, which could cause minor confusion.

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 creates a NumPy array with specified shape and values, and stores it under a given name. This is specific and distinct from sibling operations like add_matrices or view_tensor, which operate on existing tensors.

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 for creating tensors to be referenced by other tools via the name parameter, as reinforced by the schema description for name. It doesn't explicitly list alternatives or exclusions, but the context is clear given the tool's purpose.

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.