> ## 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.

# Update team routing rule

> MCP tool to update a routing rule for a team in the Thena platform.

import Admonition from '@theme/Admonition';

### MCP tool: `update_team_routing_rule`

Updates an existing routing rule for a specific team. This tool allows you to modify the conditions, target team, evaluation order, and other properties of routing rules.

<Admonition type="note">
  You must provide the team ID and rule ID to update a routing rule. All other parameters are optional.
</Admonition>

### Example prompt

```prompt theme={null}
Update routing rule RR001 for team T88WCYYHPS to change the evaluation order to 2
```

<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>update\_team\_routing\_rule</code> tool with the correct arguments.
</Admonition>

### Input parameters

| Name            | Type      | Required | Description                                        |
| --------------- | --------- | -------- | -------------------------------------------------- |
| teamId          | string    | Yes      | The ID of the team the routing rule belongs to     |
| ruleId          | string    | Yes      | The ID of the routing rule to update               |
| name            | string    | No       | The name of the routing rule group                 |
| resultTeamId    | string    | No       | The ID of the team that tickets will be routed to  |
| description     | string    | No       | The description of the routing rule group          |
| evaluationOrder | number    | No       | The order in which this rule should be evaluated   |
| andRules        | string\[] | No       | Rules that must all match (AND condition)          |
| orRules         | string\[] | No       | Rules where any match is sufficient (OR condition) |

### Response fields

The response will contain the updated routing rule with the same structure as the `get_team_routing_rules` tool:

<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>

### Sample response

```json theme={null}
{
  "data": {
    "id": "RR001",
    "name": "High Priority Tickets",
    "description": "Updated: Route high priority tickets to senior team",
    "teamId": "T88WCYYHPS",
    "evaluationOrder": 2,
    "resultTeamId": "T99WCYYHPS",
    "fallbackTeamId": null,
    "andRules": [
      {
        "field": "priority",
        "operator": "EQUALS",
        "value": "high",
        "precedence": 1
      },
      {
        "field": "status",
        "operator": "NOT_EQUALS",
        "value": "closed",
        "precedence": 2
      },
      {
        "field": "type",
        "operator": "NOT_EQUALS",
        "value": "bug",
        "precedence": 3
      }
    ],
    "orRules": [
      {
        "field": "account",
        "operator": "CONTAINS",
        "value": "enterprise",
        "precedence": 1
      }
    ],
    "createdBy": "John Doe",
    "createdById": "USER123",
    "createdAt": "2025-07-24T07:19:10.258Z",
    "updatedAt": "2025-07-25T12:50:38.937Z"
  },
  "status": true,
  "message": "Team routing rule updated 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>

<Admonition type="warning">
  This tool modifies existing routing rules that affect ticket assignment. Changes may impact how tickets are automatically assigned.
</Admonition>

***
