{"id":48632656,"url":"https://github.com/vercel/slack-tools","last_synced_at":"2026-04-09T06:01:08.291Z","repository":{"id":340897492,"uuid":"1168144060","full_name":"vercel/slack-tools","owner":"vercel","description":"Slack tools for the Vercel AI SDK. Give your AI agents the ability to read, post, and interact in Slack.","archived":false,"fork":false,"pushed_at":"2026-03-12T14:11:33.000Z","size":112,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-08T17:15:29.514Z","etag":null,"topics":["ai","ai-sdk","javascript","react","slack","vercel"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/slack-tools","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vercel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-27T03:57:22.000Z","updated_at":"2026-04-07T13:31:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"f40b9525-f849-4ecf-8a91-230e84612087","html_url":"https://github.com/vercel/slack-tools","commit_stats":null,"previous_names":["malewis5/slack-tools"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/vercel/slack-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel%2Fslack-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel%2Fslack-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel%2Fslack-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel%2Fslack-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vercel","download_url":"https://codeload.github.com/vercel/slack-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel%2Fslack-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31588038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-09T05:33:47.836Z","status":"ssl_error","status_checked_at":"2026-04-09T05:32:26.579Z","response_time":112,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-sdk","javascript","react","slack","vercel"],"created_at":"2026-04-09T06:00:35.861Z","updated_at":"2026-04-09T06:01:08.275Z","avatar_url":"https://github.com/vercel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slack-tools\n\n[![npm version](https://img.shields.io/npm/v/slack-tools)](https://www.npmjs.com/package/slack-tools)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)\n\n[AI SDK](https://ai-sdk.dev) tools for [Slack](https://api.slack.com). Typed, structured tool calls for AI agents. No MCP transport required.\n\n## Installation\n\n```shell\nnpm install slack-tools\n# or\nyarn add slack-tools\n# or\npnpm add slack-tools\n# or\nbun add slack-tools\n```\n\n## Quick Start\n\n```ts\nimport { generateText } from \"ai\";\nimport { createSlackTools } from \"slack-tools\";\n\nconst tools = createSlackTools(process.env.SLACK_USER_TOKEN);\n\nconst { text } = await generateText({\n  model: \"anthropic/claude-sonnet-4-5\",\n  tools,\n  prompt: \"Search for messages about the Q1 roadmap in #general\",\n});\n```\n\nThe model string uses the [Vercel AI Gateway](https://vercel.com/docs/ai-gateway), which provides access to OpenAI, Anthropic, Google, and other providers through a single API.\n\n## API Reference\n\n### createSlackTools\n\nReturns all available Slack tools, ready to pass to `generateText`, `streamText`, or any AI SDK agent.\n\n```ts\nimport { createSlackTools } from \"slack-tools\";\n\nconst tools = createSlackTools(process.env.SLACK_USER_TOKEN);\n```\n\n#### Parameters\n\n| Name | Type | Required | Description |\n|---|---|---|---|\n| `slackToken` | `string` | Yes | A Slack user OAuth token (`xoxp-...`) with the required scopes. |\n| `options` | `CreateSlackToolsOptions` | No | Configuration options (see below). |\n\n#### Options\n\n| Name | Type | Default | Description |\n|---|---|---|---|\n| `needsApproval` | `boolean \\| SlackToolName[]` | `undefined` | Controls which tools require human approval before execution. Pass `true` to require approval for all tools, or an array of tool names for selective approval. |\n\n```ts\n// Require approval for all tools\nconst tools = createSlackTools(process.env.SLACK_USER_TOKEN, {\n  needsApproval: true,\n});\n\n// Require approval only for write operations\nconst tools = createSlackTools(process.env.SLACK_USER_TOKEN, {\n  needsApproval: [\n    \"slack_send_message\",\n    \"slack_schedule_message\",\n    \"slack_create_canvas\",\n    \"slack_join_channel\",\n    \"slack_delete_message\",\n  ],\n});\n```\n\n#### Returns\n\nAn object containing the following tools:\n\n| Tool | Description |\n|---|---|\n| `slack_send_message` | Send a message to a channel or user. |\n| `slack_schedule_message` | Schedule a message for future delivery. |\n| `slack_create_canvas` | Create a new Slack Canvas document. |\n| `slack_search_public` | Search messages in public channels. |\n| `slack_search_public_and_private` | Search messages across all channels (public, private, DMs). |\n| `slack_search_channels` | Find channels by name, topic, or purpose. |\n| `slack_search_users` | Find users by name, email, or title. |\n| `slack_read_channel` | Read message history from a channel. |\n| `slack_read_thread` | Read a thread (parent message and replies). |\n| `slack_read_user_profile` | Get detailed profile information for a user. |\n| `slack_join_channel` | Join a public channel on behalf of the bot/agent. |\n| `slack_delete_message` | Delete a message previously sent by the bot/agent. |\n\nEach tool includes `inputSchema`, `outputSchema`, `execute`, and `toModelOutput`.\n\n## Required Scopes\n\nYour Slack app needs the following user token scopes:\n\n`chat:write`, `canvases:read`, `canvases:write`, `channels:history`, `channels:join`, `groups:history`, `im:history`, `mpim:history`, `search:read.public`, `search:read.private`, `search:read.mpim`, `search:read.im`, `search:read.files`, `search:read.users`, `users:read`, `users:read.email`\n\n## Comparison with Slack MCP\n\nThis package was built by running each tool against the [Slack MCP server](https://api.slack.com/docs/mcp) and comparing responses side-by-side. The goal was to match the MCP's behavior as closely as the public Slack API allows.\n\n| Tool | slack-tools | Slack MCP | Notes |\n|---|---|---|---|\n| Send message | ✅ | ✅ | Equivalent output |\n| Schedule message | ✅ | ✅ | Equivalent output |\n| Create canvas | ✅ | ✅ | Equivalent output |\n| Search public messages | ✅ | ✅ | MCP includes message context and reply counts via internal APIs |\n| Search all messages | ✅ | ✅ | Same as above |\n| Search channels | ✅ | ✅ | MCP includes channel permalinks |\n| Search users | ✅ | ✅ | Equivalent output including profile permalinks |\n| Read channel | ✅ | ✅ | Equivalent output |\n| Read thread | ✅ | ✅ | Equivalent output |\n| Read user profile | ✅ | ✅ | Equivalent output |\n| Join channel | ✅ | ❌ | Not available in Slack MCP |\n| Delete message | ✅ | ❌ | Not available in Slack MCP |\n| Read canvas | ❌ | ✅ | Slack's public API does not support reading canvas content |\n| Send message draft | ❌ | ✅ | `chat.draft` is not available in the public Slack Web API |\n\nThe MCP returns all results as stringified text inside `content[0].text`. This package returns typed objects from `execute` and provides `toModelOutput` for model-friendly text formatting, making it easy to programmatically compose follow-up actions from tool results.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Support\n\nFor issues and questions:\n\n- Check the [AI SDK documentation](https://ai-sdk.dev)\n- Review the [Slack Web API documentation](https://api.slack.com/web)\n- [Open an issue](https://github.com/malewis5/slack-tools/issues) in this repository\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvercel%2Fslack-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvercel%2Fslack-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvercel%2Fslack-tools/lists"}