Skip to main content
Back to blog

Gemini Function Calling for Cloud Operations with Clanker Cloud

Use Gemini function calling with Clanker Cloud and Clanker CLI for cloud operations, Kubernetes debugging, MCP workflows, and reviewed infrastructure plans.

Google's Gemini API function calling docs describe the basic loop clearly: define functions, send them with the user prompt, let the model return a functionCall object, execute the function in your application, then send the result back so the model can answer.

That loop is simple. The hard part is making it safe around cloud infrastructure.

Clanker Cloud and Clanker CLI solve the infrastructure side. Gemini can reason and select functions. Clanker provides local, current, reviewable infrastructure tools.

What Gemini Function Calling Is Good For

Gemini function calling is useful for workflows where the model needs live data:

  • Query Kubernetes deployments.
  • Check GCP billing movement.
  • Inspect Cloud Run services.
  • Summarize GKE cluster health.
  • Read Terraform plan output.
  • Compare rollout timing to error spikes.
  • Produce structured incident reports.

The model does not execute the cloud operation by itself. Your application executes the function. That distinction matters.

For Clanker workflows, the function can be a Clanker Cloud MCP call or a Clanker CLI query. The Gemini model chooses the function and arguments. Clanker executes against local provider context.

Current Gemini Model Choices

Google's current model docs list Gemini 3.x models alongside Gemini 2.5 models, with function calling, structured outputs, code execution, search grounding, URL context, file search, and agent tooling spread across the product line.

For infrastructure operations, a practical split looks like this:

  • Use Gemini 3.1 Pro Preview for complex planning, code-plus-infra reasoning, and agentic work.
  • Use Gemini 3.5 Flash or Gemini Flash variants for fast, repeated checks.
  • Use Gemini 2.5 Flash for low-latency, high-volume workloads where the workflow is well-defined.

The model should be selected by risk. A daily health summary does not need the same model tier as a production database migration plan.

Gemini-Specific Tool Calling Details

Gemini has a few tool-calling details worth designing around.

First, the API can support parallel and compositional function calling for supported models. That is useful when independent checks can run at once:

  • Check Kubernetes health.
  • Check cloud cost delta.
  • Check recent deploy metadata.
  • Check security findings.

If the next tool depends on the previous result, keep the calls serial.

Second, Google documents function calling modes such as AUTO, ANY, NONE, and preview VALIDATED. Use those modes intentionally:

  • AUTO for normal chat.
  • ANY when every prompt should produce a tool call.
  • NONE when you want a pure language answer.
  • VALIDATED where schema adherence matters and the preview feature fits your risk tolerance.

Third, Google's docs call out a Gemini 3 behavior: keep temperature at the default value of 1.0 for Gemini 3 models, because lowering it may degrade behavior in some complex reasoning tasks. Do not blindly copy old "temperature 0 for tool calls" advice across model families.

A Clanker Cloud Gemini Workflow

Here is the useful pattern:

User: Why did the GKE API service start failing after the deploy?
Gemini: Calls Clanker Cloud to inspect GKE workload state.
Clanker Cloud: Returns rollout, pod, service, ingress, and event evidence.
Gemini: Calls Clanker Cloud for recent cost or provider changes if needed.
Clanker Cloud: Returns cloud-side context.
Gemini: Produces a root cause hypothesis and remediation plan.
User: Reviews before any apply step.

The infrastructure query is grounded in Clanker. The reasoning is handled by Gemini. The approval remains human.

Why Clanker CLI Helps Gemini Agents

Gemini-capable agents need a tool layer that already understands cloud operations. Raw provider APIs are too broad for most agent loops.

Clanker CLI provides a narrower, infrastructure-aware surface:

  • Ask questions in natural language.
  • Inspect multi-cloud state.
  • Query Kubernetes safely.
  • Export findings.
  • Bridge into MCP-capable agents.
  • Keep cloud credentials local.

That lets Gemini call tools that describe intent rather than every low-level API operation.

Good Gemini Tool Schemas for Infrastructure

Prefer tools like:

clanker_cloud_ask(question, mode)
get_kubernetes_rollout_context(namespace, workload)
find_cloud_cost_delta(provider, days)
scan_public_exposure(provider, scope)
summarize_deploy_blast_radius(repo, environment)

Avoid giving the model a generic "run arbitrary command" tool as the first option. If shell is required, put it behind review and log every call.

Where Clanker Cloud Plugs the Gap

Gemini knows how to call functions. It does not know your infrastructure unless you give it a trustworthy tool surface.

Clanker Cloud provides:

  • Local provider credentials.
  • BYOK model configuration.
  • Local MCP surface.
  • Desktop review workflow.
  • Multi-cloud and Kubernetes context.
  • Open-source Clanker CLI for terminal workflows.

That makes Gemini function calling useful for actual cloud operations, not just weather demos.

Sources

Next step

Give your agent live infrastructure context

Download Clanker Cloud, expose the local MCP surface, and let coding agents work from current cloud, Kubernetes, GitHub, and cost state instead of guesses.

Download Clanker CloudRead the AI agents page