Skip to main content

Overview

A binding (binding.yaml) maps a contract’s abstract tables to concrete data sources. It tells the resolver how to fetch each table: which backend, which MCP tool, what arguments, and how to parse the response. Bindings are optional. Without one, the resolver attempts automatic resolution via the knowledge graph using semantic column tags. With a binding, you get explicit control over data sourcing.

Binding Structure

Source Binding Fields

Each entry under source_bindings maps one contract table to a data source:

Validation rules

  • response_format and response_adapter are mutually exclusive — set one or the other, not both.
  • response_format must be one of: "json", "csv", "ndjson" (or omitted for JSON default). Invalid values like "cvs" are rejected at parse time.

Fetch Modes

The fetch_mode field controls who fetches the data and how: Default: "mcp" (agent-driven staging). api and direct were legacy Go loader-plugin modes and are no longer supported. Use fracta_mcp_gateway with an MCP server binding instead.

Choosing a fetch mode

Use mcp_client when:
  • The MCP tool returns JSON, CSV, or NDJSON
  • You want automatic Parquet staging without agent intervention
  • You need pagination support
Use mcp when:
  • The tool returns complex or unpredictable output
  • The agent needs to inspect/filter results before staging
  • You want maximum flexibility
Use native when:
  • The strategy fetches its own data (e.g., direct API calls from Python)
  • No external staging is needed

Response Formats

When using fetch_mode: mcp_client, the response parsing is controlled by response_format and response_adapter.

Built-in formats (response_format)

Tool-specific adapters (response_adapter)

For tools that return non-standard output, use a named adapter instead of a format. See Response Adapters for the full adapter reference.

Field Mapping

The field_map maps contract column names (left) to source field names (right):
Alternatively, use field_overrides at the top level for semantic-based mapping that works across multiple tables:
field_map takes precedence over field_overrides when both match the same column.

Pagination

For large datasets, configure pagination to fetch data page-by-page. All pages are written to a single Parquet file.

Offset mode

The fetcher increments the offset by page_size each iteration: from=0, from=10000, from=20000, …

Cursor mode

The fetcher extracts the next cursor from each response and passes it to the next page request. Constraint: Cursor mode requires JSON responses. It is incompatible with response_format: csv, response_format: ndjson, and any response_adapter — the cursor lives in a JSON envelope that non-JSON formats don’t have. This is enforced at runtime.

Pagination fields

Pagination limits

  • Total budget: 5 minutes for the entire paginated fetch
  • Per-page timeout: Controlled by timeout (default: 30s)
  • Row cap: Controlled by max_rows (default: 10,000)
  • Termination: Empty page, partial page, maxRows reached, or null cursor

Parameter Interpolation

Both mcp_args and query_template support {{param}} placeholders that are resolved from strategy parameters at runtime. Interpolation is recursive — a param value can itself contain {{other_param}}.

Examples

Elasticsearch with pagination

VendorSecurity with agent-driven staging

CSV response from an MCP tool

Multiple tables with field overrides