TxLoomTxLoom
Home
  • What is TxLoom?
  • How It Works
  • Features
  • Screenshots
  • Demo Videos
  • Installation Guide
  • Configuration
  • Scenario Spec
  • Under the Hood
Home
  • What is TxLoom?
  • How It Works
  • Features
  • Screenshots
  • Demo Videos
  • Installation Guide
  • Configuration
  • Scenario Spec
  • Under the Hood
  • Under the Hood

    • Architecture
    • Technical Stack
    • Generation Engine
    • Sinks & Wire Format
    • Agent Authoring
    • Agent Reference
    • Extending TxLoom

Agent Authoring

TxLoom embeds no language model. Plain-English authoring is done by an AI agent you already use, connected to TxLoom's MCP server.

The agent proposes a spec. The validator checks it and reports located, machine-readable errors. The agent repairs the draft and saves it. The deterministic engine generates the data. No language model ever produces a transaction.

The MCP Endpoint

Addresshttp://localhost:3000/mcp
TransportStreamable HTTP, stateless
AuthenticationNone. See the security note.

The address is shown in the studio under Settings → Agent integration.

Connecting Claude Code

Add a .mcp.json to your project:

{
  "mcpServers": {
    "txloom": {
      "type": "http",
      "url": "http://localhost:3000/mcp"
    }
  }
}

Other MCP clients take the same URL in their own configuration format.

Tools

Every tool maps onto one REST endpoint under /api/v1. There is no agent-only capability.

Learn

ToolEndpointPurpose
get_spec_schemaGET /spec/schemaThe JSON Schema for a spec
get_authoring_docsGET /spec/docsField reference, invariant catalog with remedies, worked examples
list_templatesGET /templatesThe gallery templates
list_connectionsGET /connectionsSaved connections. Secrets are never returned.

Author

ToolEndpointPurpose
validate_specPOST /spec/validateCheck a draft. Always succeeds and returns valid plus located violations. No side effects.
estimate_runPOST /spec/estimateExpected history events, partitions and generation time
create_scenarioPOST /scenariosCreate a blank scenario or clone a template
save_spec_versionPOST /scenarios/:id/versionsValidate and save a spec as the scenario's newest version

Run

ToolEndpointPurpose
launch_runPOST /scenarios/:id/runsLaunch the current version with destinations, a mode, an optional seed and an optional history replay
get_run_statusGET /runs/:idRun record: status, phase, spec snapshot, seed
retry_runPOST /runs/:id/retryRe-queue the partitions of a failed run that did not finish
start_streamPOST /runs/:id/stream/startStart the live stream to the run's destinations
stop_streamPOST /runs/:id/stream/stopStop the live stream

Read results

ToolEndpointPurpose
get_realism_reportGET /runs/:id/reportDistribution summaries and achieved fraud rate
get_truth_eventsGET /runs/:id/truth/eventsLabeled events, filterable by typology, actor and status
create_exportPOST /runs/:id/exportsStart an export build
get_exportGET /runs/:id/exports/:exportIdExport status and file names

A Typical Session

You say:

Create a card-present retail scenario for the US with 3,000 shoppers, a Black Friday spike, and 1% fraud that is mostly card testing. Write Parquet files and run it.

The agent then:

  1. Calls get_authoring_docs and list_templates to learn the spec format
  2. Drafts a spec and calls validate_spec
  3. Fixes any violation using its path, code and remedy, and validates again
  4. Calls create_scenario, then save_spec_version
  5. Calls estimate_run to check the size
  6. Calls launch_run, then polls get_run_status
  7. Calls get_realism_report and summarizes the result for you

The saved version appears in the scenario's version history in the studio, where you can compare it with the previous version or roll it back.

Rules an Agent Must Follow

An agent learns most of these from the tool descriptions. They are also listed under "Running a scenario" in the Agent Reference.

  • Destinations. Every non-file sink needs a destination: a connection of the same type, by ID, from list_connections. Addresses and credentials are never passed inline.
  • Seeds are strings. Pass seed as a decimal string so 64-bit values survive JSON. Leave it out to use the spec's seed. A run is never given a random seed.
  • Mode. history_only, or history_then_live, which is the default when any destination is a broker. The live stream then starts by itself after history.
  • Phase. Every run record has a phase: generating, replaying (only with replay_history: true), live, then done.
  • Exports are asynchronous. create_export returns queued; poll get_export until completed or failed.
  • Labels are excluded by default. include_labels: true requires acknowledged_warning: true.

What an Agent Cannot Do

  • It cannot generate events. Only the engine does.
  • It cannot skip validation. An invalid spec is rejected with 422 and the same violations validate_spec returns.
  • It cannot read connection secrets.

Authoring Docs

The authoring docs are generated from the same package that defines the tools, so they stay in step with the validator. GET /api/v1/spec/docs (and get_authoring_docs) returns them as JSON: the spec schema, field notes, the invariant catalog and worked examples. The Agent Reference on this site is a Markdown rendering of the same content plus a "Running a scenario" section, which the endpoint does not include.

Prev
Sinks & Wire Format
Next
Agent Reference