Twist ACTION
Add Thread
Adds a new thread to a channel. See the documentation
- Action
- Writes data
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Twist account once, then configure and run Add Thread 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: "twist-add-thread",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
twist: { authProvisionId: "apn_xxxxxxx" },
channel_id: "Channel id",
content: "Content",
},
})
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": "twist-add-thread",
"configured_props": {
"twist": { "authProvisionId": "apn_xxxxxxx" },
"channel_id": "Channel id",
"content": "Content"
}
}'// 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": "twist",
},
},
},
)
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: "twist-add-thread",
arguments: {
channel_id: "Channel id",
content: "Content",
},
})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 |
|---|---|---|
channel_id Channel id | string | The id of the channel where the thread will be created. Required |
content Content | string | The content of the new thread. Mentions can be used as [Name](twist-mention://user_id) for users or [Group name](twist-group-mention://group_id) for groups. Check limits for size restrictions for the content. Required |
title Title | string | The title of the new thread. Required |
actions Actions | string[] | List of action buttons to add. Each item must be a JSON string, e.g. {"action":"open_url","type":"action","button_text":"View","url":"https://example.com"}. See the action button submenu. Optional |
attachments Attachments | string[] | List of attachments to add. Each item must be a JSON string following the format returned by attachment#upload. Optional |
direct_mentions Direct Mentions | integer[] | The users that are directly mentioned. Optional |
direct_group_mentions Direct Group Mentions | integer[] | The groups that are directly mentioned. Optional |
recipients Recipients | string[] | The users that will be attached to the thread, as user IDs (e.g. 10000, 10001). Also accepts the single value EVERYONE, which notifies everyone in the workspace. If not included, defaults to the user_ids of the target channel. If you specify an empty list, no Twist users will be notified and the thread creator becomes the sole participant. Optional |
groups Groups | integer[] | The groups that will be notified. Optional |
temp_id Temp id | string | The temporary id of the thread. Optional |
send_as_integration Send as integration | boolean | Displays the integration as the thread creator. 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
- twist-add-thread
- Version
- 1.0.0
- App
- Twist
- Authentication
- OAuth
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗