Add email_blast tool for NEMO to send branded emails via basketball-api #31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Standalone — part of westside-email-agent capability (2026-04-04). NEMO needs to call basketball-api's /admin/email/blast endpoint to send branded emails on behalf of Marcus.
Repo
forgejo_admin/westside-ai-assistantUser Story
As an admin messaging NEMO on GroupMe, I want to say "remind parents to sign contracts" and have NEMO compose and send the email through the blast endpoint, so that email campaigns are a conversation, not code.
Context
basketball-api has
POST /admin/email/blastwhich accepts layout, email_type, query, subject, data, and optional test_email. The endpoint requires Keycloak JWT auth. westside-ai-assistant already authenticates to basketball-api via Keycloak (seeconfig.pykeycloak settings andbasketball.pyclient).The existing tool pattern:
api_getdoes GET requests. Write tools use the confirmation system (confirmation.py) — agent proposes action, user says "yes", then it executes. Email blast should follow this same pattern since it's a write operation with real-world impact.NEMO should know:
File Targets
Files to modify:
app/ai.py— addemail_blasttool to TOOLS list, add execution handler, update SYSTEM_PROMPT with email capabilitiesapp/basketball.py— addpostmethod to BasketballClient (currently only hasget)Files NOT to touch:
app/confirmation.py— existing confirmation system works as-is for email blastapp/groupme.py— webhook handler unchangedapp/config.py— keycloak auth already configuredAcceptance Criteria
email_blasttool exists in TOOLS list with input schema: layout, email_type, query, subject, data, test_email (optional)Test Expectations
pytest tests/ -vConstraints
Checklist
Related
arch-email— email architecturesop-email-send— email send workflow (the SOP NEMO should follow)project-westside-agency— agent capability buildoutScope Review: NEEDS_REFINEMENT
Review note:
review-759-2026-04-03Template is complete and file targets are verified. One traceability gap blocks advancement.
story:WA-S1label has no matching entry inproject-westside-ai-assistantuser-stories section. The project page lists:read-ops,write-ops,safety. Either create a new user story for email/agent-driven-comms, or relabel to an existing story (e.g.,story:write-ops).arch:emailnote verified (id 1102, active).Scope Review: READY
Review note:
review-759-2026-04-03-r2Re-review after story label fix. Previous finding (story:WA-S1 had no matching project page entry) resolved — now story:write-ops, verified on project-westside-ai-assistant. All template sections present, all file targets verified, traceability complete (arch-email note confirmed), dependencies satisfied. Ready for execution.