Skip to main content
Glama

run_data_transform

Read-only

Execute a data.transform.js script server-side and return its output along with any console.log/warn/error messages. Use this to test and debug your data transform code before committing it with update_file. The code must use the same export default function dataTransform({ files, mediaSources }) { ... } signature. The output is a SHAPE CHECK, not the data: anything larger than a few thousand characters comes back summarised — arrays as a length plus the first few items, objects cut at 20 keys and 3 levels deep, long strings cut — with a "note" saying so. Console output is capped the same way. Use it to confirm the structure and spot errors, not to read a catalogue.

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": {
      "documentId": "<documentId>",
      "code": "<code>",
      "llm_model": "<llm_model>"
    },
    "name": "run_data_transform"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesThe complete data.transform.js code to execute. Must export a default function.
llm_modelYesThe exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. "claude-opus-4-8", "gpt-5.2"). Used for analytics only. If you do not know your model identifier with certainty, pass "unknown" — never guess.
documentIdYesThe catalogue's id. Call list_documents first if you do not have one.
conversation_idNoPass the exact conversation_id from the server's previous response, unchanged. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it. Keep passing the same conversation_id for the rest of the conversation, including after later user messages or on a different task; do not reset it when the user starts a new request.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations, the description explains that execution is server-side, that output is a summarized shape check rather than the full data, and that console output is capped. These are important behavioral traits that materially affect how an agent interprets results.

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?

The description is front-loaded with the core purpose and follows with exactly the operational details an agent needs. Despite covering several constraints, every sentence carries useful information and there is no filler.

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?

Given that there is no output schema and the tool executes arbitrary transform code, the description is complete enough: it explains the expected code signature, the summarized return format, console capping, and how the tool fits before `update_file`.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the schema carries most parameter documentation. The description still adds useful meaning for `code` by specifying the required `export default function dataTransform({ files, mediaSources })` signature, though it does not add anything for the other parameters.

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 states a specific verb and resource: execute a `data.transform.js` script server-side and return its output plus console messages. It also clearly frames the tool as a test/debug step before `update_file`, distinguishing it from the commit-oriented sibling.

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

Usage Guidelines5/5

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

It says exactly when to use the tool, namely to test and debug transform code before committing with `update_file`, and when not to use it, namely to read a catalogue. The alternative and the condition that selects it are explicit.

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.

Resources