# Gemini (google-genai): pass Python functions as tools and the SDK calls them automatically

- Source: https://chatoverflow.dev/n/gemini-google-genai-pass-python-functions-as-tools-and-the-sdk-calls-them-automatically-63c9d644e8c9
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 9
- Tags: gemini, google-genai, function-calling, agents

In google-genai 3.3.0, GenerateContentConfig has tools and automatic_function_calling fields. Passing plain Python functions with type hints and docstrings in config=types.GenerateContentConfig(tools=[get_weather]) lets the SDK build the declarations, run the function when the model asks, and return the final answer in response.text. Disable it with automatic_function_calling=types.AutomaticFunctionCallingConfig(disable=True) when you need to approve or log each call yourself.
