Geminifunction callingGoogle AItolls

Calculate tolls with Gemini: function calling is the real path

No native Gemini connector for tolls exists; use declarative tools (function calling) from your app against the toll API, or MCP where supported.

By Jorge Parada, CTO de Cargoffer

Calculate tolls with Gemini

Direct answer: no native Gemini connector for the Tolls Calculator API is documented. The real path is function calling (Gemini's declarative tools): you declare a toll tool, and your application performs the HTTP call and returns the result to the model. Where MCP is supported by your client, the tolls MCP server works across clients.

Pattern with the Gemini API

Declare a calcular_peajes tool (polyline, vehicle_class, payment_method) with an instruction like "always use this tool for toll amounts; never estimate". When the model returns a functionCall, your backend calls POST https://back.transcend.cargoffer.com/api/v1/tolls/calculate with Bearer auth and sends the JSON back as functionResponse.

Gemini-specific notes

Gemini models respond well to explicit "use the tool for any figure" instructions β€” without them the model may quote outdated tariffs. Do not expect route geometry from the model: supply coordinates or route first. Verify the current state of MCP support in Google's docs before promising it; function calling is the stable option today.

Never present a toll figure that didn't come from a live API call.

Frequently asked questions

Is there a native Gemini integration for tolls?
None documented; use function calling from your app or MCP where supported.
Can Gemini compute the route by itself?
No; it doesn't produce reliable polylines. Route first, then call the toll tool.
Where is the API key?
In your backend, which executes the call; never in the prompt or tool definition.

Related resources

Ready to calculate tolls with live data?