Databricks-GenAI-Assoc Application Development Practice Question
A GenAI engineer is developing an agent on Databricks that must call a custom Python function to query an inventory database. The agent must decide when to invoke the function and must receive the result back into its reasoning loop. Which TWO actions are required to expose the function as a tool the agent can call? (Choose two.)
⚠ Common exam trap
The trap here is thinking that documenting a function or making it retrievable is enough, when the agent also needs explicit tool registration to actually invoke it.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Register the function with the agent using the framework's tool decorator or tool registration API so it appears in the tool list passed to the model.
Exposing a Python function as an agent tool requires two things: a well-formed schema the model can understand, derived from the function's name, docstring, and type hints, and explicit registration so the function is included in the tool list the agent passes to the LLM. Together these let the model decide when to call the tool and let the agent execute it and return results into the reasoning loop. The remaining options neither register the function nor execute it.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Deploy the function as a separate Mosaic AI Model Serving endpoint and hard-code its URL in the system prompt.
Why it's wrong here
Deploying a separate endpoint and embedding a URL in the prompt does not create a tool the agent can invoke through its tool-calling protocol. The model would have no structured schema to call, and the agent loop would not route results back automatically. This adds operational overhead without satisfying the tool-exposure requirement.
- ✗
Add the function's source code to the retrieval index so the model can retrieve it as context at inference time.
Why it's wrong here
Indexing source code makes it retrievable as text, but retrieval does not execute the function or return live inventory data. The agent would see code snippets rather than query results, and it could not trigger the database call. This conflates retrieval augmentation with tool calling, so it does not expose the function as a callable tool.
- ✓
Register the function with the agent using the framework's tool decorator or tool registration API so it appears in the tool list passed to the model.
Why this is correct
Even a well-documented function is invisible to the agent unless it is registered. The framework's tool decorator or registration call adds the function to the set of tools advertised to the LLM, enabling the model to emit a tool call. This registration step is what connects the Python callable to the agent's reasoning loop.
- ✓
Define the function with a clear docstring and type hints so the agent can infer its name, description, and parameters.
Why this is correct
Agent frameworks derive a tool's schema from the function's name, docstring, and type hints. A precise docstring tells the model what the tool does and when to use it, while type hints define the argument schema. Without these, the model cannot reliably choose or parameterize the tool, making this a required step for exposing the function.
- ✗
Convert the function's return value into an embedding and store it in Vector Search for similarity lookups.
Why it's wrong here
Embedding the return value would only help similarity search over past outputs; it would not let the agent invoke the function on demand or feed fresh results into its reasoning. The scenario requires the agent to decide when to call the function and receive the result, which embeddings cannot provide. This option misapplies Vector Search to a tool-calling need.
About these practice questions
One of 330 original Databricks-GenAI-Assoc practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Databricks exam blueprint
This Databricks-GenAI-Assoc practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-GenAI-Assoc exam.