invite_fivetran_user
Invite users to join a Fivetran account by sending an email invitation. Provide the user's email, first name, last name, and phone number to generate the request and receive a JSON response with status and user details.
Instructions
Tool for inviting users to Fivetran.
This tool sends an invitation to a specified email address to join a Fivetran account.
It requires four parameters and returns the API response as a JSON object.
Parameters:
email (str): Email address of the user to invite. Must be a valid email format.
given_name (str): First name of the user. Cannot be empty.
family_name (str): Last name of the user. Cannot be empty.
phone (str): Phone number of the user. Should include country code (e.g., +1 for US).
Returns:
Dict[Any, Any]: JSON response from the Fivetran API containing status and user information.
Example:
invite_fivetran_user(
email="user@example.com",
given_name="John",
family_name="Doe",
phone="+15551234567"
)
Note:
Requires AUTH_TOKEN environment variable to be set with a valid Fivetran API token.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | |||
| family_name | Yes | ||
| given_name | Yes | ||
| phone | Yes |
Implementation Reference
- src/mcp_fivetran/main.py:116-145 (handler)The @mcp.tool()-decorated handler function implementing the 'invite_fivetran_user' tool. It invokes the helper 'invite_user' to send a POST request to the Fivetran API and returns the JSON response.@mcp.tool() def invite_fivetran_user(email: str, given_name: str, family_name: str, phone: str) -> Dict[Any, Any]: """Tool for inviting users to Fivetran. This tool sends an invitation to a specified email address to join a Fivetran account. It requires four parameters and returns the API response as a JSON object. Parameters: email (str): Email address of the user to invite. Must be a valid email format. given_name (str): First name of the user. Cannot be empty. family_name (str): Last name of the user. Cannot be empty. phone (str): Phone number of the user. Should include country code (e.g., +1 for US). Returns: Dict[Any, Any]: JSON response from the Fivetran API containing status and user information. Example: invite_fivetran_user( email="user@example.com", given_name="John", family_name="Doe", phone="+15551234567" ) Note: Requires AUTH_TOKEN environment variable to be set with a valid Fivetran API token. """ response = invite_user(email, given_name, family_name, phone) return response.json()
- src/mcp_fivetran/main.py:33-66 (helper)Helper function 'invite_user' that performs the core API POST request to invite a user to Fivetran using global headers and payload constructed from parameters.def invite_user(email, given_name, family_name, phone) -> str: """Invites a user to join a Fivetran account. This function sends an invitation to a new user by making a POST request to the Fivetran API. It requires an authentication token stored in the AUTH_TOKEN environment variable. Args: email (str): The email address of the user to invite. given_name (str): The first name (given name) of the user. family_name (str): The last name (family name) of the user. phone (str): The phone number of the user. Returns: requests.Response: The response object from the Fivetran API containing status code, headers, and response body. Note that despite the type hint indicating str, the actual return type is a Response object. Note: The AUTH_TOKEN must be set before calling this function. The function does not handle exceptions that might occur during the API request. """ url = "https://api.fivetran.com/v1/users" payload = { "email": email, "given_name": given_name, "family_name": family_name, "phone": phone, } response = requests.request("POST", url, json=payload, headers=headers) return response
- src/mcp_fivetran/main.py:116-116 (registration)The @mcp.tool() decorator registers the 'invite_fivetran_user' function as an MCP tool.@mcp.tool()
- src/mcp_fivetran/main.py:117-130 (schema)Type hints and docstring define the input schema (email, given_name, family_name, phone as strings) and output as Dict[Any, Any].def invite_fivetran_user(email: str, given_name: str, family_name: str, phone: str) -> Dict[Any, Any]: """Tool for inviting users to Fivetran. This tool sends an invitation to a specified email address to join a Fivetran account. It requires four parameters and returns the API response as a JSON object. Parameters: email (str): Email address of the user to invite. Must be a valid email format. given_name (str): First name of the user. Cannot be empty. family_name (str): Last name of the user. Cannot be empty. phone (str): Phone number of the user. Should include country code (e.g., +1 for US). Returns: Dict[Any, Any]: JSON response from the Fivetran API containing status and user information.