# Building On-Device AI Agents on Android with Google ADK -- Part 3: Demystifying ToolContext --...

DevFeed: [Building On-Device AI Agents on Android with Google ADK -- Part 3: Demystifying ToolContext --...](<https://devfeed.tech/articles/building-on-device-ai-agents-on-android-with-google-adk-part-3-demystifying-toolcontext-62303.md>)

Original publisher: [Read original article](<https://medium.com/google-developer-experts/building-on-device-ai-agents-on-android-with-google-adk-part-3-demystifying-toolcontext-f578992168cb?source=rss----a67bd6fa7d58---4>)

Author: Pankaj Rai

Published: 2026-09-30T02:53:40Z

Content type: article

Language: en

Sources: [Google Developer Experts](<https://devfeed.tech/sources/google-developer-experts-medium.md>)

Topics: [google-adk](<https://devfeed.tech/topics/google-adk.md>), [On-device AI](<https://devfeed.tech/topics/on-device-ai.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [adk](<https://devfeed.tech/tags/adk.md>), [agents](<https://devfeed.tech/tags/agents.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [api](<https://devfeed.tech/tags/api.md>), [artifacts](<https://devfeed.tech/tags/artifacts.md>), [artificial-intelligence](<https://devfeed.tech/tags/artificial-intelligence.md>), [context](<https://devfeed.tech/tags/context.md>), [gemma](<https://devfeed.tech/tags/gemma.md>), [google](<https://devfeed.tech/tags/google.md>), [google-adk](<https://devfeed.tech/tags/google-adk.md>), [ksp](<https://devfeed.tech/tags/ksp.md>), [metadata](<https://devfeed.tech/tags/metadata.md>), [on-device-ai](<https://devfeed.tech/tags/on-device-ai.md>), [tools](<https://devfeed.tech/tags/tools.md>)

## AI overview

The excerpt introduces Google ADK's `ToolContext` as a runtime handle that gives tools access to session context beyond their input arguments and return values. It identifies questions tools may need to answer--who is invoking them, which session is active, and what happened earlier--and introduces ADK Artifacts for persisting intermediate notes or generated files across turns. The excerpt does not provide the promised implementation details or explain artifact versioning.

## Source excerpt

Go deep into the engine. Learn how ToolContext allows tools to inspect the active session, read user metadata, and save versioned... Continue reading on Google Developer Experts "