> ## Documentation Index
> Fetch the complete documentation index at: https://docs.genesiscomputing.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fivetran Connector Tools

> Monitor Fivetran ingestion pipelines, diagnose failures, and apply guarded remediation from Genesis Data Agents.

## Overview

The `fivetran_tools` group exposes one `fivetran_connector` action tool for
Fivetran inventory, health monitoring, sync diagnostics, schema management, and
approved remediation. Configure a saved Fivetran connection before using it;
see [Fivetran connections](/docs/Setup/Connections#fivetran-connections).

Genesis resolves the saved Fivetran connection from `connection` when supplied,
such as `fivetran.production`, or from the effective default when it is omitted.
The tool also honors the connection’s `allowed_group_ids` mutation boundary.

## Action Reference

Pass the action name in uppercase or lowercase. The tool returns `success` plus
an action-specific payload.

| Action | Purpose | Required inputs |
| - | - | - |
| `TEST_CONNECTION` | Verify the saved credentials by listing visible groups. | None |
| `LIST_GROUPS` | List Fivetran groups. | None |
| `LIST_DESTINATIONS` | List visible destinations. | None |
| `GET_DESTINATION` | Get one destination. | `group_id` |
| `UPDATE_DESTINATION` | Patch named warehouse credential/config keys on a destination shared by the group. | `group_id`, `config`, `confirm=True` |
| `LIST_CONNECTIONS` | List and health-triage visible pipelines. | Optional `group_id` |
| `LIST_FAILING` | Return only pipelines whose setup is not connected. | Optional `group_id` |
| `GET_CONNECTION` | Return one pipeline’s provider detail. | `connection_id` |
| `DIAGNOSE` | Return health and a `recommended_action`. | `connection_id` |
| `GET_SYNC_HISTORY` | Return recent runs and failures. | `connection_id` |
| `GET_SCHEMAS` | Read schemas and table configuration. | `connection_id` |
| `RELOAD_SCHEMAS` | Ask Fivetran to re-read source schema. | `connection_id` |
| `SET_TABLE_ENABLED` | Enable or disable one table. | `connection_id`, `schema`, `table` |
| `TRIGGER_SYNC` | Start an incremental sync. | `connection_id` |
| `TRIGGER_RESYNC` | Start a historical re-sync. | `connection_id`; `confirm` for an unscoped re-sync |
| `RUN_SETUP_TESTS` | Re-run setup tests to verify credentials and connectivity. | `connection_id` |
| `UPDATE_CONFIG` | Patch only the named connection config keys. | `connection_id`, `config` |
| `PAUSE` / `UNPAUSE` | Pause or resume a pipeline. | `connection_id` |
| `CREATE_CONNECT_CARD` | Create a short-lived URL for human source re-authorization. | `connection_id` |
| `LIST_SOURCE_TYPES` | List available Fivetran source types. | None |
| `CREATE_CONNECTION` | Create a paused Fivetran pipeline. | `group_id`, `service`, `config` |
| `DELETE_CONNECTION` | Permanently delete a pipeline. | `connection_id`, `confirm=True` |

Use `HELP` or `RTFM` to return the supported actions, mutating actions, and
safety notes.

## Parameters

All parameters below are optional unless marked required. Genesis injects
`bot_id`, `thread_id`, and `user_id` from the active agent context.

| Parameter | Type | Default | Use |
| - | - | - | - |
| `action` | `string` | — | Action to perform; required. |
| `connection` | `string \| null` | `null` | Saved connection name, such as `fivetran.production`; uses the effective default when omitted. |
| `connection_id` | `string \| null` | `null` | Fivetran pipeline ID for connection-scoped actions. |
| `group_id` | `string \| null` | `null` | Group/destination ID for destination and creation actions. |
| `schema` | `string \| null` | `null` | Schema for `SET_TABLE_ENABLED`. |
| `table` | `string \| null` | `null` | Table for `SET_TABLE_ENABLED`. |
| `config` | `object \| null` | `null` | Keys to write for `UPDATE_CONFIG` or `UPDATE_DESTINATION`, or create for `CREATE_CONNECTION`. |
| `service` | `string \| null` | `null` | Fivetran source type for `CREATE_CONNECTION`. |
| `hours` | `integer` | `24` | Sync-history window in hours; Fivetran retains at most 168 hours. |
| `limit` | `integer` | `100` | Maximum sync-history records to return, capped at 1,000 per page. |
| `force` | `boolean` | `false` | For `TRIGGER_SYNC`, interrupt a sync already in progress. |
| `enabled` | `boolean` | `true` | Desired state for `SET_TABLE_ENABLED`. |
| `scope` | `object \| null` | `null` | Schema-to-table mapping for a bounded `TRIGGER_RESYNC`. |
| `confirm` | `boolean` | `false` | Required for destination credential changes, irreversible deletion, and an unscoped full historical re-sync. |

## Monitoring and Safety

`LIST_FAILING` is the polling primitive. Read both `examined` and
`inventory_empty`: zero failures means the visible estate is healthy only when
`examined` is greater than zero. A scoped credential or nonexistent group can
return an empty inventory without an API error.

Health is based on Fivetran’s `setup_state`. A connected setup is healthy even
when it has advisory warnings; a broken setup with an authentication-related
task or warning is marked `needs_reauthorization`. `DIAGNOSE` recommends
`CREATE_CONNECT_CARD` for that case and `ESCALATE` for other failures.

`GET_SYNC_HISTORY` accepts a maximum seven-day window because Fivetran does not
serve older history. For longer trends, query the Fivetran Platform connector’s
`fivetran_metadata` tables in the destination warehouse.

Mutating actions are checked against `allowed_group_ids` before they run.
`TRIGGER_RESYNC` without `scope` can re-ingest every table from history and
requires `confirm=True`; prefer a schema-to-table scope. `DELETE_CONNECTION` is
irreversible and also requires `confirm=True`. `UPDATE_DESTINATION` changes the
warehouse credentials/configuration shared by every pipeline in the group, so
it requires `confirm=True` and a wrong value can stop all of those pipelines.

`UPDATE_CONFIG` sends only the supplied keys. Fivetran omits secrets from
read-back responses, so confirm a credential change with `RUN_SETUP_TESTS`.
`UPDATE_DESTINATION` uses the same partial-update behavior for warehouse
credentials and runs Fivetran setup tests in the same call. A destination update
is verified only when setup tests are returned and all returned tests pass; an
empty setup-test result is reported as unverified, not successful.
When a source requires human authorization, `CREATE_CONNECT_CARD` returns the
short-lived URL to give to that person; an agent cannot complete the source’s
OAuth consent step on their behalf.

## Example

```text theme={null}
fivetran_connector(
  action="LIST_FAILING",
  connection="fivetran.production"
)
```

For a bounded repair flow, diagnose the pipeline, inspect recent failures, update
only the required config keys, and run setup tests:

```text theme={null}
fivetran_connector(
  action="UPDATE_CONFIG",
  connection="fivetran.production",
  connection_id="retain_ceremonies",
  config={"api_key": "new-value"}
)
```

```text theme={null}
fivetran_connector(
  action="RUN_SETUP_TESTS",
  connection="fivetran.production",
  connection_id="retain_ceremonies"
)
```

To repair warehouse credentials shared by every pipeline in a group, provide
only the destination keys that must change and obtain human approval first:

```text theme={null}
fivetran_connector(
  action="UPDATE_DESTINATION",
  connection="fivetran.production",
  group_id="group_123",
  config={"password": "new-value"},
  confirm=True
)
```

Do not pass a full config object read from Fivetran back to `UPDATE_CONFIG`:
secret fields are omitted by the provider and a round trip can blank them.
