Bot for Slack ACTION
Send Message Using Block Kit
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Bot for Slack account once, then configure and run Send Message Using Block Kit 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_bot-send-block-kit-message",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
slack_bot: { authProvisionId: "apn_xxxxxxx" },
username: "Bot Username",
icon_emoji: "Icon (emoji)",
},
})
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_bot-send-block-kit-message",
"configured_props": {
"slack_bot": { "authProvisionId": "apn_xxxxxxx" },
"username": "Bot Username",
"icon_emoji": "Icon (emoji)"
}
}'// 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_bot",
},
},
},
)
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_bot-send-block-kit-message",
arguments: {
username: "Bot Username",
icon_emoji: "Icon (emoji)",
},
})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 |
|---|---|---|
username Bot Username | string | Optionally customize your bot's user name (default is Pipedream). Must be used in conjunction with 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. E.g., :fire: Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. Optional Dynamic |
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 as_user set to false, otherwise ignored. Optional |
post_at Schedule message | integer | Messages can only be scheduled up to 120 days in advance, and cannot be scheduled for the past. The datetime format should be a unix timestamp (e.g., 1650507616, see here for help with this format). Optional |
include_sent_via_pipedream_flag Include link to workflow | boolean | Defaults to true, includes a link to the workflow at the end of your Slack message. Optional |
metadata_event_type Metadata Event Type | string | The name of the metadata event Optional |
metadata_event_payload Metadata Event Payload | string | The payload of the metadata event. Must be a JSON string e.g. {"key": "value"} Optional |
conversation Channel | string | Select a public or private channel, or a user or group Required Dynamic |
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. 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 |
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_bot-send-block-kit-message
- Version
- 0.0.2
- App
- Bot for Slack
- Authentication
- API key
- Behavior
- May modify external data
- Source
- View on GitHub ↗