Repository navigation
feat(methods): add assistant.search.context method example - #141
Merged
Merged
Conversation
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
This was referenced Nov 19, 2026
Merged
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
zimeg
marked this pull request as ready for review
November 20, 2026 10:01
cchensh
approved these changes
Nov 20, 2026
cchensh
left a comment
There was a problem hiding this comment.
LGTM. One nit: channel_types includes private_channel, mpim and im, but the manifest only grants bot scopes, and bot tokens can only hold search:read.public / .files / .users. So with the app's bot token plus an action_token this likely returns missing_scope. Either narrow channel_types to ["public_channel"] for the bot path, or add the user search scopes (search:read.public, .private, .im, .mpim, .files, .users) to the manifest. Also heads-up: the icon, managed-permissions and search PRs each add a section after ### agents in the README, so whichever merges second will need a rebase.
Member
Author
|
🌟 Thanks for the kind review @cchensh! The search.context example is a fun one to finally see in java ☕ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds a method example for
assistant.search.contextinmethods/src/main/java/assistant/search/AssistantSearchContext.java, and lists it inmethods/README.md.keywords_clausesfrom that payload is left out: it isn't in the page's Arguments list, and the API ignores it.action_tokenis added with the page's example value, since every call with a bot token needs one.assistant/search/manifest.jsonwith the bot scopes this folder's methods need.This is part 1 of 2 in a stack that adds the
assistant.searchmethod examples one at a time. Each pull request builds on the one before it and merges on its own, bottom to top.assistant.search.context👈 this pull requestassistant.search.infoDependency
This depends on slackapi/java-slack-sdk#1594, which adds
assistantSearchContexttoslack-api-client. It shipped inslack-api-client1.56.0, whichmethods/pom.xmlnow pins.Testing
With slackapi/java-slack-sdk#1594 installed locally (
./scripts/install_local.sh) and the pin pointed at that snapshot:cd methodsandexport SLACK_TOKEN=...with the app's bot token.mvn compile exec:java -Dexec.mainClass=assistant.search.AssistantSearchContextand check the response. Replace the exampleaction_tokenwith one from a message event to seeok.With the example value, the call returns
invalid_action_token, so the rest of the payload is accepted.🤖 Generated with Claude Code