feat: support direct user ID lookup in users_search#263
Open
Christian-Sidak wants to merge 1 commit intokorotovsky:masterfrom
Open
feat: support direct user ID lookup in users_search#263Christian-Sidak wants to merge 1 commit intokorotovsky:masterfrom
Christian-Sidak wants to merge 1 commit intokorotovsky:masterfrom
Conversation
When the query matches a Slack user ID pattern (e.g., U07VCEPP4N5), use the users.info API for direct lookup instead of searching by name/email/display name. This is useful when you already have a user ID (from message metadata, mentions, etc.) and need to resolve it to user details. Falls back to existing search behavior for non-ID queries. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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
users_searchquery matches a Slack user ID pattern (starts withUorW, followed by alphanumeric characters, e.g.U07VCEPP4N5), the tool now calls theusers.infoAPI directly instead of performing a name/email searchMotivation
When working with Slack data, user IDs appear frequently in message metadata, mentions (
<@U07VCEPP4N5>), and API responses. Currently, resolving a user ID to a name/profile requires workarounds. This change lets you pass a user ID directly tousers_searchfor an exact lookup.Related: #205
Changes
pkg/provider/api.go: AddedslackUserIDPatternregex and a user ID detection branch inSearchUsers()that calls the existingGetUsersInfomethod (which wraps the Slackusers.infoAPI)pkg/server/server.go: Updated tool and parameter descriptions to mention user ID supportTest plan
U07VCEPP4N5) returns that user profilehello,u07vcepp4n5) falls through to search