Slack ACTION
List Channels
Return a list of channels in a workspace. Pass
fields (e.g. ["id","name"]) to limit the returned properties — a full channel object is ~1KB, so a workspace of any real size can return a payload large enough to be truncated. Omit fields when you need the complete channel objects. Use namePrefix to filter results to channels whose names start with a given string (e.g. dev-) without a client-side filter loop. Set memberOnly: true to return only channels the authenticated user is a member of — on a large workspace this shrinks the result from thousands of channels to the handful that matter, and it is usually what you want when acting on the user's behalf. Returns has_more: true and next_cursor when more channels exist than were fetched — when you see that, raise numPages (or pass cursor) before answering any 'how many' or 'list every' question, otherwise your answer is silently incomplete. See the documentation- Action
- Read only
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Slack account once, then configure and run List Channels 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-list-channels",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
slack_v2: { authProvisionId: "apn_xxxxxxx" },
channelTypes: "Channel Types",
memberOnly: true,
},
})
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-list-channels",
"configured_props": {
"slack_v2": { "authProvisionId": "apn_xxxxxxx" },
"channelTypes": "Channel Types",
"memberOnly": true
}
}'// 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-list-channels",
arguments: {
channelTypes: "Channel Types",
memberOnly: true,
},
})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 |
|---|---|---|
channelTypes Channel Types | string | Which channel types to list. Pass public_channel for public channels only, private_channel for private channels only, or public_channel,private_channel for both (default). Optional |
memberOnly Member Channels Only | boolean | Return only channels the authenticated user is a member of (uses users.conversations instead of conversations.list). Recommended for large workspaces: the full channel list can run to thousands of entries, while the user's own channels are usually a small fraction of that. Channel Types, Fields, Name Prefix, and pagination all still apply. Optional |
fields Fields | string[] | Channel properties to return, e.g. id, name, is_private, is_archived, num_members, topic, purpose, created. Strongly recommended: ["id", "name"] is enough for almost every task and keeps the response small. Omit ONLY when you genuinely need the full channel objects — the response is then ~1KB per channel and may be truncated. Optional |
pageSize Page Size | integer | The number of results to include in a page. Default: 250 Optional |
numPages Number of Pages | integer | The number of pages to retrieve. Default: 1 Optional |
cursor Cursor | string | Resume from a previous call's next_cursor to fetch the following page. Optional |
namePrefix Name Prefix | string | Return only channels whose names start with this prefix (case-insensitive). Example: dev-. When set, ALL pages are fetched regardless of Number of Pages so the filter is applied across the full workspace channel list. 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-list-channels
- Version
- 0.4.0
- App
- Slack
- Authentication
- OAuth
- Read-only
- Yes
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗