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

# Assign ticket

> MCP tool to assign a ticket to a specific agent in the Thena platform.

import Admonition from '@theme/Admonition';

### MCP tool: `assign_ticket`

Assigns a ticket to a specific agent. Useful for ticket routing, workload balancing, or manual assignment.

<Admonition type="note">
  You must provide both the ticket ID and the agent ID.
</Admonition>

### Example prompt

```prompt theme={null}
Assign ticket 71XNF90K10YBR86G1AN06KZJJFX40 to agent URR9A99BDJ
```

<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>assign\_ticket</code> tool with the correct arguments.
</Admonition>

### Input parameters

| Name            | Type   | Required | Description                                 |
| --------------- | ------ | -------- | ------------------------------------------- |
| id              | string | Yes      | The ID of the ticket to assign              |
| assignedAgentId | string | Yes      | The ID of the agent to assign the ticket to |

### Response fields

Below are the fields you may see 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>Ticket unique ID</td></tr>
    <tr><td>ticketId</td><td>number</td><td>Ticket number</td></tr>
    <tr><td>title</td><td>string</td><td>Ticket title</td></tr>
    <tr><td>description</td><td>string</td><td>Ticket description</td></tr>
    <tr><td>status</td><td>string</td><td>Current status</td></tr>
    <tr><td>priority</td><td>string</td><td>Priority</td></tr>
    <tr><td>account</td><td>string</td><td>Account name</td></tr>
    <tr><td>accountId</td><td>string</td><td>Account ID</td></tr>
    <tr><td>teamId</td><td>string</td><td>Team ID</td></tr>
    <tr><td>teamName</td><td>string</td><td>Team name</td></tr>
    <tr><td>assignedAgent</td><td>string</td><td>Assigned agent name</td></tr>
    <tr><td>assignedAgentId</td><td>string</td><td>Assigned agent ID</td></tr>
    <tr><td>assignedAgentEmail</td><td>string</td><td>Assigned agent email</td></tr>
    <tr><td>requestorEmail</td><td>string</td><td>Requestor email</td></tr>
    <tr><td>submitterEmail</td><td>string</td><td>Submitter email</td></tr>
    <tr><td>statusId</td><td>string</td><td>Status ID</td></tr>
    <tr><td>priorityId</td><td>string</td><td>Priority ID</td></tr>
    <tr><td>sentimentId</td><td>string</td><td>Sentiment ID</td></tr>
    <tr><td>sentiment</td><td>string</td><td>Sentiment</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>

Other top-level fields in the response:

| Field     | Type    | Description                               |
| --------- | ------- | ----------------------------------------- |
| data      | object  | The updated ticket object                 |
| status    | boolean | Whether the assignment succeeded          |
| message   | string  | Status message                            |
| timestamp | string  | Time the response was generated (ISO8601) |

### Sample response

```json theme={null}
{
  "data": {
    "id": "71XNF90K10YBR86G1AN06KZJJFX40",
    "ticketId": 1,
    "title": "Sample Support Ticket",
    "description": "This is a sample ticket created to demonstrate the ticket creation process.",
    "source": "api",
    "status": "In progress",
    "priority": "Medium",
    "account": "test",
    "accountId": "8PBKJHXJ10YPPEHTQ0682FSNFNAYG",
    "teamId": "T88WCYYHPS",
    "teamName": "ENG",
    "teamIdentifier": "ENG",
    "ticketIdentifier": "ENG-1",
    "subTeamId": "T88WCYYHPS",
    "subTeamName": "ENG",
    "subTeamIdentifier": "ENG",
    "isPrivate": false,
    "formId": "FOCCF4KKYBR",
    "assignedAgent": "John",
    "assignedAgentId": "URR9A99BDJ",
    "assignedAgentEmail": "john.doe@thena.ai",
    "assignedAgentAvatar": null,
    "requestorEmail": "user@example.com",
    "submitterEmail": "user@example.com",
    "customFieldValues": [],
    "customerContactId": "N0XNF90K10J023R4483XEM0JMD881",
    "customerContactFirstName": "User",
    "customerContactLastName": "",
    "customerContactEmail": "user@example.com",
    "statusId": "XKNKDHSJ10YZXC0EMG11F7TQWZRQS",
    "priorityId": "0MNKDHSJ106YNEQ19AKG4C1VZQS6G",
    "sentimentId": "4MNKDHSJ10HTNG1C7XD40HBANC03Y",
    "sentiment": "Neutral",
    "storyPoints": null,
    "aiGeneratedTitle": null,
    "aiGeneratedSummary": null,
    "createdAt": "2025-07-16T11:24:53.157Z",
    "updatedAt": "2025-07-24T07:19:10.258Z"
  },
  "status": true,
  "message": "Ticket assigned successfully!",
  "timestamp": "2025-07-24T07:19:10.302Z"
}
```

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

***
