Skip to main content
Glama

recode

Map old values to new values for a chosen variable in a STATISTICA data file, route unlisted values to a default, and keep or replace missing values.

Instructions

Recode the values of one variable using a mapping (old value -> new value), optionally sending every unlisted value to default. Missing values are preserved unless missing is given.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mapYesMapping old value -> new value (keys are compared as strings).
pathYesAbsolute path to the source file.
saveNoOptional destination path to persist the result as .sta.
sheetNo
attachNoAttach to the already-running STATISTICA instance and edit it live (no new process, the app is not closed).
defaultNoValue assigned to every unlisted, non-missing cell.
missingNoReplacement for missing cells (default: leave missing).
variableYesVariable to recode.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.3.0

TDQS

B3.3/5.0
Behavior3/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 disclose the default-for-unlisted-values and missing-value-preservation behaviors. However, these largely restate schema field descriptions, and it omits key behavioral facts like whether the file is modified in place, what save/attach do to state, and whether the operation is reversible.

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?

Two tight sentences, front-loaded with the verb and resource, and the optional default/missing behaviors follow logically. No wasted words.

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?

For an 8-parameter mutation tool with no annotations and no output schema, the description covers the core recoding semantics but leaves the save/attach/sheet behavior and in-place mutation questions unaddressed. It is minimally adequate but incomplete for the tool's complexity.

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 88%, so the schema already documents nearly every parameter. The description reinforces the map/default/missing interplay (keys compared as strings, unlisted vs missing handling) but adds little syntax or format detail beyond the schema baseline.

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?

States a specific verb (recode) and resource (values of one variable) plus the mapping mechanism, so an agent immediately understands the operation. It does not explicitly differentiate itself from nearby siblings like set_formula, value_labels, or set_measurement, which also transform variable values.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the mechanics of recoding but gives no when-to-use guidance, prerequisites, or alternatives. With siblings such as value_labels and set_formula that could be confused for value transformation, the absence of routing guidance is a real gap.

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