Summary
- expose a
slack.user.resolve tool that fuzzy-matches spoken names to Slack users
- cache Slack
users_list data with expiration to limit API calls
- return structured matches (user_id, real_name, confidence) for downstream tool usage
Acceptance Criteria
- resolver handles first/last/display names and ignores bots/deleted users
- ambiguous or low-confidence matches prompt clarification or return multiple options
- prompt instructions guide the LLM to resolve names before messaging tools
Notes
- integrate resolver internally as Python helper, expose as FunctionToolset tool
- document usage alongside
slack.private.message
- consider partial-name fuzziness while avoiding false positives
Example
class SlackUserMatch(BaseModel):
requested: str
user_id: str
real_name: str
confidence: float
@slack_toolset.tool(name="slack.user.resolve")
def resolve_users(ctx: RunContext[Deps], params: SlackResolveParams) -> list[SlackUserMatch]:
cache = ctx.state.setdefault("user_cache", SlackUserCache())
users = cache.ensure(ctx.deps.client)
matches = []
for name in params.names:
match = fuzzy_match(name, users)
if match:
matches.append(SlackUserMatch(requested=name, **match))
return matches
Summary
slack.user.resolvetool that fuzzy-matches spoken names to Slack usersusers_listdata with expiration to limit API callsAcceptance Criteria
Notes
slack.private.messageExample