← All tools

Data + Frame Tools

Pure, deterministic JSON manipulation and columnar data operations. No AI premium, no LLM, no external calls. Filter, sort, group, pivot, join, merge, flatten, deduplicate — all in-process.

Why this matters

Most agent frameworks send every data operation through the LLM — burning tokens to sort a list or filter an array. Data and Frame tools give your agent reliable, instant operations that never hallucinate — just the base gateway credit. They work on results from any integration: pull invoices from QuickBooks, filter them with data.filter, group them with frame.group — all without the data ever leaving the server or re-entering the LLM context.

Result chaining with cache_ref

Every tool response includes a cache_ref in its _meta.datagrout metadata. Pass that reference to subsequent tools via the cache_ref parameter instead of re-sending the full payload. Your agent can filter, sort, group, and chart a dataset through a multi-step pipeline while the data stays server-side. The LLM only sees the final result you choose to return.

Cached results are encrypted at rest with AES-256-GCM, scoped to your user, and expire after 10 minutes of inactivity (touch-on-access — each read resets the clock). Identical requests from the same user reuse existing references automatically.

Data Tools — any JSON structure

  • data.get — Access values at any path in nested structures
  • data.pick / data.omit — Keep or remove keys from maps
  • data.filter — Declarative predicates: eq, gt, contains, in, is_null, and more
  • data.sort — Sort by value or by multi-field specs with asc/desc
  • data.merge — Shallow or deep merge of two maps
  • data.flatten — Nested maps to dot-path keys
  • data.unique — Deduplicate by value or field
  • data.take / data.drop — Slice arrays by offset and count
  • data.keys / data.count — Inspect structure without reading everything
  • data.aggregate — Reduce a list to a single value: sum, mean, min, max, median, mode, product, count, join, and more
  • data.mapFan-out: call any MCP tool once per item in a list, with parallel execution, error handling, and cache_ref chaining

Frame Tools — columnar record operations

  • frame.select — Keep, rename, or drop columns
  • frame.filter — Row-level filtering with 12 operators
  • frame.sort — Multi-field sort with per-field direction
  • frame.group — Group-by with sum, mean, count, count_distinct, min, max, first, last, list
  • frame.pivot — Reshape long data to wide format
  • frame.join — Inner, left, right, outer joins on shared keys
  • frame.slice — Paginate or top-N

Example: group and aggregate

{
  "name": "data-grout@1/frame.group@1",
  "arguments": {
    "cache_ref": "rc_invoices_abc123",
    "by": "customer",
    "agg": [
      { "field": "amount", "op": "sum", "as": "total" },
      { "field": "id", "op": "count", "as": "invoices" }
    ]
  }
}

Operates directly on a cached result from a prior tool call — the data stays server-side and never re-enters the LLM context window.

Composes with

Pipe Data/Frame output into Prism for refraction or charting, chain with Flow for multi-step workflows, or feed results to Discovery to find the next tool to call. All tools accept cache_ref, so you can build entire data pipelines without bloating the agent's context.