Slack ACTION
Build and Send a Block Kit Message
- Action
- Writes data
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Slack account once, then configure and run Build and Send a Block Kit Message 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: "slack_v2-send-block-kit-message",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
slack_v2: { authProvisionId: "apn_xxxxxxx" },
conversation: "Channel",
text: "Notification Text",
},
})
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": "slack_v2-send-block-kit-message",
"configured_props": {
"slack_v2": { "authProvisionId": "apn_xxxxxxx" },
"conversation": "Channel",
"text": "Notification Text"
}
}'// 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": "slack_v2",
},
},
},
)
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: "slack_v2-send-block-kit-message",
arguments: {
conversation: "Channel",
text: "Notification Text",
},
})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 |
|---|---|---|
conversation Channel | string | Prefer a channel ID (e.g. C1234567890) — use List Channels to look it up; it resolves instantly. A channel NAME (e.g. general or #general) is also accepted, but resolving it scans up to 5 conversations.list pages (~5,000 channels), which is slow and, on large workspaces, can be rate-limited or fail with a ConfigurationError if the channel is beyond that bound — pass the ID whenever you have it. Depending on the action, this may also accept a user ID (opens a direct message) or a group DM ID — use Find User by Email / Find User by ID to resolve a user ID, or List Group Conversations for group DM IDs. Required |
text Notification Text | string | Optionally provide a string for Slack to display as the new message notification (if you do not provide this, notification will be blank). Optional |
as_user Send as User | boolean | Optionally pass true to post the message as the authenticated user, instead of as a bot. Defaults to false. Optional |
addToChannel Add app to channel automatically? | boolean | If true, the app will be added to the specified non-DM channel(s) automatically. If false, you must add the app to the channel manually to post to a private channel as a bot. Defaults to false. Required |
post_at Schedule message | string | Messages can only be scheduled up to 120 days in advance, and cannot be scheduled for the past. The datetime should be in ISO 8601 format. (Example: 2014-01-01T00:00:00Z) Optional |
include_sent_via_pipedream_flag Include link to Pipedream | boolean | Defaults to true, includes a link to Pipedream at the end of your Slack message. Optional |
username Bot Username | string | Optionally customize your bot's user name (default is Pipedream). Must be used in conjunction with Send as User set to false, otherwise ignored. Optional |
icon_emoji Icon (emoji) | string | Optionally provide an emoji to use as the icon for this message, wrapped in colons. E.g., :fire:. Overrides icon_url. Must be used in conjunction with Send as User set to false, otherwise ignored. Use List Icon (emoji) Options to look up valid emoji names for this workspace, including custom emoji. Optional |
icon_url Icon (image URL) | string | Optionally provide an image URL to use as the icon for this message. Must be used in conjunction with Send as User set to false, otherwise ignored. Optional |
thread_ts Message Timestamp | string | Provide another message's ts value to make this message a reply (e.g., if triggering on new Slack messages, enter {{event.ts}}). Avoid using a reply's ts value; use its parent instead. e.g. 1403051575.000407. Optional |
thread_broadcast Send Channel Message | boolean | If true, posts in the thread and channel. Used in conjunction with Message Timestamp and indicates whether reply should be made visible to everyone in the channel. Defaults to false. Optional |
metadata_event_type Metadata Event Type | string | The name of the metadata event. Example: task_created Optional |
metadata_event_payload Metadata Event Payload | string | The payload of the metadata event. Must be a JSON string. Example: { "id": "11223", "title": "Redesign Homepage"} Optional |
unfurl_links Unfurl Links | boolean | Default to false. Pass true to enable unfurling of links. Optional |
unfurl_media Unfurl Media | boolean | Defaults to false. Pass true to enable unfurling of media content. Optional |
passArrayOrConfigure Add Blocks - Reference Existing Blocks Array or Configure Manually? | string | Would you like to reference an array of blocks from a previous step (for example, {{steps.blocks.$return_value}}), or configure them in this action? Optional |
blocks Blocks | string | Enter an array of structured blocks as a URL-encoded string. E.g., Tip: Construct your blocks in a code step, return them as an array, and then pass the return value to this step. Optional |
section1 Section Block 1 | string | Add a section block to your message and configure with plain text or mrkdwn. See Slack's docs for more info. Optional |
section2 Section Block 2 | string | Add a section block to your message and configure with plain text or mrkdwn. See Slack's docs for more info. Optional |
section3 Section Block 3 | string | Add a section block to your message and configure with plain text or mrkdwn. See Slack's docs for more info. Optional |
section4 Section Block 4 | string | Add a section block to your message and configure with plain text or mrkdwn. See Slack's docs for more info. Optional |
section5 Section Block 5 | string | Add a section block to your message and configure with plain text or mrkdwn. See Slack's docs for more info. Optional |
context1 Context Block 1 | string[] | Add a context block to your message and configure with plain text or mrkdwn. Define multiple items if you'd like multiple elements in the context block. See Slack's docs for more info. Optional |
context2 Context Block 2 | string[] | Add a context block to your message and configure with plain text or mrkdwn. Define multiple items if you'd like multiple elements in the context block. See Slack's docs for more info. Optional |
context3 Context Block 3 | string[] | Add a context block to your message and configure with plain text or mrkdwn. Define multiple items if you'd like multiple elements in the context block. See Slack's docs for more info. Optional |
context4 Context Block 4 | string[] | Add a context block to your message and configure with plain text or mrkdwn. Define multiple items if you'd like multiple elements in the context block. See Slack's docs for more info. Optional |
context5 Context Block 5 | string[] | Add a context block to your message and configure with plain text or mrkdwn. Define multiple items if you'd like multiple elements in the context block. See Slack's docs for more info. Optional |
linkButton1 Link Button 1 | object | Add a link button to your message. Enter the button text as the key and the link URL as the value. Example: {"View docs": "https://example.com", "Open dashboard": "https://app.example.com"}. Configure multiple buttons in the object to render them inline, or add additional Link Button blocks to render them vertically. See Slack's docs for more info. Optional |
linkButton2 Link Button 2 | object | Add a link button to your message. Enter the button text as the key and the link URL as the value. Example: {"View docs": "https://example.com", "Open dashboard": "https://app.example.com"}. Configure multiple buttons in the object to render them inline, or add additional Link Button blocks to render them vertically. See Slack's docs for more info. Optional |
linkButton3 Link Button 3 | object | Add a link button to your message. Enter the button text as the key and the link URL as the value. Example: {"View docs": "https://example.com", "Open dashboard": "https://app.example.com"}. Configure multiple buttons in the object to render them inline, or add additional Link Button blocks to render them vertically. See Slack's docs for more info. Optional |
linkButton4 Link Button 4 | object | Add a link button to your message. Enter the button text as the key and the link URL as the value. Example: {"View docs": "https://example.com", "Open dashboard": "https://app.example.com"}. Configure multiple buttons in the object to render them inline, or add additional Link Button blocks to render them vertically. See Slack's docs for more info. Optional |
linkButton5 Link Button 5 | object | Add a link button to your message. Enter the button text as the key and the link URL as the value. Example: {"View docs": "https://example.com", "Open dashboard": "https://app.example.com"}. Configure multiple buttons in the object to render them inline, or add additional Link Button blocks to render them vertically. See Slack's docs for more info. 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
- slack_v2-send-block-kit-message
- Version
- 0.5.11
- App
- Slack
- Authentication
- OAuth
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗