Skip to main content
Glama

zendesk_create_ticket

Create a Zendesk ticket by providing subject and description. Optionally set priority, type, requester, assignee, tags, and custom fields. Returns the created ticket as JSON.

Instructions

Create a new Zendesk ticket. subject and description are required. priority: low/normal/high/urgent. type: problem/incident/question/task. requester_id/assignee_id are user IDs (integers). custom_fields is a list of {id, value} dicts. Returns JSON of the created ticket.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subjectYes
descriptionYes
requester_idNo
assignee_idNo
priorityNo
typeNo
tagsNo
custom_fieldsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'register_create_ticket_tools' function registers the 'zendesk_create_ticket' MCP tool using the @mcp.tool() decorator. The handler function accepts parameters (subject, description, requester_id, assignee_id, priority, type, tags, custom_fields) and delegates to _create_ticket_data.
    def register_create_ticket_tools(mcp) -> None:
        @mcp.tool()
        def zendesk_create_ticket(
            subject: str,
            description: str,
            requester_id: int | None = None,
            assignee_id: int | None = None,
            priority: str | None = None,
            type: str | None = None,
            tags: list | None = None,
            custom_fields: list | None = None,
        ) -> str:
            """Create a new Zendesk ticket. subject and description are required. priority: low/normal/high/urgent. type: problem/incident/question/task. requester_id/assignee_id are user IDs (integers). custom_fields is a list of {id, value} dicts. Returns JSON of the created ticket."""
            return _create_ticket_data(
                subject=subject,
                description=description,
                requester_id=requester_id,
                assignee_id=assignee_id,
                priority=priority,
                type=type,
                tags=tags,
                custom_fields=custom_fields,
            )
  • The _create_ticket_data helper function validates inputs, constructs a ZenpyTicket object, calls client.tickets.create(), fetches the created ticket, and returns a JSON string of the ticket details. Handles ConfigError and general exceptions.
    def _create_ticket_data(
        subject: str,
        description: str,
        requester_id: int | None = None,
        assignee_id: int | None = None,
        priority: str | None = None,
        type: str | None = None,
        tags: list | None = None,
        custom_fields: list | None = None,
    ) -> str:
        if priority is not None and priority not in _VALID_PRIORITIES:
            return f"Invalid priority '{priority}'. Valid values: {', '.join(sorted(_VALID_PRIORITIES))}"
        if type is not None and type not in _VALID_TYPES:
            return f"Invalid type '{type}'. Valid values: {', '.join(sorted(_VALID_TYPES))}"
        try:
            client = get_client()
            kwargs = {"subject": subject, "description": description}
            if requester_id is not None:
                kwargs["requester_id"] = requester_id
            if assignee_id is not None:
                kwargs["assignee_id"] = assignee_id
            if priority is not None:
                kwargs["priority"] = priority
            if type is not None:
                kwargs["type"] = type
            if tags is not None:
                kwargs["tags"] = tags
            if custom_fields is not None:
                kwargs["custom_fields"] = custom_fields
            ticket = ZenpyTicket(**kwargs)
            audit = client.tickets.create(ticket)
            created_id = getattr(getattr(audit, "ticket", None), "id", None)
            if created_id is None:
                return "Ticket created but ID could not be determined from Zendesk response."
            refreshed = client.tickets(id=created_id)
            return json.dumps({
                "id": refreshed.id,
                "subject": refreshed.subject,
                "description": refreshed.description,
                "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": refreshed.organization_id,
                "tags": list(getattr(refreshed, "tags", []) or []),
            }, indent=2)
        except ConfigError as e:
            return str(e)
        except Exception as e:
            return f"Zendesk API error: {e}"
  • Validation constants: _VALID_PRIORITIES and _VALID_TYPES define allowed values for priority and type fields.
    _VALID_PRIORITIES = {"low", "normal", "high", "urgent"}
    _VALID_TYPES = {"problem", "incident", "question", "task"}
  • The get_client() helper function creates a Zenpy client using OAuth credentials from config. Raises ConfigError if not configured.
    def get_client(config_file: Path | None = None) -> Zenpy:
        cfg = load_config(config_file)
        subdomain = cfg.get("subdomain", "").strip()
        token = cfg.get("oauth_token", "").strip()
        if not subdomain or not token:
            raise ConfigError("Zendesk not configured. Run: zendesk-mcp setup")
        return Zenpy(subdomain=subdomain, oauth_token=token)
  • Tool registration call: register_create_ticket_tools(mcp) is invoked in the main() function after importing from zendesk_mcp.tools.create_ticket on line 21.
    register_create_ticket_tools(mcp)
Behavior3/5

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

No annotations are provided, so the description carries the burden. It mentions required fields and return type (JSON) but does not disclose potential side effects, idempotency, permissions, or rate limits.

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 two sentences, front-loading purpose and required fields, then listing parameter details efficiently. Every sentence is informative with no redundancy.

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?

With 8 parameters, an output schema exists, but the description does not explain the format for tags and only briefly mentions return value. It covers most parameters but leaves tags vague.

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

Parameters4/5

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

Schema coverage is 0%, but the description adds significant value: it specifies allowed values for priority and type, explains that requester_id/assignee_id are integer user IDs, and describes custom_fields structure. This compensates for the bare schema.

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 'Create a new Zendesk ticket' and lists required and optional fields, effectively distinguishing it from sibling tools like update, assign, search, etc.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives (e.g., update_ticket) is provided. The verb 'Create' implies it's for new tickets, but no when-not-to-use or context is given.

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