Skip to main content
Glama

zendesk_get_ticket

Retrieve a Zendesk ticket by ID to access its status, priority, requester, assignee, tags, and description.

Instructions

Get a Zendesk ticket by ID. Returns ticket fields including status, priority, requester, assignee, tags, and description.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ticket_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Tool 'zendesk_get_ticket' is registered as an MCP tool via @mcp.tool() decorator inside register_ticket_tools().
    def register_ticket_tools(mcp) -> None:
        @mcp.tool()
        def zendesk_get_ticket(ticket_id: int) -> str:
            """Get a Zendesk ticket by ID. Returns ticket fields including status, priority, requester, assignee, tags, and description."""
            return _get_ticket_data(ticket_id)
  • Handler function 'zendesk_get_ticket' that accepts a ticket_id (int) and returns ticket data as JSON string by calling _get_ticket_data().
    def zendesk_get_ticket(ticket_id: int) -> str:
        """Get a Zendesk ticket by ID. Returns ticket fields including status, priority, requester, assignee, tags, and description."""
        return _get_ticket_data(ticket_id)
  • Helper function '_get_ticket_data' that fetches the ticket from the Zendesk API via Zenpy client and returns JSON with id, subject, status, priority, type, requester, assignee, group, tags, dates, description, and ticket URL. Handles ConfigError and RecordNotFound/404 errors.
    def _get_ticket_data(ticket_id: int) -> str:
        try:
            client = get_client()
            ticket = client.tickets(id=ticket_id)
            return json.dumps({
                "id": ticket.id,
                "subject": ticket.subject,
                "status": ticket.status,
                "priority": ticket.priority,
                "type": ticket.type,
                "requester": {
                    "name": ticket.requester.name,
                    "email": ticket.requester.email,
                },
                "assignee": {
                    "name": ticket.assignee.name,
                    "email": ticket.assignee.email,
                } if ticket.assignee else None,
                "group": ticket.group.name if ticket.group else None,
                "tags": ticket.tags,
                "created_at": str(ticket.created_at),
                "updated_at": str(ticket.updated_at),
                "description": ticket.description,
                "ticket_url": f"https://{_get_subdomain()}.zendesk.com/agent/tickets/{ticket.id}",
            }, indent=2)
        except ConfigError as e:
            return str(e)
        except Exception as e:
            if "RecordNotFound" in str(e) or "404" in str(e):
                return f"Ticket #{ticket_id} not found or not accessible with current credentials."
            return f"Zendesk API error: {e}"
  • Helper function '_get_subdomain' used to construct the Zendesk ticket URL.
    def _get_subdomain() -> str:
        from zendesk_mcp.config import load_config
        return load_config().get("subdomain", "")
  • Registration import of register_ticket_tools from ticket module, called on line 33 to wire up the tool.
    from zendesk_mcp.tools.ticket import register_ticket_tools
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full responsibility. It discloses the read operation and returned fields, but does not mention error handling, authentication, or rate limits. For a read tool, this is acceptable but could be more thorough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that efficiently conveys the action, parameter, and returned fields. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the existence of an output schema, the description does not need to detail return values fully. It lists key fields. For a simple get tool, it is fairly complete, though could mention that the ticket ID must exist.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage. The description mentions 'by ID' but adds no further meaning about ticket_id format, range, or source. It provides minimal value beyond the schema's type information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and the resource ('a Zendesk ticket by ID'), and lists example returned fields (status, priority, etc.). It distinguishes from sibling tools like zendesk_get_tickets (plural) and update/create tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving a specific ticket by ID, but does not explicitly mention when not to use or alternatives like search or list tools. However, the purpose is clear enough for simple retrieval.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/michaelrice/zendesk-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server