Twilio SendGrid ACTION
Create Send
Create a single send. See the docs here
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Twilio SendGrid account once, then configure and run Create Send from your backend or agent.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "sendgrid-create-send",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
sendgrid: { authProvisionId: "apn_xxxxxxx" },
name: "Name",
categoryIds: ["Categories"],
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "sendgrid-create-send",
"configured_props": {
"sendgrid": { "authProvisionId": "apn_xxxxxxx" },
"name": "Name",
"categoryIds": ["Categories"]
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "sendgrid",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "sendgrid-create-send",
arguments: {
name: "Name",
categoryIds: ["Categories"],
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
name Name | string | The name of the Single Send. Required |
categoryIds Categories | string[] | The categories to associate with this Single Send. Optional Dynamic |
sendAt Send At | string | Set this property to an ISO 8601 formatted date-time (YYYY-MM-DDTHH:MM:SSZ) when you would like to send the Single Send. Please note that any send_at property value set with this endpoint will prepopulate the send date in the SendGrid user interface (UI). However, the Single Send will remain an unscheduled draft until it's updated with the Schedule Single Send endpoint or SendGrid application UI. Setting this property to now with this endpoint will cause an error. Optional |
listIds List Ids | string[] | The recipient List IDs that will receive the Single Send. Optional Dynamic |
segmentIds Segment Ids | string[] | The recipient Segment IDs that will receive the Single Send. Optional Dynamic |
all All | boolean | Set to true to send to All Contacts. If set to false, at least one List Ids or Segment Ids value must be provided before the Single Send is scheduled to be sent to recipients. Required |
subject Subject | string | The subject line of the Single Send. Do not include this field when using a Design Id. Optional |
htmlContent HTML Content | string | The HTML content of the Single Send. Do not include this field when using a Design Id. Optional |
plainContent Plain Content | string | The plain text content of the Single Send. Do not include this field when using a Design Id. Optional |
generatePlainContent Generate Plain Content | boolean | If set to true, Plain Content is always generated from HTML Content. If set to false, Plain Content is not altered. Optional |
designId Design Id | string | A design id can be used in place of HTML Content, Plain Content, and/or Subject. Optional Dynamic |
editor Editor | string | The editor is used to modify the Single Send's design in the Marketing Campaigns App. Optional |
suppressionGroupId ASM Group ID | integer | Advanced Suppression Manager Group ID. The unsubscribe group to associate with this email. Will override the value set in the asm param if also set Optional Dynamic |
customUnsubscribeUrl Custom Unsubscribe URL | string | The URL allowing recipients to unsubscribe — you must provide this or the Suppression Group Id. Optional |
senderId Sender Id | string | The ID of the verified Sender. Optional Dynamic |
ipPool IP Pool | string | The name of the IP Pool from which the Single Send emails are sent. Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- sendgrid-create-send
- Version
- 0.0.3
- App
- Twilio SendGrid
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗