
ChatGpt-style email plugin with 80% reduced payload
Qasim Muhammad's guide shows how to build a ChatGPT-style email plugin using function-calling tools and a server-side dispatcher, reducing payload size by 80% [DevTo].
Qasim Muhammad released a step-by-step guide for building a ChatGPT-style email plugin that uses function calling and a server-side dispatcher [DevTo]. The guide shows how to expose three tools—list_messages, get_message, and send_email—via a single Python dispatcher that talks to Nyla's v3 email API. Each tool includes a name, a short description, and a typed parameter object, following the OpenAI function-calling schema [DevTo].
The dispatcher routes calls based on the tool name, caps list limits at 200, and trims each message to four fields (id, from, subject, snippet), reducing payload size by roughly 80% compared with the full Nyla response [DevTo]. This design works for Gmail, Outlook, Yahoo, iCloud, IMAP, and EWS, eliminating the need for SMTP configuration.
The plugin's design provides three key benefits. By returning only four fields per message, it cuts token usage and cost. The API key never appears in the model's context, staying on the server-side dispatcher and preventing accidental leakage in chat transcripts [DevTo]. The send_email tool returns a pending_approval flag until the user explicitly approves the draft, blocking both hallucinated sends and malicious payloads injected via email bodies, and lowering the risk of accidental data exfiltration [DevTo].
Subscribe to the broadcast.
Daily digest of the day's most important tech news. No fluff. Engineering signal only.
// delivered via substack · double-opt-in confirmation


