Skip to content

Instantly share code, notes, and snippets.

@DavideTodorov
Created May 9, 2025 07:23
Show Gist options
  • Save DavideTodorov/db893524ab2f31cd5c28380297447f89 to your computer and use it in GitHub Desktop.
Save DavideTodorov/db893524ab2f31cd5c28380297447f89 to your computer and use it in GitHub Desktop.
@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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment