sync_connection
Trigger data synchronization for a Fivetran connection using its ID to update datasets and maintain current information.
Instructions
Tool for syncing a fivetran connection by ID.
Parameters:
id (str): id of the connection
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>"
},
"name": "sync_connection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/mcp_fivetran/main.py:94-113 (handler)The handler function for the 'sync_connection' tool. It is decorated with @mcp.tool() for registration in FastMCP. The function unpauses the specified Fivetran connector and triggers a forced sync on the connection, returning the JSON response from the API.
@mcp.tool() def sync_connection(id: str) -> str: """ Tool for syncing a fivetran connection by ID. Parameters: id (str): id of the connection """ url = f"https://api.fivetran.com/v1/connectors/{id}" data = { 'paused': False } requests.request("PATCH", url, json=data, headers=headers) url = f"https://api.fivetran.com/v1/connections/{id}/sync" payload = {"force": True} response = requests.request("POST", url, json=payload, headers=headers) return response.json()