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

# Get team routing rules

> MCP tool to retrieve routing rules for a team in the Thena platform.

import Admonition from '@theme/Admonition';

### MCP tool: `get_team_routing_rules`

Retrieves all routing rules configured for a specific team. These rules determine how tickets are automatically assigned and routed within the team based on various conditions and criteria.

<Admonition type="note">
  You must provide the team ID to retrieve its routing rules.
</Admonition>

### Example prompt

```prompt theme={null}
Get routing rules for team T88WCYYHPS
```

<Admonition type="info">
  When you use this prompt in a chat with the model (with the MCP tool registered), the model will automatically call the <code>get\_team\_routing\_rules</code> tool with the correct arguments.
</Admonition>

### Input parameters

| Name   | Type   | Required | Description                                      |
| ------ | ------ | -------- | ------------------------------------------------ |
| teamId | string | Yes      | The ID of the team to retrieve routing rules for |

### Response fields

Below are the fields you may see in each routing rule object in the response:

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>id</td><td>string</td><td>Routing rule unique ID</td></tr>
    <tr><td>name</td><td>string</td><td>Routing rule name</td></tr>
    <tr><td>description</td><td>string</td><td>Routing rule description</td></tr>
    <tr><td>teamId</td><td>string</td><td>Team ID this rule belongs to</td></tr>
    <tr><td>evaluationOrder</td><td>number</td><td>Priority/order for rule evaluation</td></tr>
    <tr><td>resultTeamId</td><td>string</td><td>Target team ID for routing</td></tr>
    <tr><td>fallbackTeamId</td><td>string</td><td>Fallback team ID if primary routing fails</td></tr>
    <tr><td>andRules</td><td>array</td><td>Array of AND conditions (all must match)</td></tr>
    <tr><td>orRules</td><td>array</td><td>Array of OR conditions (any can match)</td></tr>
    <tr><td>createdBy</td><td>string</td><td>Name of user who created the rule</td></tr>
    <tr><td>createdById</td><td>string</td><td>ID of user who created the rule</td></tr>
    <tr><td>createdAt</td><td>string (ISO8601)</td><td>Creation timestamp</td></tr>
    <tr><td>updatedAt</td><td>string (ISO8601)</td><td>Last update timestamp</td></tr>
  </tbody>
</table>

#### Rule fields (andRules/orRules)

Each rule in the `andRules` and `orRules` arrays contains:

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>field</td><td>string</td><td>Field to match against (e.g., "priority", "status")</td></tr>
    <tr><td>operator</td><td>string</td><td>Comparison operator (e.g., "EQUALS", "CONTAINS")</td></tr>
    <tr><td>value</td><td>string</td><td>Value to match against</td></tr>
    <tr><td>precedence</td><td>number</td><td>Rule precedence/priority</td></tr>
  </tbody>
</table>

### Sample response

```json theme={null}
{
  "data": [
    {
      "id": "RR001",
      "name": "High Priority Tickets",
      "description": "Route high priority tickets to senior team",
      "teamId": "T88WCYYHPS",
      "evaluationOrder": 1,
      "resultTeamId": "T99WCYYHPS",
      "fallbackTeamId": "TAAWCYYHPS",
      "andRules": [
        {
          "field": "priority",
          "operator": "EQUALS",
          "value": "high",
          "precedence": 1
        },
        {
          "field": "status",
          "operator": "NOT_EQUALS",
          "value": "closed",
          "precedence": 2
        }
      ],
      "orRules": [
        {
          "field": "account",
          "operator": "CONTAINS",
          "value": "enterprise",
          "precedence": 1
        }
      ],
      "createdBy": "John Doe",
      "createdById": "USER123",
      "createdAt": "2025-07-24T07:19:10.258Z",
      "updatedAt": "2025-07-24T07:19:10.258Z"
    },
    {
      "id": "RR002",
      "name": "Bug Reports",
      "description": "Route bug reports to QA team",
      "teamId": "T88WCYYHPS",
      "evaluationOrder": 2,
      "resultTeamId": "TBBWCYYHPS",
      "fallbackTeamId": null,
      "andRules": [
        {
          "field": "type",
          "operator": "EQUALS",
          "value": "bug",
          "precedence": 1
        }
      ],
      "orRules": [],
      "createdBy": "Jane Smith",
      "createdById": "USER456",
      "createdAt": "2025-07-24T08:19:10.258Z",
      "updatedAt": "2025-07-24T08:19:10.258Z"
    }
  ],
  "status": true,
  "message": "Team routing rules retrieved successfully!",
  "timestamp": "2025-07-25T12:50:38.937Z"
}
```

<Admonition type="tip">
  Always pass an object as input, even if empty, to avoid errors when calling the tool directly.
</Admonition>

***
