Skip to main content
Glama

prepare_data

Create and register a dataset as a DataRef ID by running generator code with a seed or capturing an external URI, for train, validation, or test splits.

Instructions

Prepare a dataset and return a DataRef ID.

Two regimes:

  • generated: runs the generator (via executor), stores output, computes hash. Requires generator_code_ref, generator_seed. Generator contract: the file must expose generate_data(config, output_path) — config carries 'seed' AND 'generator_seed' (same value — either spelling works) plus generator_params flattened at the top level; a seed/generator_seed key inside generator_params is superseded so the recorded seed always equals the seed delivered. The dataset is written to output_path. A generator may print a single-line {"error": "..."} JSON object to stdout to report a structured failure. The generator runs under the executor's default interpreter ([executor] python) — not a bundle env; only packages installed there are importable.

  • captured: registers an external URI, computes hash if accessible. Requires source_uri.

For stream capture (captured + temporal), provide capture_window_start and capture_window_end.

The DataRef is stored in the state DB and the data is stored in data storage (separate from code storage). Access is read-only.

Returns: {"data_ref_id": "data-ref-...", "split": ..., "regime": ...}

generator_params and capture_source_metadata may be sent as JSON-encoded strings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
splitYesDataset split: train | validation | test.
regimeYesgenerated (run generator via executor; needs generator_code_ref + generator_seed) | captured (register external URI; needs source_uri).
versionNoVersion tag for the captured data source.
source_uriNoExternal data URI — required for regime='captured'.
generator_seedNoGenerator seed — required for regime='generated'.
generator_paramsNoGenerator parameters; object or JSON-encoded.
capture_window_endNoTemporal bound for stream capture (captured + temporal).
generator_code_refNoPath/ref to generator code — required for regime='generated'. The file must expose generate_data(config, output_path) — two positional args; see the tool description for the full contract.
capture_window_startNoTemporal bound for stream capture (captured + temporal).
capture_source_metadataNoExtra provenance about the captured source; object or JSON-encoded.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
splitNo
regimeNo
data_ref_idNo
storage_uriNo
content_hashNo
reproducibility_riskNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.28

TDQS

A4.3/5.0
Behavior5/5

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

With zero annotations, the description carries the full burden and does so well: it discloses the generator contract, the executor default interpreter and package constraints, the stdout structured-failure protocol, the seed-aliasing/supersession rule, that data goes to data storage separate from code storage, and that access is read-only. This is unusually rich behavioral context.

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 action, then structured into two clearly labelled regimes with a separate returns block. The seed explanation is dense and reads as a run-on, but every sentence conveys operational detail rather than 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?

For a 10-parameter, two-mode tool with no annotations, the description covers prerequisites, execution environment, failure reporting, storage behavior, and cross-parameter encoding rules. The return block is slightly redundant given the output schema exists, but nothing an agent needs to invoke it correctly is missing.

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 100%, so the baseline is 3, but the description adds real meaning beyond the schema: the generator_seed/generator_params 'seed' aliasing and supersession behavior, the top-level flattening of generator_params, and the JSON-encoded-string allowance for generator_params and capture_source_metadata. That extra semantics justifies exceeding 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?

The description states a specific verb+resource ('Prepare a dataset and return a DataRef ID') and enumerates the two operating regimes with their required inputs, so the agent knows exactly what the tool produces. It does not, however, explicitly contrast itself with nearby siblings such as capture_bundle or verify_data, leaving that differentiation to inference.

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?

Clear when-to-use guidance is given per regime ('generated' runs the generator, 'captured' registers an external URI) plus the additional condition for stream capture (captured + temporal). There are no explicit exclusions or named alternatives telling the agent when to pick a sibling instead.

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