In August 2025, we launched the Agent Config feature in ADK, which lets you build an agent using YAML config files very easily. How easy? Let’s try it!
Create A YAML Agent
Once you’ve installed ADK, create a new app with the adk create command. Note the --type=config parameter, which tells the tool to create a config-based agent.
adk create --type=config yaml_agent
Once it finishes, you will get a yaml_agent folder with a root_agent.yaml that looks like this:
name: root_agent
description: A helpful assistant for user questions.
instruction: Answer user questions to the best of your knowledge
model: gemini-2.5-flash
Pretty self-explanatory, right?
Add an MCP Toolset
The created agent is bare-bones and doesn’t do much beyond an LLM model at the moment. We are going to extend its capabilities by connecting the agent to an MCP server.
Let’s give it the ability to check the weather using mcp_weather_server. You can install it with pip:
pip install mcp_weather_server
Then, provide it to the agent by appending these couple lines of code in root_agent.yaml:
tools:
- name: MCPToolset
args:
stdio_server_params:
command: "python"
args:
- "-m"
- "mcp_weather_server"
Now let’s fire up adk web and try it!
Not bad, except for one issue: The agent is talking in Celsius. Let’s teach it Fahrenheit.
Add a Python Function Tool
A very powerful feature in ADK’s YAML config is that you can mix in Python code, giving you the best of both worlds!
Let’s start by creating a tools.py file in the yaml_agent folder with the following content:
def c_to_f(celsius: float) -> float:
""" Converts a temperature from Celsius to Fahrenheit. """
fahrenheit = (celsius * 9/5) + 32
return fahrenheit
Now we give the tool’s path to the agent by adding a new item under the tools section in root_agent.yaml:
- name: yaml_agent.tools.c_to_f
Restart adk web and now it’s calling our Python function tool!
That’s it for our two minutes. See you next time!
Resources
Source Credit: https://medium.com/google-cloud/2-minute-adk-build-agents-the-easy-way-yaml-a55678d64a75?source=rss—-e52cf94d98af—4
