Skip to main content
Glama

zendesk_update_ticket

Modify Zendesk ticket fields including status, priority, assignee, and custom fields. Pass only changed fields to update and receive the refreshed ticket.

Instructions

Update one or more fields on a Zendesk ticket. Pass only the fields you want to change. status: new/open/pending/hold/solved/closed. priority: low/normal/high/urgent. type: problem/incident/question/task. assignee_id, requester_id, group_id, custom_status_id are integer IDs. due_at is ISO8601. Returns JSON of the refreshed ticket.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ticket_idYes
subjectNo
statusNo
priorityNo
typeNo
assignee_idNo
requester_idNo
tagsNo
custom_fieldsNo
due_atNo
group_idNo
custom_status_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core handler function that updates a Zendesk ticket. Validates fields, fetches the ticket via Zenpy client, sets attributes, updates via API, and returns JSON of the refreshed ticket.
    def _update_ticket_data(ticket_id: int, **fields) -> str:
        provided = {k: v for k, v in fields.items() if v is not None and k in _UPDATABLE_FIELDS}
        if not provided:
            return "Nothing to update: provide at least one field besides ticket_id."
        if "status" in provided and provided["status"] not in _VALID_STATUSES:
            return f"Invalid status '{provided['status']}'. Valid values: {', '.join(sorted(_VALID_STATUSES))}"
        if "priority" in provided and provided["priority"] not in _VALID_PRIORITIES:
            return f"Invalid priority '{provided['priority']}'. Valid values: {', '.join(sorted(_VALID_PRIORITIES))}"
        if "type" in provided and provided["type"] not in _VALID_TYPES:
            return f"Invalid type '{provided['type']}'. Valid values: {', '.join(sorted(_VALID_TYPES))}"
        try:
            client = get_client()
            ticket = client.tickets(id=ticket_id)
            for k, v in provided.items():
                setattr(ticket, k, v)
            client.tickets.update(ticket)
            refreshed = client.tickets(id=ticket_id)
            return json.dumps({
                "id": refreshed.id,
                "subject": refreshed.subject,
                "description": getattr(refreshed, "description", None),
                "status": refreshed.status,
                "priority": refreshed.priority,
                "type": getattr(refreshed, "type", None),
                "created_at": str(refreshed.created_at),
                "updated_at": str(refreshed.updated_at),
                "requester_id": refreshed.requester_id,
                "assignee_id": refreshed.assignee_id,
                "organization_id": getattr(refreshed, "organization_id", None),
                "group_id": getattr(refreshed, "group_id", None),
                "custom_status_id": getattr(refreshed, "custom_status_id", None),
                "tags": list(getattr(refreshed, "tags", []) or []),
            }, 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}"
  • MCP tool function 'zendesk_update_ticket' decorated with @mcp.tool(). Accepts optional updatable fields and delegates to _update_ticket_data.
    @mcp.tool()
    def zendesk_update_ticket(
        ticket_id: int,
        subject: str | None = None,
        status: str | None = None,
        priority: str | None = None,
        type: str | None = None,
        assignee_id: int | None = None,
        requester_id: int | None = None,
        tags: list | None = None,
        custom_fields: list | None = None,
        due_at: str | None = None,
        group_id: int | None = None,
        custom_status_id: int | None = None,
    ) -> str:
        """Update one or more fields on a Zendesk ticket. Pass only the fields you want to change. status: new/open/pending/hold/solved/closed. priority: low/normal/high/urgent. type: problem/incident/question/task. assignee_id, requester_id, group_id, custom_status_id are integer IDs. due_at is ISO8601. Returns JSON of the refreshed ticket."""
        return _update_ticket_data(
            ticket_id=ticket_id,
            subject=subject,
            status=status,
            priority=priority,
            type=type,
            assignee_id=assignee_id,
            requester_id=requester_id,
            tags=tags,
            custom_fields=custom_fields,
            due_at=due_at,
            group_id=group_id,
            custom_status_id=custom_status_id,
        )
  • Registration function that uses @mcp.tool() decorator to register 'zendesk_update_ticket' and two related tools.
    def register_update_ticket_tools(mcp) -> None:
        @mcp.tool()
        def zendesk_set_ticket_status(ticket_id: int, status: str) -> str:
            """Set the status of a Zendesk ticket. Valid statuses: new, open, pending, hold, solved, closed."""
            return _set_ticket_status_data(ticket_id, status)
    
        @mcp.tool()
        def zendesk_assign_ticket(ticket_id: int, assignee_email: str) -> str:
            """Assign a Zendesk ticket to an agent by their email address. Pass 'me' as assignee_email to assign the ticket to yourself (the authenticated user)."""
            return _assign_ticket_data(ticket_id, assignee_email)
    
        @mcp.tool()
        def zendesk_update_ticket(
            ticket_id: int,
            subject: str | None = None,
            status: str | None = None,
            priority: str | None = None,
            type: str | None = None,
            assignee_id: int | None = None,
            requester_id: int | None = None,
            tags: list | None = None,
            custom_fields: list | None = None,
            due_at: str | None = None,
            group_id: int | None = None,
            custom_status_id: int | None = None,
        ) -> str:
            """Update one or more fields on a Zendesk ticket. Pass only the fields you want to change. status: new/open/pending/hold/solved/closed. priority: low/normal/high/urgent. type: problem/incident/question/task. assignee_id, requester_id, group_id, custom_status_id are integer IDs. due_at is ISO8601. Returns JSON of the refreshed ticket."""
            return _update_ticket_data(
                ticket_id=ticket_id,
                subject=subject,
                status=status,
                priority=priority,
                type=type,
                assignee_id=assignee_id,
                requester_id=requester_id,
                tags=tags,
                custom_fields=custom_fields,
                due_at=due_at,
                group_id=group_id,
                custom_status_id=custom_status_id,
            )
  • Server imports and calls register_update_ticket_tools(mcp) to register the update ticket tools on the FastMCP instance.
    from zendesk_mcp.tools.update_ticket import register_update_ticket_tools
    from zendesk_mcp.tools.time_tracking import register_time_tracking_tools
    from zendesk_mcp.tools.git_zen import register_git_zen_tools
    from zendesk_mcp.tools.create_ticket import register_create_ticket_tools
    from zendesk_mcp.tools.list_tickets import register_list_tickets_tools
    from zendesk_mcp.tools.knowledge_base import register_knowledge_base_resource
    from zendesk_mcp.tools.tags import register_tag_tools
    from zendesk_mcp.tools.views import register_view_tools
    from zendesk_mcp.tools.macros import register_macro_tools
    from zendesk_mcp.tools.users import register_user_tools
    from zendesk_mcp.tools.groups import register_group_tools
    from zendesk_mcp.tools.organizations import register_organization_tools
    from zendesk_mcp.tools.custom_statuses import register_custom_status_tools
    from zendesk_mcp.prompts import register_prompts
    
    register_ticket_tools(mcp)
    register_comments_tools(mcp)
    register_attachment_tools(mcp)
    register_gitlab_context_tools(mcp)
    register_write_comment_tools(mcp)
    register_update_ticket_tools(mcp)
  • Defines the set of updatable field names used for validation in the handler.
    _UPDATABLE_FIELDS = {
        "subject", "status", "priority", "type",
        "assignee_id", "requester_id", "tags", "custom_fields", "due_at",
        "group_id", "custom_status_id",
    }
Behavior3/5

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

No annotations provided, so description must fully disclose behavior. It states returns 'JSON of the refreshed ticket' and that only provided fields change. However, it does not clarify whether tags/custom_fields are replaced or merged, permissions needed, or behavior on invalid input.

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?

Two efficient sentences with no extraneous words. Front-loaded with purpose, followed by a structured list of parameter constraints.

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

Completeness3/5

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

Given 12 parameters, 0% schema coverage, and no annotations, the description covers critical fields but omits details on tags and custom_fields. Output schema exists, so return value is explained. Still, gaps remain in parameter semantics and usage guidance.

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

Parameters3/5

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

Schema has 0% description coverage, forcing description to compensate. Description adds allowed values for status, priority, type, and type hints for assignee_id, requester_id, due_at, group_id, custom_status_id. But subject, tags, custom_fields lack explanation beyond their names.

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?

Describes exactly what the tool does: 'Update one or more fields on a Zendesk ticket.' This clearly distinguishes it from creation, status-specialized, and other update-related sibling tools like zendesk_set_ticket_status. The verb 'update' and resource 'Zendesk ticket' are specific.

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?

Advises 'Pass only the fields you want to change,' implying partial updates. Provides allowed values for status, priority, type, and data format for due_at. However, does not explicitly compare to sibling zendesk_set_ticket_status or state when not to use this tool.

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