get_channel_info
Retrieve detailed information about a specific Slack channel using its unique ID to manage and analyze channel data efficiently within the Slack MCP Server.
Instructions
Get detailed information about a specific Slack channel.
Args: channel_id: The ID of the channel
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes |
Implementation Reference
- slack_mcp/server.py:242-254 (handler)The primary MCP tool handler for 'get_channel_info', registered with @mcp.tool(). It creates a SlackClient instance, calls its get_channel_info method with the provided channel_id, and returns the result as formatted JSON or an error.async def get_channel_info(channel_id: str) -> str: """ Get detailed information about a specific Slack channel. Args: channel_id: The ID of the channel """ try: client = SlackClient() result = await client.get_channel_info(channel_id) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
- slack_mcp/server.py:87-90 (helper)Supporting helper method in the SlackClient class that performs the actual Slack API call to retrieve channel information using the 'conversations.info' endpoint.async def get_channel_info(self, channel_id: str) -> Dict[str, Any]: """Get detailed information about a specific channel.""" params = {"channel": channel_id} return await self._make_request("GET", "conversations.info", params=params)