Connect SendGrid to Claude Code
Send email, and read deliverability stats, suppressions, templates and contacts. Add Toolspoke to Claude Code once and it can use 10 SendGrid actions. Your SendGrid credential stays in Toolspoke, and you choose which actions Claude Code may call.
Set it up in Claude Code
Three steps, the first one once for every toolkit you will ever add.
Add Toolspoke to Claude Code
Run it in your project, then /mcp to sign in
claude mcp add --transport http toolspoke https://toolspoke.com/mcpThe sign-in opens in your browser, and Toolspoke asks you to approve it.
Install SendGrid and connect it
Add SendGrid to a project in your Toolspoke workspace.
API key. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.
- API key
- Settings → API Keys → Create API Key. Restricted Access is enough: Mail Send for send_mail, Suppressions for the bounce actions, Template Engine for the template reads, Marketing for the contact actions, and Stats for get_stats. The key is shown once.
Choose what Claude Code may do
All 10 actions start on. Switch off any of the 2 actions that change something in SendGrid, and Claude Code gets a refusal if it tries.
What you can ask Claude Code for
A few of the SendGrid actions that only read, so they are safe to try first.
- List bounced addresses on this account with the reason and status the receiving server gave
- List transactional templates with their ids and versions
- Retrieve one transactional template by id, with every version and the substitution variables each expects
- Return a sample of this account's marketing contacts, up to 50 of the most recent, sorted by email address
What Claude Code can do in SendGrid
8 actions read and 2 delete or permanently change something.
Reads
List bounces
List bounced addresses on this account with the reason and status the receiving server gave. This is the first thing to read when a customer says they never got the mail.
List templates
List transactional templates with their ids and versions. Call it to find the template_id send_mail should render. SendGrid requires a page size on this endpoint, so one is always sent.
Get template
Retrieve one transactional template by id, with every version and the substitution variables each expects.
List contacts
Return a sample of this account's marketing contacts, up to 50 of the most recent, sorted by email address. SendGrid takes no arguments here and offers no paging, so this is a sample rather than an enumeration; use search_contacts to find a specific person.
Search contacts
Find marketing contacts with a SendGrid query (SGQL), e.g. email LIKE '%acme.com%' or last_name = 'Wozniak'. Returns up to 50 contacts. A POST that reads and changes nothing, so it is classified read. SendGrid answers 408 if the query takes longer than 20 seconds.
Get stats
Return global email statistics for a date range: requests, delivered, opens, clicks, bounces, spam reports and unsubscribes. start_date is required by SendGrid; end_date defaults to today.
List verified senders
List the sender identities on this account, verified and unverified alike, each with the address and the verified flag. Call it before send_mail: an unverified from_email is the usual reason a send is refused.
Get account details
Return the account's plan type and reputation score. Takes no arguments, reads nobody's mail and costs nothing, which is why it is what an install tests itself with.
Deletes or permanently changes
Send mail
Send one email through SendGrid v3. Classified destructive rather than write, and deliberately so: it delivers to real inboxes, it cannot be recalled once SendGrid accepts it, and it consumes the account's send allowance. A write grant reaches nothing in this file. Supply html, text, or both, or a template_id that carries the body itself. SendGrid answers 202 with an empty body on success, so a successful send returns no message id.
Delete bounce
Remove one address from the bounce suppression list, so SendGrid will attempt delivery to it again. Destructive on both counts: the suppression record is gone with no undo, and lifting a suppression is what starts mail flowing to an address a receiving server already refused, which is how a sending reputation is damaged. Deletes exactly one address, this connector exposes no bulk or delete-all form. SendGrid answers 204 with an empty body.
SendGrid in Claude Code: questions
Does Claude Code see my SendGrid credential?
No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.
Can I stop Claude Code from changing things in SendGrid?
Yes. Each of the 10 actions can be switched off for a project. Turn off the 2 that change something and Claude Code can only read.
Will 10 actions crowd Claude Code's context?
No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the SendGrid action it needs when it needs it. Adding more toolkits does not add more tools to its list.
Can I add it once for every project?
Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.
What does it cost?
Tool calls are free on every plan, and a SendGrid call does not run in a sandbox, so it bills nothing.
SendGrid in your other apps
Try SendGrid in Claude Code
Free to start, and tool calls cost nothing on any plan.