Skip to content

feat(slack): add web search to Slack bot agent#1100

Merged
saddlepaddle merged 1 commit intomainfrom
add-browser-search-to-slack-integration-via-mcp
Feb 1, 2026
Merged

feat(slack): add web search to Slack bot agent#1100
saddlepaddle merged 1 commit intomainfrom
add-browser-search-to-slack-integration-via-mcp

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Feb 1, 2026

Summary

  • Add Claude's built-in web_search_20250305 server tool to the Slack bot agent, giving it the ability to search the web when answering questions
  • Handle pause_turn stop reason in the agent loop for long-running server-side tool execution
  • Update system prompt to guide the agent on when to search and to cite sources

Details

Uses Claude's native server-side web search — the Anthropic API executes searches automatically. No external API keys, no new dependencies, no new files. Just 26 lines added to run-agent.ts.

The tool is capped at max_uses: 3 per request to control costs ($10/1000 searches).

Prerequisite

Web search must be enabled in the Anthropic Console organization settings (Settings > Privacy).

Test plan

  • Verify typecheck passes (bun run typecheck --filter=@superset/api)
  • Verify lint passes (bun run lint)
  • Verify tests pass (bun test)
  • @mention the Slack bot with a question requiring current info (e.g. "what's the latest version of Next.js?") and confirm it searches and cites sources
  • @mention the bot with a task management question and confirm existing MCP tools still work
  • Confirm pause_turn handling works by testing with a query that triggers multiple searches

Summary by CodeRabbit

  • New Features
    • Web search tool integration added to Slack agent workflow
    • Pause and resume capability for long-running agent operations
    • System prompt updated to handle web search and source citations

✏️ Tip: You can customize this high-level summary in your review settings.

Use Claude's built-in web_search_20250305 server tool to give the Slack
bot web search capability. The API handles search execution server-side,
so no external API keys or dependencies are needed. Also handle the
pause_turn stop reason for long-running server-side tool execution.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 1, 2026

📝 Walkthrough

Walkthrough

This change adds a web_search tool to the Slack agent workflow and introduces pause_turn handling to support pausing and resuming long-running server-side turns. The tool type signature was updated from Anthropic.Tool[] to Anthropic.Messages.ToolUnion[] to accommodate the new web_search tool, which includes a max_uses limit of 3.

Changes

Cohort / File(s) Summary
Slack Agent Tool Integration
apps/api/src/app/api/integrations/slack/events/utils/run-agent/run-agent.ts
Added web_search tool (type: "web_search_20250305", max_uses: 3) to agent's available tools. Extended system prompt to reference web_search usage and source citation. Updated tools variable type to Anthropic.Messages.ToolUnion[]. Introduced pause_turn handler in tool-processing loop to pause long-running turns and resume with updated messages and context. Modified iteration termination condition to account for both tool_use and pause_turn.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A web_search tool hops into view,
With pauses that let the agent break through,
Three searches max, then back to the dance,
The turn can resume with newfound chance!
Anthropic's tools now work in harmony—
What a delightful change, don't you see? ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: adding web search functionality to the Slack bot agent.
Description check ✅ Passed The PR description covers all required template sections with comprehensive details about the changes, implementation approach, and testing plan.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-browser-search-to-slack-integration-via-mcp

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 1, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch
  • ✅ Electric Fly.io app

Thank you for your contribution! 🎉

@saddlepaddle saddlepaddle merged commit c1c13ec into main Feb 1, 2026
13 checks passed
@Kitenite Kitenite deleted the add-browser-search-to-slack-integration-via-mcp branch February 1, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant