Skip to main content
Glama

slice_tensor

Select and reduce tensor dimensions to retrieve only needed data, returning a compact table or summary statistics for further analysis.

Instructions

Read part of a tensor. select maps dim -> scalar (exact, or nearest for numeric/datetime axes), list (several values), {"range": [lo, hi]}, {"isin": [...]}, {"nearest": v}, {"iloc": [start, stop]}, {"positions": [...]}, {"every": n}. reduce maps dim -> mean|std|var|sum|min|max|median|count|first|last (NaN-aware). Scalar selections drop the dim. When 1 or 2 dims remain the values are returned as a table (evenly thinned if over max_cells, default 4000); with more dims you get summary stats and should select/reduce further. new_name stores the result (2-D or less becomes a table that describe/project/plot accept; otherwise a tensor).

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": {
      "name": "<name>"
    },
    "name": "slice_tensor"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
reduceNo
selectNo
new_nameNo
max_cellsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that scalar selections drop the dimension, that 1–2 remaining dims produce a table which is evenly thinned past max_cells (default 4000), that higher-dim results return summary stats, and that new_name persists a result with type depending on rank. It does not say whether new_name overwrites an existing tensor or how errors surface, which are the main gaps for a tool with a storage side effect.

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?

Front-loaded with the core purpose, then the two parameter grammars in compact list form; nearly every clause carries information an agent needs. The prose is dense and somewhat run-on with an awkward line break mid-sentence, but there is little outright waste.

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 5-parameter tool with an output schema, the description covers the hard parts: selection grammar, reduction options, thinning behavior, and result persistence. Minor incompleteness remains around the identity of the 'name' input (an existing tensor in the session) and the overwrite semantics of new_name.

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 0%, so the description must compensate — and it substantially does for the two complex parameters, enumerating the full select value grammar (scalar, list, range, isin, nearest, iloc, positions, every) and the reduce aggregations including NaN-awareness. The remaining parameters (name, new_name, max_cells) get only passing mention, so coverage of the 5-parameter surface is partial.

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?

Opens with a specific verb+resource ('Read part of a tensor') and then defines the two selection axes (select, reduce) concretely, so the agent knows exactly what operation this performs. It does not explicitly contrast itself with nearby siblings such as subset or tensor_to_table, so differentiation is only implicit via the 'new_name ... table that describe/project/plot accept' note.

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 guidance is implied through workflow hints: 'with more dims you get summary stats and should select/reduce further' tells the agent to iterate, and the new_name note tells it how to feed results downstream. There is no explicit statement of when to prefer this over subset, transform, or tensor_to_table, and no prerequisites are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.