"""Slack user tools — look up user profiles."""

from slack_mcp_server.client import SlackClient
from slack_mcp_server.config import SlackConfig


def register_user_tools(app, config: SlackConfig):
    """Register user tools with the FastMCP app."""

    @app.tool()
    async def slack_get_user_profile(user_id: str) -> dict:
        """Get a Slack user's profile information.

        Args:
            user_id: Slack user ID (e.g., 'U01234ABCDE')

        Returns profile with name, email, title, status, timezone, and admin status.
        """
        async with SlackClient(bot_token=config.bot_token, user_token=config.user_token) as client:
            profile = await client.get_user_profile(user_id=user_id)
            return {"success": True, "profile": profile}
