GCP Generative AI Leader Practice Question 56: Cloud Run Functions Agent Tool
Google Cloud Generative AI Leader · Test 6 · question 6 of 10
A logistics company built an agent that can answer questions about shipment policies using grounding, but it cannot yet tell a customer where a specific package currently is. The tracking status lives in a legacy internal system with no public API, only an internal database query that a small custom program can run. The company wants the agent to call that program on demand and return the live status in its answer, without standing up and operating a full server.
Which Google Cloud service is the best fit for wrapping that legacy lookup so the agent can call it as a tool?
Show answer and explanation
Answer:
Cloud Run functions (formerly Cloud Functions) is a lightweight, fully managed way to run a single-purpose piece of code that responds to an event, such as an HTTP call, without provisioning or managing a server. It is a natural way to wrap a legacy internal lookup: the function contains the small program that queries the tracking database, the agent's tool definition calls the function's HTTP endpoint on demand, and the function returns the live status for the model to use in its answer. This matches the "fetch data" pattern of tool use, connecting an agent to a system it was never natively integrated with, at low operational overhead.
- A is wrong because it describes managing a persistent virtual machine and socket, the opposite of the serverless, event-triggered model Cloud Run functions provides, and it adds operational burden the company wanted to avoid. - C is wrong because Dataflow is built for large-scale batch or streaming data processing pipelines, not for serving a single on-demand lookup as a callable tool. - D is wrong because a daily static export would not reflect where a package is right now; it would give stale data for a request that needs a live answer.
Reference: Cloud Run functions overview