How to integrate Sendgrid MCP with LlamaIndex

Framework Integration Gradient
Sendgrid Logo
LlamaIndex Logo
divider

Introduction

This guide walks you through connecting Sendgrid to LlamaIndex using the Composio tool router. By the end, you'll have a working Sendgrid agent that can add a new contact to newsletter list, activate latest version of promo template, add recipient emails to global suppression group, add ip addresses to allow list for sending through natural language commands.

This guide will help you understand how to give your LlamaIndex agent real control over a Sendgrid account through Composio's Sendgrid MCP server.

Before we dive in, let's take a quick look at the key ideas and tools involved.

TL;DR

Here's what you'll learn:
  • Set your OpenAI and Composio API keys
  • Install LlamaIndex and Composio packages
  • Create a Composio Tool Router session for Sendgrid
  • Connect LlamaIndex to the Sendgrid MCP server
  • Build a Sendgrid-powered agent using LlamaIndex
  • Interact with Sendgrid through natural language

What is LlamaIndex?

LlamaIndex is a data framework for building LLM applications. It provides tools for connecting LLMs to external data sources and services through agents and tools.

Key features include:

  • ReAct Agent: Reasoning and acting pattern for tool-using agents
  • MCP Tools: Native support for Model Context Protocol
  • Context Management: Maintain conversation context across interactions
  • Async Support: Built for async/await patterns

What is the Sendgrid MCP server, and what's possible with it?

The Sendgrid MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Sendgrid account. It provides structured and secure access to your email delivery platform, so your agent can perform actions like managing contacts, sending transactional emails, organizing IP pools, and handling suppression lists on your behalf.

  • Automated contact and recipient management: Allow your agent to add or update contacts, assign recipients to specific lists, and manage your marketing audiences efficiently.
  • Email template and version control: Enable the agent to activate specific template versions, ensuring your email campaigns always use the latest approved content.
  • IP pool and address management: Let your agent add IP addresses to pools, authenticated domains, or allow lists, helping you scale and secure your email delivery infrastructure.
  • Suppression and compliance automation: Direct the agent to add email addresses to global suppression groups, keeping your mailing lists compliant and minimizing bounces or spam issues.
  • Bulk operations for marketing efficiency: Use the agent to perform batch actions like appending multiple IPs to pools or adding large groups of contacts, streamlining high-volume marketing workflows.

Supported Tools & Triggers

Tools
Activate template version**this endpoint allows you to activate a version of one of your templates.
Add a batch of ips to an ip poolThis operation appends a batch of ips to an ip pool.
Add an ip address to a poolAdd an ip address to a pool with this endpoint.
Add an ip to an authenticated domain**this endpoint allows you to add an ip address to an authenticated domain.
Add a single recipient to a list**this endpoint allows you to add a single recipient to a list.
Add a twilio sendgrid ip addressThis operation adds a twilio sendgrid ip address to your account.
Add ips**this endpoint is for adding a(n) ip address(es) to your account.
Add one or more ips to the allow listThis endpoint adds allowed ip addresses to a list, which then assigns each ip an id for future removal; ids can be retrieved via a specific retrieval endpoint.
Add or update a contactThe endpoint can handle 30k contacts or 6mb, reports queuing/errors, needs extra steps to confirm changes and retrieve ids.
Add recipient addresses to the global suppression group**this endpoint allows you to add one or more email addresses to the global suppressions group.
Add suppressions to a suppression group**this endpoint allows you to add email addresses to an unsubscribe group.
Approve access request**this endpoint allows you to approve an access attempt.
Assign a batch of subusers to an ipThis operation appends a batch of subusers to a specified ip address.
Associate a branded link with a subuserParent accounts can create and validate branded links, then assign them to subusers through the api or twilio sendgrid app, enabling subusers to use the branded links for mail.
Associate an authenticated domain with a given userAssociate authenticated domains with subusers under a parent account to enable email sending using the parent's domain.
Authenticate a domainThe endpoint enables domain authentication for users or subusers, offering two methods—'username' parameter for visibility and modification, or the association workflow for a fixed, non-editable domain assignment.
Authenticate an account with single sign onAuthenticates and logs in a user to twilio sendgrid as a specific admin identity configured for sso by partner.
Bind authenticated domains to userThis endpoint enables linking up to five authenticated domains from a parent account to a subuser, giving them permission to send emails with the parent's domain.
Bulk delete single sendsThis api endpoint enables the deletion of multiple single sends by providing their ids.
Cancel or pause a scheduled sendThis api endpoint allows users to cancel or pause a scheduled email by providing its `batch id`.
Completed stepsThis api endpoint checks if a sendgrid account has completed domain authentication (`domain verified`) and single sender verification (`sender verified`), returning boolean values for each.
Create a batch idCreate a new mail batch id to group email sends, allowing pause or cancel actions via the scheduled sends api.
Create a branded linkCreate a new branded link by specifying the root domain, which must align with your from email, and an optional unique subdomain.
Create a campaignThis endpoint enables campaign creation, requiring a subject, sender id, content (html and text suggested), and a list or segment id for sending or scheduling, but not for initial creation.
Create a custom field**this endpoint allows you to create a custom field.
Create a list**this endpoint allows you to create a list for your recipients.
Create an accountCreates a new account, with specified offering, under the organization.
Create a new alert**this endpoint allows you to create a new alert.
Create a new event webhookSet up an event webhook by providing a url, choosing events for post requests, and receive a unique id.
Create a new suppression group**this endpoint allows you to create a new suppression group.
Create a new transactional template version**this endpoint allows you to create a new version of a template.
Create an ip poolCreate an ip pool by activating an ip in sendgrid: log in, go to settings > ip addresses, edit selected ip, check to allow sending, and save.
Create an ip pool with a name and ip assignmentsCreating an ip pool associates specified ips with it.
Create an sso certificate**this endpoint allows you to create an sso certificate.
Create an sso integration**this endpoint allows you to create an sso integration.
Create an sso teammateCreate an sso teammate with email as username.
Create a parse settingCreate a new inbound parse setting with a twilio sendgrid authenticated `hostname` and a public `url` to receive parsed messages via http post.
Create api keysUse sendgrid app to create an initial api key; then manage others via api.
Create a segmentNew segment endpoint created: supports various operators for date, text, number, and email fields.
Create a senderThis api endpoint is for creating new senders, with a limit of 100.
Create a sender identity**this endpoint allows you to create a new sender identity.
Create a transactional template**this endpoint allows you to create a transactional template.
Create custom field definitionCreate unique case-insensitive custom fields with alphanumeric/underscore names starting with a letter/underscore.
Create designCreate new designs via `/designs` by submitting html content.
CreateintegrationThis endpoint creates an integration for email event forwarding.
Create listThis endpoint enables the creation of a new contacts list, which can automate email sending when new contacts are added.
Create segmentSegment `name` has to be unique.
Create single sendThe endpoint lets you create a single send draft without needing a template id; it now uses `email config`.
Create subuser**this endpoint allows you to create a new subuser.
Create verified sender requestThis endpoint creates a new sender identity via `post`, sends a verification email to `from email`, and requires email verification.
Delete a batch of ips from an ip poolThis operation removes a batch of ips from an ip pool.
Delete a batch of subusers from an ipThis operation removes a batch of subusers from a specified ip address.
Delete a bounce**this endpoint allows you to remove an email address from your bounce list.
Delete a branded linkDelete a branded link using this endpoint; successful deletion returns a 204 status.
Delete a campaign**this endpoint allows you to delete a specific campaign.
Delete a cancellation or pause from a scheduled send**this endpoint allows you to delete the cancellation/pause of a scheduled send.
Delete a contact identifierThis endpoint asynchronously deletes an identifier (not the entire contact) from a contact, failing if it's their only one.
Delete a custom field**this endpoint allows you to delete a custom field by id.
Delete a global suppressionThis endpoint removes an email from suppressions, allowing future emails to be sent to it.
Delete a list**this endpoint allows you to delete a specific recipient list with the given id.
Delete an accountTo delete an organization's account by id: it revokes api keys/sso, removes sendgrid resources like dedicated ips, and stops billing immediately.
Delete an alert**this endpoint allows you to delete an alert.
Delete an authenticated domain**this endpoint allows you to delete an authenticated domain.
Delete an ip pool**this endpoint allows you to delete an ip pool.
Delete an sso certificate**this endpoint allows you to delete an sso certificate.
Delete an sso integration**this endpoint allows you to delete an idp configuration by id.
Delete a parse setting**this endpoint allows you to delete a specific inbound parse setting by hostname.
Delete api keys**this endpoint allows you to revoke an existing api key using an `api key id`** authentications using a revoked api key will fail after after some small propogation delay.
Delete a recipient**this endpoint allows you to delete a single recipient with the given id from your contact database.
Delete a reverse dns recordThis endpoint deletes a reverse dns record, returning a 204 code on success.
Delete a segment**this endpoint allows you to delete a segment from your recipients database.
Delete a sender**this endpoint allows you to delete an existing sender.
Delete a sender identity**this endpoint allows you to delete one of your sender identities.
Delete a single event webhook by idDelete a specific event webhook by id with this endpoint.
Delete a single recipient from a single list**this endpoint allows you to delete a single recipient from a list.
Delete a specific block**this endpoint allows you to delete a specific email address from your blocks list.
Delete a specific invalid email**this endpoint allows you to remove a specific email address from the invalid email address list.
Delete a specific spam reportThis endpoint removes a spam report for an email, lifting suppression and allowing email to be sent to that address.
Delete a subuser**this endpoint allows you to delete a subuser.
Delete a suppression from a suppression groupThis endpoint removes an email from a suppression group, re-enabling email delivery unless specified otherwise, and should only be used when recipients opt back in.
Delete a suppression groupThis api endpoint deletes email suppression groups.
Delete a template**this endpoint allows you to delete a transactional template.
Delete a transactional template version**this endpoint allows you to delete a transactional template version.
Delete blocksThis endpoint enables clearing blocked emails either by deleting all with `delete all`=true or by specifying addresses in the `emails` array.
Delete bouncesThis api endpoint lets users delete bounced emails: either all by setting `delete all` to true, or specific ones by listing them in `emails`.
DeletebulkintegrationThis endpoint deletes integrations.
Delete contactsUse this endpoint to bulk delete contacts with `ids` as a list of ids or `delete all contacts` set to `"true"` for all.
Delete custom field definition**this endpoint deletes a defined custom field.
Delete design**this endpoint allows you to delete a single design**.
Delete invalid emailsThis endpoint lets you delete email addresses from your invalid list; delete all by setting `delete all` to true, or specify individual addresses to remove.
Delete ip poolThis operation deletes an ip pool and unassigns all ip addresses associated with the pool.
Delete pending teammate**this endpoint allows you to delete a pending teammate invite.
Delete segment**this endpoint allows you to delete a segment by id.
Delete single send by idThis endpoint lets you delete a single send with its id, which you can obtain by a get request to `/marketing/singlensends`.
Delete single send scheduleCancel a scheduled single send by making a delete request with its id to the endpoint.
Delete spam reportsThis endpoint lets users delete spam reports, lifting email suppression for specified addresses.
Delete teammate**this endpoint allows you to delete a teammate.
Delete verified senderUse this endpoint with a sender identity's `id` to remove it from your account.
Deny access request**this endpoint allows you to deny an attempt to access your account.
Disassociate a branded link from a subuserThe endpoint permits parent accounts to remove a branded link from a subuser, with successful disassociations confirmed by a 204 status code response.
Disassociate an authenticated domain from a given userDisassociate an authenticated domain from a given user.
Domain warn listThe endpoint provides a list of domains with dmarc, divided by how they fail (hard or soft).
Download csv**this endpoint will return a presigned url that can be used to download the csv that was requested from the "request a csv" endpoint.
Duplicate a transactional template**this endpoint allows you to duplicate a transactional template.
Duplicate designThis endpoint duplicates existing designs without requiring data in the request body.
Duplicate sendgrid pre built designThe endpoint lets you duplicate twilio sendgrid pre-built designs without data.
Duplicate single sendThis endpoint duplicates single sends using an id for easy creation, allowing edits via patch.
Edit an sso teammateThis endpoint allows admin or parent users to adjust sso teammate permissions using 'is admin', 'scopes', or 'persona', and to control subuser access, including restrictions.
Edit a transactional templateThis endpoint lets you change the name of a transactional template.
Edit a transactional template version**this endpoint allows you to edit the content of your template version.
Edit verified senderUpdate a sender identity by sending a `patch` request with the `id` and json-formatted changes.
Email dns records to a co workerUse sendgrid for domain validation and branding by sharing dns records—cname for automated security, or txt/mx otherwise.
Enable disable a subuser**this endpoint allows you to enable or disable a subuser.
Enable disable website access for a subuserEnable/disable website access for a subuser, while still preserving email send functionality.
Erase recipients email dataSendgrid's delete recipients' email data operation removes personal data of up to 5,000 unique email recipients or a 256kb payload per request.
Export contactsUse the endpoint to export contact lists or segments by email, with notifications, or download as csvs using an 'id'.
Export contacts statusUse this endpoint with an `id` from "export contacts" to check the status and get `urls` for downloading your csv contact export files.
Export single send statsThis endpoint exports single send stats in .
Filter all messagesSummarize email activity filtering: use url-encoded queries in the format `query={type}="{content}"` to search email activity.
Filter messages by message idGet all of the details about the specified message.
FiltersegmentsbyparentidsRetrieve segments using `parent list ids` as a filter.
Get account offeringsRetrieves offering information about the specified account.
Get a contact by id**this endpoint returns the full details and all fields for the specified contact**.
Get a list by idThis endpoint fetches detailed information on a list.
Get a list of all ip addresses on your accountFetches your account's ip addresses with details such as pool association and warm-up status.
Get a list of all senders**this endpoint allows you to get a list of all your senders.
Get a list of subusers assigned to an ipThe api lists subuser ids with a specific ip, retrieves up to 100 per request, and iterates with `after key` for more.
Get all accountsRetrieves all accounts under the organization.
Get all automation statsRetrieve all your automation stats by default or specify with 'automation ids'.
Get all available offeringsRetrieves offerings available under the organization.
Get all categories**this endpoint allows you to retrieve all the categories associated with your single sends.
Get all existing exportsThis endpoint provides an array with details on active or completed export jobs.
Get all field definitions**this endpoint retrieves all defined custom fields and reserved fields.
Get all ip pools that have associated ipsThe function lists your ip pools and samples up to 10 ips from each.
Get all lists**this endpoint returns an array of all of your contact lists.
Get all sender identities**this endpoint allows you to retrieve a list of all sender identities that have been created for your account.
Get all single sendsRetrieve a list of your single sends with brief details, including their ids.
Get all single sends statsRetrieve single sends stats with options for filtering by ids, pagination, and custom page sizes from 1-50.
Get all sso certificates by integration**this endpoint allows you to retrieve all your idp configurations by configuration id.
Get all sso integrations**this endpoint allows you to retrieve all sso integrations tied to your twilio sendgrid account.
Get all verified sendersRetrieve all sender identities (verified/unverified) for an account via an endpoint.
Get an account s stateRetrieve the state of the specified account.
Get an sso certificate**this endpoint allows you to retrieve an individual sso certificate.
Get an sso integration**this endpoint allows you to retrieve an sso integration by id.
Get a specific sender**this endpoint allows you to get the details for a specific sender by `id`.
Get a user s account information**this endpoint allows you to retrieve your user account details.
Get a user s profile**this endpoint allows you to retrieve your current profile details.
Get automation click tracking stats by id**this endpoint lets you retrieve click-tracking stats for a single automation**.
Get automation stats by idRetrieve detailed stats for a specific automation by id, with optional date and aggregation filters, or use another endpoint to get stats for multiple automations.
Get batched contacts by idsThis endpoint fetches multiple contacts using their ids, allowing up to 100 ids per request for efficiency over single `get` requests.
Get bounce class statsThis endpoint will return the number of bounces for the classification specified in descending order for each day.
Get contacts by emailsEndpoint retrieves up to 100 contacts by email, ignoring case/space; simpler than sgql's search.
Get contacts by identifiersUse the endpoint to fetch up to 100 contacts by identifiers (email, phone number, etc.
Get designAccess a specific design's details in your design library with a get request to `/designs/{id}`.
Get details for an ip addressThe operation provides details for an ip address, such as its parent account status, warm-up settings, associated pools, add/modify dates, lease status, and enablement, excluding subuser info, which requires a different endpoint.
Get details for an ip poolThis operation retrieves details of an ip pool, such as name, id, some sample ips (up to 10), and the total ip count.
Get engagement quality scoresRetrieve your sendgrid engagement quality (seq) scores via api for a chosen date range.
Get information on a single suppression group**this endpoint allows you to retrieve a single suppression group.
GetintegrationThis endpoint returns the data for a specific integration.
Get ips assigned to an ip poolThis operation returns the ip addresses that are assigned to the specified ip pool.
Get list contact count**this endpoint returns the number of contacts on a specific list.
Get list of segmentsThe api endpoint retrieves segments, using `parent list ids` to filter results.
Get open tracking settingsThe endpoint retrieves settings for tracking email opens using an invisible image.
Get recipient upload status**this endpoint allows you to check the upload status of a marketing campaigns recipient.
Get remaining ips count**this endpoint gets amount of ip addresses that can still be created during a given period and the price of those ips.
Get sample contactsThe endpoint returns the latest 50 contacts, sorted by email, with the total count included.
Get segment by idGet marketing campaigns segment by id
Get sendgrid pre built designThe endpoint `/designs/pre-builts/{id}` is used to fetch details about a particular pre-built design for duplication and modification.
Get signed event webhook s public keyRetrieve a webhook's public key using its id via this endpoint; if no id is given, the oldest key is returned.
Get single send by id**this endpoint allows you to retrieve details about one single send using a single send id.
Get single send click tracking stats by id**this endpoint lets you retrieve click-tracking stats for one single send**.
Get single sends searchSearch for single sends by specifying `name`, `status`, and `categories` in the request body.
Get single send stats by idRetrieve individual single send stats using its id.
Get subuser monthly statsRetrieve monthly email stats for subusers with `sort by metric`, excluding sorts by `bounce drops`, `deferred`, `invalid emails`, `processed`, `spam report drops`, `spam reports`, `unsubscribe drops`.
Get subusers engagement quality scoresRetrieve seq scores for sendgrid subusers/accounts on a specific date; expect ‘200’ with scores or ‘202’ if unavailable yet, possibly accessible later.
Get suppression groupsThis endpoint provides a list of user-created suppression groups and can return info for multiple groups when their ids are added to the request with `?
Get teammate subuser accessRetrieve subusers accessible to a specified teammate, with available scopes.
Get the credits for a subuser**this endpoint allows you to retrieve a credits overview for a subuser.
Get the default authenticationThis endpoint fetches the default domain authentication, used for sending all mail unless overridden by a 'from' address match.
Get the settings for a single event webhookRetrieve an event webhook by id to get settings, event types, and url details.
Get total contact count**this endpoint returns the total number of contacts you have stored.
Retrieve a list of scopes for which this user has accessRetrieve a list of scopes for which this user has access
Import contactsThe endpoint permits async csv uploads for up to 1m contacts or 5gb with specified identifiers and file type, supports gzip, field mappings, uses job id for tracking, and recommends regular backups.
Import contacts statusCheck the status of contact import jobs using `job id` via this endpoint.
Invite teammateInvite teammates to your account through email with this endpoint, assigning initial permissions via the `scopes` array.
List all authenticated domainsRetrieve authenticated domain lists in pages using the `limit` parameter for page size and `offset` to start from specific list positions.
List all subusersRetrieve a paginated list of subusers with filtering options.
List api keysRetrieve user's api key names and ids with this endpoint; keys themself cannot be retrieved for security.
List Bulk Email Validation Jobs**this endpoint returns a list of all of a user's bulk email validation jobs.
List designsThe `/designs` endpoint fetches a list of user's stored designs, restricted to 100 per request by default but adjustable with `page size`.
ListintegrationThis endpoint returns all the integrations for the user making this call.
List sendgrid pre built designsThe `designs/pre-builts` endpoint fetches a list of twilio sendgrid's ready-made designs, not user-specific ones, with 100 results per request by default, adjustable with `page size`.
List the authenticated domain associated with the given userParent accounts can link validated domains to subusers through an endpoint, allowing subusers to email from those domains.
Manually refresh a segmentManually refresh a segment by segment id.
Presigned url headers for bulk email validationGet a presigned url and headers to upload an email list for verification.
Remove an ip address from a pool**this endpoint allows you to remove an ip address from an ip pool.
Remove an ip from an authenticated domain**this endpoint allows you to remove an ip address from that domain's authentication.
Remove a specific ip from the allowed listThis endpoint lets you delete an allowed ip address using its id, obtainable via the "retrieve allowed ips" endpoint.
Remove contacts from a list**this endpoint allows you to remove contacts from a given list.
Remove list and optional contacts**this endpoint allows you to deletes a specific list.
Remove one or more ips from the allow listThis endpoint lets you remove ips from your allowed list by sending an array of their ids, obtained from another endpoint.
Remove segment without affecting contactsThis endpoint permits the deletion of a segment using `segment id`, but associated contacts remain in the overall list and any other segments they're part of.
Rename an ip pool**this endpoint allows you to update the name of an ip pool.
Request csvInitiating a backend process creates a csv file of up to 1 million events from the last 30 days, emailed to the user with a 3-day expiry link.
Resend a sender verification**this endpoint allows you to resend the verification request for a specific sender.
Resend sender identity verification**this endpoint allows you to resend a sender identity verification email.
Resend teammate invite**this endpoint allows you to resend a teammate invitation.
Resend verified sender requestThis endpoint resends a verification email to a sender identity's 'from address' by using the 'id' of the sender.
Retrieve a bounce**this endpoint allows you to retrieve a specific bounce by email address.
Retrieve a branded link**this endpoint allows you to retrieve a specific branded link by providing its id.
Retrieve access requestsRetrieve a list of recent access requests using pagination with `limit` for page size and `offset` to control the start position for additional items.
Retrieve a count of recipients**this endpoint allows you to retrieve the total number of marketing campaigns recipients.
Retrieve a custom field**this endpoint allows you to retrieve a custom field by id.
Retrieve address whitelist mail settingsThis endpoint lets you access settings for whitelisting specific emails or domains to prevent email suppression due to bounces, blocks, or unsubscribes.
Retrieve a global suppressionThis endpoint retrieves global email suppressions and confirms if an email is suppressed.
Retrieve a list of currently allowed ipsThis endpoint provides a list of authorized ip addresses for your account, each with creation, update dates, and a unique id for potential removal.
Retrieve all alerts**this endpoint allows you to retrieve all of your alerts.
Retrieve all assigned ipsThis api endpoint retrieves assigned ip addresses used to send emails for various domains, where the ip's reputation is influenced by the collective performance of all sending users.
Retrieve all blocksRetrieve a paginated list of blocked emails using this endpoint, with adjustable page sizes via the 'limit' parameter and starting points with 'offset' for multiple requests.
Retrieve all bouncesThis endpoint retrieves a paginated list of all your bounces, allowing customization of page size with `limit` and starting position with `offset` for multiple requests.
Retrieve all branded links**this endpoint allows you to retrieve all branded links**.
Retrieve all campaignsRetrieve a paginated list of campaigns in reverse creation order with the api endpoint.
Retrieve all categoriesThis endpoint provides a paginated list of user categories, with adjustable page size using the `limit` and pagination control using `offset`.
Retrieve all custom fields**this endpoint allows you to retrieve all custom fields.
Retrieve all global suppressionsRetrieve paginated lists of globally suppressed emails using `limit` for page size and `offset` to start from a specific list position.
Retrieve all invalid emailsRetrieve paginated lists of invalid emails with 'limit' for page size and 'offset' to start from a specific position for lists exceeding the limit.
Retrieve all ip addressesRetrieve a paginated list of assigned/unassigned ips with warmup status, pools, subusers, and dns info.
Retrieve all ip pools**this endpoint allows you to get all of your ip pools.
Retrieve all ip pools an ip address belongs toThis endpoint checks which ip pools contain a specific ip, which may be shared across multiple ip pools and affect the ip's reputation based on collective usage for email sending.
Retrieve all ips currently in warmup**this endpoint allows you to retrieve all of your ip addresses that are currently warming up.
Retrieve all lists**this endpoint allows you to retrieve all of your recipient lists.
Retrieve all mail settingsRetrieve a paginated list of mail settings with their `enabled` status and descriptions.
Retrieve all of your event webhooksThe endpoint fetches all event webhooks as objects in an array, showing each webhook's configuration and id, used to update, delete, or manage signature verification and oauth settings.
Retrieve all parse settings**this endpoint allows you to retrieve all of your current inbound parse settings.
Retrieve all pending teammates**this endpoint allows you to retrieve a list of all pending teammate invitations.
Retrieve all recent access attempts**this endpoint allows you to retrieve a list of all of the ip addresses that recently attempted to access your account either through the user interface or the api.
Retrieve all recipients on a list**this endpoint allows you to retrieve all recipients on the list with the given id.
Retrieve all reverse dns recordsThe endpoint provides a paginated list of reverse dns records, with optional ip prefix search and adjustable page size using 'limit' and 'offset' parameters.
Retrieve all scheduled sendsThe endpoint provides details of cancelled or paused scheduled sends but only if they have a `batch id`.
Retrieve all segments**this endpoint allows you to retrieve all of your segments.
Retrieve all spam reportsRetrieve spam reports in pages using `limit` for page size and `offset` to continue from a specific list position.
Retrieve all suppression groups for an email addressRetrieve all suppression groups for an email address
Retrieve all suppressions**this endpoint allows you to retrieve a list of all suppressions.
Retrieve all suppressions for a suppression group**this endpoint allows you to retrieve all suppressed email addresses belonging to the given group.
Retrieve all teammatesRetrieve a paginated list of teammates with the `limit` parameter to set page size and `offset` to specify the starting point for additional items.
Retrieve all the ips in a specified pool**this endpoint allows you to get all of the ip addresses that are in a specific ip pool.
Retrieve an authenticated domain**this endpoint allows you to retrieve a specific authenticated domain.
Retrieve an existing api keyRetrieve an api key's details with its id via this endpoint.
Retrieve a reverse dns record**this endpoint allows you to retrieve a reverse dns record.
Retrieve a segment**this endpoint allows you to retrieve a single segment with the given id.
Retrieve a single campaign**this endpoint allows you to retrieve a specific campaign.
Retrieve a single list**this endpoint allows you to retrieve a single recipient list.
Retrieve a single recipient**this endpoint allows you to retrieve a single recipient by id from your contact database.
Retrieve a single transactional template**this endpoint allows you to retrieve a single transactional template.
Retrieve a specific alert**this endpoint allows you to retrieve a specific alert.
Retrieve a specific allowed ipThis endpoint retrieves an allowed ip for your account using its id, with ids obtainable from the endpoint listing currently allowed ips.
Retrieve a specific block**this endpoint allows you to retrieve a specific email address from your blocks list.
Retrieve a specific invalid email**this endpoint allows you to retrieve a specific invalid email addresses.
Retrieve a specific parse setting**this endpoint allows you to retrieve a specific inbound parse setting by hostname.
Retrieve a specific spam report**this endpoint allows you to retrieve a specific spam report by email address.
Retrieve a specific transactional template version**this endpoint allows you to retrieve a specific version of a template.
Retrieve a subuser s branded linkRetrieve a subuser's branded link, created and validated by the parent account, available through the api or twilio sendgrid's subuser management page.
Retrieve bounce classification totalsThis endpoint will return the total number of bounces by classification in descending order for each day.
Retrieve bounce purge mail settingsRetrieve and manage your bounce/purge settings for soft/hard bounce suppression lists with twilio sendgrid, either automatically or manually via the app/api.
Retrieve click track settingsThis endpoint retrieves your click tracking settings in sendgrid which tracks user engagement by redirecting and monitoring clicks on up to 1000 links per email.
Retrieve current enforced tls settingsThis endpoint retrieves enforced tls settings that mandate recipients to support tls 1.
Retrieve email statistics by browserRetrieve email stats by browser with advanced stats api, storing 7 days of data, and defaulting to 500 items per request.
Retrieve email statistics by client typeRetrieve email stats by client type with endpoint; stats stored for 7 days, 500 items per request.
Retrieve email statistics by country and state provinceRetrieve email statistics by country and state/province.
Retrieve email statistics by device typeRetrieve email stats by device type with a 7-day data retention limit.
Retrieve email statistics by mailbox providerRetrieve email stats by provider with advanced stats api, displaying details like location and device.
Retrieve email statistics for categories**this endpoint allows you to retrieve all of your email statistics for each of your categories.
Retrieve email statistics for your subusers**this endpoint allows you to retrieve the email statistics for the given subusers.
Retrieve footer mail settingsRetrieve and customize your footer settings for email bodies via this endpoint, directly or through twilio sendgrid's mail settings menu.
Retrieve forward bounce mail settingsThis endpoint fetches the current email forwarding settings for bounce messages, including the recipient email and whether the feature is active.
Retrieve forward spam mail settingsThis endpoint retrieves current forward spam settings, listing specified email addresses receiving spam reports and showing if the feature is active.
Retrieve global email statisticsRetrieve your global email stats within a specific date range, with parent accounts viewing their own or a subuser's aggregated data via the `on-behalf-of` header, while subusers see only their stats.
Retrieve google analytics settingsRetrieve your google analytics settings, which are set to google's recommended defaults, to understand user site activity.
Retrieve legacy template mail settingsThe endpoint retrieves settings for original email templates, with a guide for using and migrating from legacy to newer dynamic transactional templates.
Retrieve monthly stats for all subusersRetrieve monthly subuser email stats for a date range but can't sort by metrics like bounce drops, deferred, invalid emails, processed, spam reports, or unsubscribe drops.
Retrieve paged transactional templates**this endpoint allows you to retrieve all transactional templates.
Retrieve recipientsRetrieve all marketing campaign recipients via this endpoint.
Retrieve recipients on a segment**this endpoint allows you to retrieve all of the recipients in a segment with the given id.
Retrieve reserved fields**this endpoint allows you to list all fields that are reserved and can't be used for custom field names.
Retrieve scheduled send**this endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch id`.
Retrieves inbound parse webhook statisticsSendgrid's inbound parse webhook parses incoming emails, up to 30mb, and posts to a specified url, with available integrations listed in their library index.
Retrieve single segment endpoint**this endpoint allows you to retrieve a single segment by id.
Retrieve specific teammate**this endpoint allows you to retrieve a specific teammate by username.
Retrieve stats by a specific client typeUse advanced stats api to get email statistics by client type (e.
Retrieve subscription tracking settings**this endpoint allows you to retrieve your current settings for subscription tracking.
Retrieve subuser reputationsThis endpoint provides sender reputation scores for subusers, reflecting their email performance based on recipient responses and negative actions like bounces or spam reports.
Retrieve sums of email stats for each category**this endpoint allows you to retrieve the total sum of each email statistic for every category over the given date range.
Retrieve the count of billable recipientsThis endpoint provides the billable count of recipients for marketing campaigns, based on the highest number reached in your account.
Retrieve the default branded linkThe endpoint retrieves the default branded link for message sending, prioritizing user-set default, legacy, or sendgrid's default links.
Retrieve the lists that a recipient is on**this endpoint allows you to retrieve the lists that a given recipient belongs to.
Retrieve the warmup status for a specific ip addressRetrieve the warmup status for a specific ip address
Retrieve tracking settings**this endpoint allows you to retrieve a list of all tracking settings on your account.
Retrieve user s authenticated domainsThe api endpoint allows subusers to fetch up to five domains verified by the main account for sending emails, with a defined order of domain selection.
Retrieve your account email address**this endpoint allows you to retrieve the email address currently on file for your account.
Retrieve your credit balanceThis endpoint checks an account's base email sending credit balance, which affects per-email charges.
Retrieve your username**this endpoint allows you to retrieve your current account username.
Returns a list of all partner settingsRetrieve a paginated list of partner settings using the `limit` to set page size and `offset` to specify the starting point for additional items.
Schedule a campaignThis endpoint schedules campaign emails for a specific time, recommending off-peak times like 10:53 instead of on the hour to minimize server deferrals and enhance delivery rates.
Schedule single sendUse this endpoint to send a message right away by setting `send at` to `now`, or schedule it by specifying a future time in iso 8601 format (`yyyy-mm-ddthh:mm:ssz`).
Search contactsFind contacts using this endpoint with a body containing a `query` in sgql.
Search for suppressions within a group**this endpoint allows you to search a suppression group for multiple suppressions.
Search recipientsThis endpoint searches marketing campaigns recipients.
Segment json data by specific criteriaSearch json data for segments by specifying criteria for dates, text, and campaign ids using operators and boolean logic.
Send a campaign**this endpoint allows you to immediately send an existing campaign.
Send a test campaign**this endpoint allows you to send a test campaign.
Send a test marketing emailUse the endpoint to test marketing emails with a `template id` and up to 10 contacts.
Send email with twilio sendgridThe mail send operation uses sendgrid's v3 api to send emails.
Set up reverse dns**this endpoint allows you to set up reverse dns.
Singlesend csv stats retrievalExport single send stats in .
Start warming up an ip address**this endpoint allows you to put an ip address into warmup mode.
Stop warming up an ip addressThis endpoint removes an ip from warmup mode, returning a 204 code if successful.
Sumemailstatsforsubusers**this endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.
Test an event webhook s settingsThe endpoint tests event webhooks by sending a fake event to your url.
This request returns a single bulk email validation jobThis request returns a single bulk email validation job
Toggle signature verification for a single event webhook by idToggle signature verification for a single event webhook by id
Unlink subuser domainThe endpoint enables removal of an authenticated domain from subusers, each limited to five domains, to allow mail sending under a parent domain.
Unschedule a scheduled campaign**this endpoint allows you to unschedule a campaign that has already been scheduled to be sent.
Update a branded link**this endpoint allows you to update a specific branded link.
Update a campaign**this endpoint allows you to update a specific campaign.
Update account offeringsUpdates an account's package and attaches optional add-ons like marketing campaigns, dedicated ips, and expert services.
Update address whitelist mail settingsUpdate email whitelist settings by toggling `enabled`.
Update a list**this endpoint allows you to update the name of one of your recipient lists.
Update an account s stateUpdate the state of the specified account.
Update an alert**this endpoint allows you to update an alert.
Update an authenticated domain**this endpoint allows you to update the settings for an authenticated domain.
Update an ip pool nameThis operation will rename an ip pool.
Update an sso integration**this endpoint allows you to modify an exisiting sso integration.
Update a parse setting**this endpoint allows you to update a specific inbound parse setting by hostname.
Update api key name**this endpoint allows you to update the name of an existing api key.
Update api key name and scopesUpdate an api key's name and/or scopes using json with a `name` field and `scopes` array.
Update a scheduled campaign**this endpoint allows to you change the scheduled time and date for a campaign to be sent.
Update a scheduled sendUse this endpoint to change the status of a scheduled send by batch id.
Update a segment**this endpoint allows you to update a segment.
Update a senderThis endpoint updates an existing sender.
Update a sender identityThis api endpoint enables updates to sender identities.
Update a single event webhook by idUpdate event webhooks by id with this endpoint or without id to update the oldest one.
Update a suppression group**this endpoint allows you to update or change a suppression group.
Update a user s profile**this endpoint allows you to update your current profile details.
Update bounce purge mail settingsUpdate your bounce settings with twilio sendgrid to automatically delete contacts from suppression lists based on a set schedule in full days for both soft and hard email bounces.
Update click tracking settingsThis endpoint configures click tracking for emails, redirecting links through sendgrid or branded domains for engagement analysis, with a limit of 1000 links per email.
Update custom field definition**this endpoint allows you to update a defined custom field.
Update designThe design api enables partial design updates using patch requests, changing only specified fields, like the 'name' field, with no impact on other data.
Update details for an ip addressThe operation modifies an ip address's settings, such as auto warm-up status, parent account assignment, and active status.
Update enforced tls settingsUpdate tls settings through the endpoint by setting 'require tls' to 'true' for compulsory tls 1.
Update footer mail settingsThis endpoint updates your email footer settings, enabling a custom footer addition in text/html emails.
Update forward bounce mail settingsThis endpoint updates bounce forwarding mail settings, allowing users to set an email for bounce report forwards and configure spam mail forwarding in twilio sendgrid app.
Update forward spam mail settingsActivate forward spam to send spam reports to specified emails; supports multiple addresses and authenticating domains to receive abuse/postmaster mails.
Update google analytics settingsUpdate your google analytics settings to track user activity on your site more effectively; defaults follow google's recommendations.
UpdateintegrationThis endpoint updates an existing integration.
Update list**this endpoint updates the name of a list.
Update open tracking settingsUpdate your email settings to enable open tracking with sendgrid, which uses an invisible image to log email opens in various reports if the recipient allows images.
Update segmentSegment `name` has to be unique.
Update single sendUpdate single send drafts using its id via this endpoint; only changed properties are affected.
Update sso certificate**this endpoint allows you to update an existing certificate by id.
Update subscription tracking settings**this endpoint allows you to update your current settings for subscription tracking.
Update teammate s permissionsThis endpoint updates teammate permissions: set `is admin` to `true` for admin rights, otherwise to `false` with relevant scopes.
Update template mail settingsThe endpoint updates legacy email templates, replaced by more advanced dynamic transactional templates.
Update the credits for a subuser**this endpoint allows you to update the credits for a subuser.
Update the remaining credits for a subuser**this endpoint allows you to update the remaining credits for a subuser.
Update your account email address**this endpoint allows you to update the email address currently on file for your account.
Update your password**this endpoint allows you to update your password.
Update your username**this endpoint allows you to update the username for your account.
Validate a batch idValidate a mail batch id to get a `200` status code for a valid one, or a `400` code for an invalid.
Validate a branded link**this endpoint allows you to validate a branded link.
Validate a domain authentication**this endpoint allows you to validate an authenticated domain.
Validate an email**this endpoint allows you to validate an email address.
Validate a reverse dns recordEndpoint checks reverse dns record validity via `valid` in `validation results.
Verify sender request**this endpoint allows you to verify a sender requests.
View a sender identity**this endpoint allows you to retrieve a specific sender identity.
View scheduled time of a campaign**this endpoint allows you to retrieve the date and time that a campaign has been scheduled to be sent.

What is the Composio tool router, and how does it fit here?

What is Tool Router?

Composio's Tool Router helps agents find the right tools for a task at runtime. You can plug in multiple toolkits (like Gmail, HubSpot, and GitHub), and the agent will identify the relevant app and action to complete multi-step workflows. This can reduce token usage and improve the reliability of tool calls. Read more here: Getting started with Tool Router

The tool router generates a secure MCP URL that your agents can access to perform actions.

How the Tool Router works

The Tool Router follows a three-phase workflow:

  1. Discovery: Searches for tools matching your task and returns relevant toolkits with their details.
  2. Authentication: Checks for active connections. If missing, creates an auth config and returns a connection URL via Auth Link.
  3. Execution: Executes the action using the authenticated connection.

Step-by-step Guide

Prerequisites

Before you begin, make sure you have:
  • Python 3.8/Node 16 or higher installed
  • A Composio account with the API key
  • An OpenAI API key
  • A Sendgrid account and project
  • Basic familiarity with async Python/Typescript

Getting API Keys for OpenAI, Composio, and Sendgrid

OpenAI API key (OPENAI_API_KEY)
  • Go to the OpenAI dashboard
  • Create an API key if you don't have one
  • Assign it to OPENAI_API_KEY in .env
Composio API key and user ID
  • Log into the Composio dashboard
  • Copy your API key from Settings
    • Use this as COMPOSIO_API_KEY
  • Pick a stable user identifier (email or ID)
    • Use this as COMPOSIO_USER_ID

Installing dependencies

pip install composio-llamaindex llama-index llama-index-llms-openai llama-index-tools-mcp python-dotenv

Create a new Python project and install the necessary dependencies:

  • composio-llamaindex: Composio's LlamaIndex integration
  • llama-index: Core LlamaIndex framework
  • llama-index-llms-openai: OpenAI LLM integration
  • llama-index-tools-mcp: MCP client for LlamaIndex
  • python-dotenv: Environment variable management

Set environment variables

bash
OPENAI_API_KEY=your-openai-api-key
COMPOSIO_API_KEY=your-composio-api-key
COMPOSIO_USER_ID=your-user-id

Create a .env file in your project root:

These credentials will be used to:

  • Authenticate with OpenAI's GPT-5 model
  • Connect to Composio's Tool Router
  • Identify your Composio user session for Sendgrid access

Import modules

import asyncio
import os
import dotenv

from composio import Composio
from composio_llamaindex import LlamaIndexProvider
from llama_index.core.agent.workflow import ReActAgent
from llama_index.core.workflow import Context
from llama_index.llms.openai import OpenAI
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec

dotenv.load_dotenv()

Create a new file called sendgrid_llamaindex_agent.py and import the required modules:

Key imports:

  • asyncio: For async/await support
  • Composio: Main client for Composio services
  • LlamaIndexProvider: Adapts Composio tools for LlamaIndex
  • ReActAgent: LlamaIndex's reasoning and action agent
  • BasicMCPClient: Connects to MCP endpoints
  • McpToolSpec: Converts MCP tools to LlamaIndex format

Load environment variables and initialize Composio

OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
COMPOSIO_API_KEY = os.getenv("COMPOSIO_API_KEY")
COMPOSIO_USER_ID = os.getenv("COMPOSIO_USER_ID")

if not OPENAI_API_KEY:
    raise ValueError("OPENAI_API_KEY is not set in the environment")
if not COMPOSIO_API_KEY:
    raise ValueError("COMPOSIO_API_KEY is not set in the environment")
if not COMPOSIO_USER_ID:
    raise ValueError("COMPOSIO_USER_ID is not set in the environment")

What's happening:

This ensures missing credentials cause early, clear errors before the agent attempts to initialise.

Create a Tool Router session and build the agent function

async def build_agent() -> ReActAgent:
    composio_client = Composio(
        api_key=COMPOSIO_API_KEY,
        provider=LlamaIndexProvider(),
    )

    session = composio_client.create(
        user_id=COMPOSIO_USER_ID,
        toolkits=["sendgrid"],
    )

    mcp_url = session.mcp.url
    print(f"Composio MCP URL: {mcp_url}")

    mcp_client = BasicMCPClient(mcp_url, headers={"x-api-key": COMPOSIO_API_KEY})
    mcp_tool_spec = McpToolSpec(client=mcp_client)
    tools = await mcp_tool_spec.to_tool_list_async()

    llm = OpenAI(model="gpt-5")

    description = "An agent that uses Composio Tool Router MCP tools to perform Sendgrid actions."
    system_prompt = """
    You are a helpful assistant connected to Composio Tool Router.
    Use the available tools to answer user queries and perform Sendgrid actions.
    """
    return ReActAgent(tools=tools, llm=llm, description=description, system_prompt=system_prompt, verbose=True)

What's happening here:

  • We create a Composio client using your API key and configure it with the LlamaIndex provider
  • We then create a tool router MCP session for your user, specifying the toolkits we want to use (in this case, sendgrid)
  • The session returns an MCP HTTP endpoint URL that acts as a gateway to all your configured tools
  • LlamaIndex will connect to this endpoint to dynamically discover and use the available Sendgrid tools.
  • The MCP tools are mapped to LlamaIndex-compatible tools and plug them into the Agent.

Create an interactive chat loop

async def chat_loop(agent: ReActAgent) -> None:
    ctx = Context(agent)
    print("Type 'quit', 'exit', or Ctrl+C to stop.")

    while True:
        try:
            user_input = input("\nYou: ").strip()
        except (KeyboardInterrupt, EOFError):
            print("\nBye!")
            break

        if not user_input or user_input.lower() in {"quit", "exit"}:
            print("Bye!")
            break

        try:
            print("Agent: ", end="", flush=True)
            handler = agent.run(user_input, ctx=ctx)

            async for event in handler.stream_events():
                # Stream token-by-token from LLM responses
                if hasattr(event, "delta") and event.delta:
                    print(event.delta, end="", flush=True)
                # Show tool calls as they happen
                elif hasattr(event, "tool_name"):
                    print(f"\n[Using tool: {event.tool_name}]", flush=True)

            # Get final response
            response = await handler
            print()  # Newline after streaming
        except KeyboardInterrupt:
            print("\n[Interrupted]")
            continue
        except Exception as e:
            print(f"\nError: {e}")

What's happening here:

  • We're creating a direct terminal interface to chat with your Sendgrid database
  • The LLM's responses are streamed to the CLI for faster interaction.
  • The agent uses context to maintain conversation history
  • You can type 'quit' or 'exit' to stop the chat loop gracefully
  • Agent responses and any errors are displayed in a clear, readable format

Define the main entry point

async def main() -> None:
    agent = await build_agent()
    await chat_loop(agent)

if __name__ == "__main__":
    # Handle Ctrl+C gracefully
    signal.signal(signal.SIGINT, lambda s, f: (print("\nBye!"), exit(0)))
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        print("\nBye!")

What's happening here:

  • We're orchestrating the entire application flow
  • The agent gets built with proper error handling
  • Then we kick off the interactive chat loop so you can start talking to Sendgrid

Run the agent

npx ts-node llamaindex-agent.ts

When prompted, authenticate and authorise your agent with Sendgrid, then start asking questions.

Complete Code

Here's the complete code to get you started with Sendgrid and LlamaIndex:

import asyncio
import os
import signal
import dotenv

from composio import Composio
from composio_llamaindex import LlamaIndexProvider
from llama_index.core.agent.workflow import ReActAgent
from llama_index.core.workflow import Context
from llama_index.llms.openai import OpenAI
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec

dotenv.load_dotenv()

OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
COMPOSIO_API_KEY = os.getenv("COMPOSIO_API_KEY")
COMPOSIO_USER_ID = os.getenv("COMPOSIO_USER_ID")

if not OPENAI_API_KEY:
    raise ValueError("OPENAI_API_KEY is not set")
if not COMPOSIO_API_KEY:
    raise ValueError("COMPOSIO_API_KEY is not set")
if not COMPOSIO_USER_ID:
    raise ValueError("COMPOSIO_USER_ID is not set")

async def build_agent() -> ReActAgent:
    composio_client = Composio(
        api_key=COMPOSIO_API_KEY,
        provider=LlamaIndexProvider(),
    )

    session = composio_client.create(
        user_id=COMPOSIO_USER_ID,
        toolkits=["sendgrid"],
    )

    mcp_url = session.mcp.url
    print(f"Composio MCP URL: {mcp_url}")

    mcp_client = BasicMCPClient(mcp_url, headers={"x-api-key": COMPOSIO_API_KEY})
    mcp_tool_spec = McpToolSpec(client=mcp_client)
    tools = await mcp_tool_spec.to_tool_list_async()

    llm = OpenAI(model="gpt-5")
    description = "An agent that uses Composio Tool Router MCP tools to perform Sendgrid actions."
    system_prompt = """
    You are a helpful assistant connected to Composio Tool Router.
    Use the available tools to answer user queries and perform Sendgrid actions.
    """
    return ReActAgent(
        tools=tools,
        llm=llm,
        description=description,
        system_prompt=system_prompt,
        verbose=True,
    );

async def chat_loop(agent: ReActAgent) -> None:
    ctx = Context(agent)
    print("Type 'quit', 'exit', or Ctrl+C to stop.")

    while True:
        try:
            user_input = input("\nYou: ").strip()
        except (KeyboardInterrupt, EOFError):
            print("\nBye!")
            break

        if not user_input or user_input.lower() in {"quit", "exit"}:
            print("Bye!")
            break

        try:
            print("Agent: ", end="", flush=True)
            handler = agent.run(user_input, ctx=ctx)

            async for event in handler.stream_events():
                # Stream token-by-token from LLM responses
                if hasattr(event, "delta") and event.delta:
                    print(event.delta, end="", flush=True)
                # Show tool calls as they happen
                elif hasattr(event, "tool_name"):
                    print(f"\n[Using tool: {event.tool_name}]", flush=True)

            # Get final response
            response = await handler
            print()  # Newline after streaming
        except KeyboardInterrupt:
            print("\n[Interrupted]")
            continue
        except Exception as e:
            print(f"\nError: {e}")

async def main() -> None:
    agent = await build_agent()
    await chat_loop(agent)

if __name__ == "__main__":
    # Handle Ctrl+C gracefully
    signal.signal(signal.SIGINT, lambda s, f: (print("\nBye!"), exit(0)))
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        print("\nBye!")

Conclusion

You've successfully connected Sendgrid to LlamaIndex through Composio's Tool Router MCP layer. Key takeaways:
  • Tool Router dynamically exposes Sendgrid tools through an MCP endpoint
  • LlamaIndex's ReActAgent handles reasoning and orchestration; Composio handles integrations
  • The agent becomes more capable without increasing prompt size
  • Async Python provides clean, efficient execution of agent workflows
You can easily extend this to other toolkits like Gmail, Notion, Stripe, GitHub, and more by adding them to the toolkits parameter.

How to build Sendgrid MCP Agent with another framework

FAQ

What are the differences in Tool Router MCP and Sendgrid MCP?

With a standalone Sendgrid MCP server, the agents and LLMs can only access a fixed set of Sendgrid tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Sendgrid and many other apps based on the task at hand, all through a single MCP endpoint.

Can I use Tool Router MCP with LlamaIndex?

Yes, you can. LlamaIndex fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Sendgrid tools.

Can I manage the permissions and scopes for Sendgrid while using Tool Router?

Yes, absolutely. You can configure which Sendgrid scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

How safe is my data with Composio Tool Router?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Sendgrid data and credentials are handled as safely as possible.

Used by agents from

Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai

Never worry about agent reliability

We handle tool reliability, observability, and security so you never have to second-guess an agent action.