adk-kotlin-agent-builder
Builds ADK Kotlin agents: LlmAgent with instructions and tools, @Tool function tools generated by KSP, hand-written tools, agent-as-tool and MCP, Sequential / Parallel / Loop agents and LLM transfer between sub-agents, callbacks and plugins, session state, artifacts, long-running and confirmation-gated tools, running with InMemoryRunner, and unit tests with a fake Model. Use when asked to create an agent, add or fix a tool, branch or loop between agents, run steps in parallel, pause for user approval, read or write session state, or test an agent. Don't use for build, dependency and CI questions (use adk-kotlin-setup).
Warnings for the author
- Not listed or searched: a skill under a hidden directory is discoverable only when the repository has no visible skill.
ADK Kotlin Agent Builder
Checked against main after release 1.1.0 (September 2026).
The references teach patterns and the rules behind most failures; they are not an API listing. The API is close to adk-python but not identical. If a symbol does not resolve, read core/src/*/kotlin/com/google/adk/kt/ (JVM- and Android-only APIs such as MCP and the persistent session services live outside commonMain) rather than guessing a neighbouring name. When a reference and the code disagree, the code is right.
References
| Task | Reference |
|---|---|
| First agent, running it, reading events, streaming | getting-started.md |
| The rules that cause most runtime failures | best-practices.md |
@Tool, hand-written tools, agent-as-tool, MCP, long-running and confirmation-gated tools | tools.md |
| Sequential, parallel and loop agents, LLM transfer | workflow-agents.md |
| Callbacks and plugins | callbacks-and-plugins.md |
| State, sessions, artifacts, memory | state-sessions-artifacts.md |
| Tests with a fake model | testing.md |
For Java callers, copy the patterns in examples/java/, a javac-only module that keeps the Java surface working.
Coming from adk-python
| Python | Kotlin |
|---|---|
LlmAgent(instruction="...") | LlmAgent(instruction = Instruction("...")) |
FunctionTool(func) | @Tool on the function (KSP generates the tool), or subclass FunctionTool |
tool_context.state[k] = v | context.updateState(k, v); read with context.state[k] |
ToolContext, CallbackContext | Context |
BaseToolset | Toolset |
LongRunningFunctionTool | isLongRunning = true, or @Tool(isLongRunning = true) |
output_schema=MyModel | outputSchema = Schema(...), built by hand |
runner.run_async(...) | runner.runAsync(...), a Flow<Event> |
event.is_final_response() | event.isFinalResponse |
Files of this skill
.agents/skills/adk-kotlin-agent-builder/references/best-practices.md.agents/skills/adk-kotlin-agent-builder/references/callbacks-and-plugins.md.agents/skills/adk-kotlin-agent-builder/references/getting-started.md.agents/skills/adk-kotlin-agent-builder/references/state-sessions-artifacts.md.agents/skills/adk-kotlin-agent-builder/references/testing.md.agents/skills/adk-kotlin-agent-builder/references/tools.md.agents/skills/adk-kotlin-agent-builder/references/workflow-agents.md