> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ravenna.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent tools

> Use Slack agent tools in Ravenna rules to assign Enterprise Grid workspace members, set guest expirations, and remove users from workspaces.

Slack provides AI agent tools for managing user membership across an Enterprise Grid org. Reference these tools in <Tooltip headline="Agent rules" tip="Natural language instructions defining agent behavior" cta="Learn about agent rules" href="/documentation/automate/agents/configure#rules">agent rules</Tooltip> using @ mentions to automate workspace assignment, guest expirations, and offboarding during ticket handling.

<Note>
  The Enterprise Admin tools below only work on Slack Enterprise Grid installs that have an admin token connected. A Slack org admin must complete the connection from **Settings → Integrations → Slack → Connect Enterprise Admin** before these tools can run.
</Note>

***

## Available tools

<AccordionGroup>
  <Accordion title="Assign user to Enterprise workspace" defaultOpen>
    Adds a user who already exists in your Enterprise Grid org to a specific workspace. No invite email is sent — the user is added directly with the role you specify.

    **Tool name:** `@Assign User to Slack Enterprise Workspace`

    **Input fields:**

    * Workspace — `teamId` (T...) or `teamName` (e.g., `engineering`). The tool resolves the name to an ID automatically.
    * User — `userId` (U...) or `email`. The tool resolves the email to a Slack user ID automatically.
    * Role — one of:
      * `regular` — full member
      * `multi_channel_guest` — access to specific channels
      * `single_channel_guest` — access to exactly one channel

    **Common use cases:**

    * Add new hires to the right workspaces as part of onboarding
    * Grant a contractor guest access to a project workspace
    * Move a user into an additional workspace when their team changes

    **Example rule:**

    <Prompt description="Assign new hire to workspace">
      When an onboarding ticket is approved, use @Assign User to Slack Enterprise Workspace to add the new hire to the workspace named in the ticket as a regular member.
      Confirm the assigned role with the requester before running the tool.
    </Prompt>
  </Accordion>

  <Accordion title="Set Enterprise user access expiration">
    Sets or updates the access expiration timestamp for a guest user in an Enterprise Grid workspace. Use this to enforce time-bound access for contractors and vendors.

    **Tool name:** `@Set Enterprise User Access Expiration`

    **Input fields:**

    * Workspace — `teamId` (T...) or `teamName`.
    * User — `userId` (U...) or `email`.
    * `expirationTs` — Unix timestamp in seconds when guest access should expire.

    **Common use cases:**

    * Set an end date when granting contractor or vendor access
    * Extend an existing guest's access when their engagement is renewed
    * Shorten access when a project wraps up early

    **Example rule:**

    <Prompt description="Set guest expiration for contractor">
      When a contractor access request is approved, use @Set Enterprise User Access Expiration to set the guest's expiration to the contract end date provided on the ticket.
      Reply to the requester with the new expiration date.
    </Prompt>
  </Accordion>

  <Accordion title="Remove user from Enterprise workspace">
    Removes a user from a single workspace inside the Enterprise Grid org. The user keeps their Slack account and access to any other workspaces they belong to.

    **Tool name:** `@Remove User from Slack Enterprise Workspace`

    **Input fields:**

    * Workspace — `teamId` (T...) or `teamName`.
    * User — `userId` (U...) or `email`.

    **Common use cases:**

    * Remove a user from a workspace when they change teams
    * Clean up guest access after a project ends
    * Revoke workspace membership as part of partial offboarding

    **Example rule:**

    <Prompt description="Remove contractor from workspace">
      When a project closeout ticket is resolved, use @Remove User from Slack Enterprise Workspace to remove each contractor listed on the ticket from the project workspace.
      Post a summary of removed users back to the ticket.
    </Prompt>
  </Accordion>
</AccordionGroup>

***

## Setup

<Steps>
  <Step title="Install the Slack integration">
    Follow the [Slack setup guide](/integrations/slack/setup) to connect Slack to Ravenna.
  </Step>

  <Step title="Connect the Enterprise admin token">
    A Slack org admin must connect the Enterprise admin token from **Settings → Integrations → Slack → Connect Enterprise Admin**. Without this token, the Enterprise admin tools return an `ENTERPRISE_ADMIN_TOKEN_REQUIRED` error.
  </Step>

  <Step title="Configure your agent">
    Open your agent's settings and confirm the Slack tool appears in the Tools section under Capabilities.
  </Step>

  <Step title="Create rules">
    Write <Tooltip headline="Agent rules" tip="Natural language instructions defining agent behavior" cta="Learn about agent rules" href="/documentation/automate/agents/configure#rules">rules</Tooltip> that reference the Slack tools using @ mentions.
  </Step>

  <Step title="Test the tools">
    Test rules against a non-production workspace first to confirm the agent assigns the role, expiration, or removal you expect.
  </Step>
</Steps>

***

## Best practices

* Always confirm the workspace and role with the requester before running Assign User. The role choice (`regular`, `multi_channel_guest`, `single_channel_guest`) is not reversible without removing and re-adding the user.
* Prefer `email` over `userId` and `teamName` over `teamId` in rule prompts — both are easier for end users to provide on tickets, and the tools resolve them automatically.
* Pair Set Enterprise User Access Expiration with your contractor onboarding workflow so every guest is created with an end date.
* Use Remove User from Enterprise Workspace for partial offboarding only. To fully deactivate a Slack user, use your identity provider (for example, Okta or Microsoft Entra) instead.

<Callout icon="link" color="#6B7280">
  Learn more about [configuring agents](/documentation/automate/agents/configure) and writing effective rules
</Callout>
