You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a single gmail_api ADK proxy tool that gates the entire Gmail REST API surface, paired with a Skill that teaches the agent how to use it. Creates tools.db SQLite file in a Docker volume with a gmail_tokens table for OAuth credential storage.
Why
Agent needs full Gmail API access, not just a subset of endpoints
OAuth tokens must be stored securely server-side (never exposed to sandbox)
Token refresh must be transparent (powered by google-auth library)
What
Add a single
gmail_apiADK proxy tool that gates the entire Gmail REST API surface, paired with a Skill that teaches the agent how to use it. Createstools.dbSQLite file in a Docker volume with agmail_tokenstable for OAuth credential storage.Why
How
src/blacki/storage/sqlite.py— SQLite connection manager, openstools.db, createsgmail_tokenstablesrc/blacki/gmail/auth.py— OAuth 2.0 flow, stores/refreshes token JSON ingmail_tokenssrc/blacki/gmail/client.py—gmail_api(method, path, params, body)proxy functionsrc/blacki/gmail/tools.py— ADK tool wrappinggmail_api()src/blacki/gmail/__init__.py— public exportssrc/blacki/skills/gmail/SKILL.md— teaches agent Gmail API query syntax, filters, labels, message opssrc/blacki/skills/gmail/references/api-reference.md— endpoint quick referenceuv run python -m blacki.gmail auth— one-time browser OAuth flowpyproject.toml— addgoogle-api-python-client,google-auth-oauthlib,aiosqlitesrc/blacki/registry.py— addgmail_enabledfield toToolConfig,_build_gmail_tools().env.example— addGMAIL_ENABLED,GMAIL_CREDENTIALS_PATH,SQLITE_PATHdocker-compose.yml— add/datavolume mount fortools.dbSources
src/blacki/registry.py:37(build_tools),src/blacki/tools.py:53(brave_search)Passing Criteria
uv run mypy .passes with no new errorsuv run ruff checkpassesuv run ruff formatpassesuv run pytest --cov=srcpasses with 100% coverage for new modulesuv run python -m blacki.gmail authcompletes OAuth flow and stores token intools.dbgmail_apitool appears in agent tool list whenGMAIL_ENABLED=truegmail_apihandles token refresh transparently (test with expired token mock)tests/gmail/covers auth flow, client proxy, and tool registrationPriority: High
Level of Effort: Large (6-8 hours)