Skip to content

Add Slack user resolver tool for natural language names #15

@fbraza

Description

@fbraza

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions