# SlackRetrieveTool

## `autogen.tools.experimental.SlackRetrieveTool`

```python
SlackRetrieveTool(*, bot_token, channel_id)
```

Bases: `Tool`

Retrieves messages from a Slack channel.

### Parameters

| PARAMETER   | DESCRIPTION |
| ----------- | ----------- |
| `bot_token` | Bot User OAuth Token starting with "xoxb-".<br>**TYPE:**`str` |
| `channel_id`| Channel ID where messages will be sent.<br>**TYPE:**`str` |

Source code in `autogen/tools/experimental/messageplatform/slack/slack.py`

```python

def __init__(self, *, bot_token: str, channel_id: str) -> None:
    """Initialize the SlackRetrieveTool.
    Args:
        bot_token: Bot User OAuth Token starting with "xoxb-".
        channel_id: Channel ID where messages will be sent.
    """
    ...

async def slack_retrieve_messages(
    bot_token: Annotated[str, Depends(on(bot_token))],
    channel_id: Annotated[str, Depends(on(channel_id))],
    messages_since: Annotated[
        str | None,
        "Date to retrieve messages from (ISO format) OR Slack message ID. If None, retrieves latest messages.",
    ] = None,
    maximum_messages: Annotated[
        int | None, "Maximum number of messages to retrieve. If None, retrieves all messages since date."
    ] = None,
) -> Any:
    """Retrieves messages from a Discord channel. ...
    """
    ...
    
    return {
        "message_count": len(messages),
        "messages": messages,
        "start_time": oldest or "latest",
    }
```

### `name property`

```
name
```

### `description property`

```
description
```

### `func property`

```
func
```

### `tool_schema property`

```
tool_schema
```

Get the schema for the tool.

### `function_schema property`

```
function_schema
```

Get the schema for the function.

### `realtime_tool_schema property`

```
realtime_tool_schema
```

Get the schema for the tool.

### `register_for_llm`

```
register_for_llm(agent)
```

Registers the tool for use with a ConversableAgent's language model (LLM).

| PARAMETER   | DESCRIPTION |
| ----------- | ----------- |
| `agent`     | The agent to which the tool will be registered.<br>**TYPE:**`ConversableAgent` |

### `register_for_execution`

```
register_for_execution(agent)
```

Registers the tool for direct execution by a ConversableAgent.

| PARAMETER   | DESCRIPTION |
| ----------- | ----------- |
| `agent`     | The agent to which the tool will be registered.<br>**TYPE:**`ConversableAgent` |

### `register_tool`

```
register_tool(agent)
```

Register a tool to be both proposed and executed by an agent.

| PARAMETER   | DESCRIPTION |
| ----------- | ----------- |
| `agent`     | The agent to which the tool will be registered.<br>**TYPE:**`ConversableAgent` |

Back to top
