Skip to main content
Glama

create_ticket

Create a new support ticket in Zendesk to report issues, ask questions, or request assistance by specifying subject, description, priority, and assignee.

Instructions

Create a new Zendesk ticket

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subjectYesTicket subject
descriptionYesTicket description
requester_idNo
assignee_idNo
priorityNolow, normal, high, urgent
typeNoproblem, incident, question, task
tagsNo
custom_fieldsNo

Implementation Reference

  • The `create_ticket` method in `ZendeskClient` is the actual handler that interacts with the Zendesk API to create a ticket using the Zenpy library.
    def create_ticket(
        self,
        subject: str,
        description: str,
        requester_id: int | None = None,
        assignee_id: int | None = None,
        priority: str | None = None,
        type: str | None = None,
        tags: List[str] | None = None,
        custom_fields: List[Dict[str, Any]] | None = None,
    ) -> Dict[str, Any]:
        """
        Create a new Zendesk ticket using Zenpy and return essential fields.
    
        Args:
            subject: Ticket subject
            description: Ticket description (plain text). Will also be used as initial comment.
            requester_id: Optional requester user ID
            assignee_id: Optional assignee user ID
            priority: Optional priority (low, normal, high, urgent)
            type: Optional ticket type (problem, incident, question, task)
            tags: Optional list of tags
            custom_fields: Optional list of dicts: {id: int, value: Any}
        """
        try:
            ticket = ZenpyTicket(
                subject=subject,
                description=description,
                requester_id=requester_id,
                assignee_id=assignee_id,
                priority=priority,
                type=type,
                tags=tags,
                custom_fields=custom_fields,
            )
            created_audit = self.client.tickets.create(ticket)
            # Fetch created ticket id from audit
            created_ticket_id = getattr(getattr(created_audit, 'ticket', None), 'id', None)
            if created_ticket_id is None:
                # Fallback: try to read id from audit events
                created_ticket_id = getattr(created_audit, 'id', None)
    
            # Fetch full ticket to return consistent data
            created = self.client.tickets(id=created_ticket_id) if created_ticket_id else None
    
            return {
                'id': getattr(created, 'id', created_ticket_id),
                'subject': getattr(created, 'subject', subject),
                'description': getattr(created, 'description', description),
                'status': getattr(created, 'status', 'new'),
                'priority': getattr(created, 'priority', priority),
                'type': getattr(created, 'type', type),
                'created_at': str(getattr(created, 'created_at', '')),
                'updated_at': str(getattr(created, 'updated_at', '')),
                'requester_id': getattr(created, 'requester_id', requester_id),
                'assignee_id': getattr(created, 'assignee_id', assignee_id),
                'organization_id': getattr(created, 'organization_id', None),
                'tags': list(getattr(created, 'tags', tags or []) or []),
            }
        except Exception as e:
            raise Exception(f"Failed to create ticket: {str(e)}")
  • The `create_ticket` tool definition and schema registration in the MCP server.
    types.Tool(
        name="create_ticket",
        description="Create a new Zendesk ticket",
        inputSchema={
            "type": "object",
            "properties": {
                "subject": {"type": "string", "description": "Ticket subject"},
                "description": {"type": "string", "description": "Ticket description"},
                "requester_id": {"type": "integer"},
                "assignee_id": {"type": "integer"},
                "priority": {"type": "string", "description": "low, normal, high, urgent"},
                "type": {"type": "string", "description": "problem, incident, question, task"},
                "tags": {"type": "array", "items": {"type": "string"}},
                "custom_fields": {"type": "array", "items": {"type": "object"}},
            },
            "required": ["subject", "description"],
        }
    ),
  • The tool call handler in `server.py` which maps the `create_ticket` tool request to the `zendesk_client.create_ticket` implementation.
    elif name == "create_ticket":
        if not arguments:
            raise ValueError("Missing arguments")
        created = zendesk_client.create_ticket(
            subject=arguments.get("subject"),
            description=arguments.get("description"),
            requester_id=arguments.get("requester_id"),
            assignee_id=arguments.get("assignee_id"),
            priority=arguments.get("priority"),
            type=arguments.get("type"),
            tags=arguments.get("tags"),
            custom_fields=arguments.get("custom_fields"),
        )
        return [types.TextContent(
            type="text",
            text=json.dumps({"message": "Ticket created successfully", "ticket": created}, indent=2)
        )]
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Create' implies a write operation, it doesn't mention permission requirements, whether tickets are immediately visible, rate limits, error conditions, or what happens on success. This is inadequate for a mutation tool with zero annotation coverage.

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 extremely concise - a single sentence with no wasted words. It's front-loaded with the essential information (create ticket) and doesn't include unnecessary elaboration.

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

Completeness2/5

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

For a write operation with 8 parameters, 50% schema coverage, no annotations, and no output schema, the description is insufficient. It doesn't compensate for the missing behavioral context, parameter documentation gaps, or provide any information about what the tool returns upon success.

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?

Schema description coverage is only 50% (4 of 8 parameters have descriptions). The description adds no parameter information beyond what's in the schema - it doesn't explain the purpose of fields like requester_id, assignee_id, tags, or custom_fields, nor does it provide examples or clarify relationships between parameters.

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

Purpose4/5

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

The description clearly states the action ('Create') and resource ('new Zendesk ticket'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its siblings like 'update_ticket' or explain what distinguishes ticket creation from other ticket operations.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'update_ticket' or 'search_tickets'. It doesn't mention prerequisites (like needing a requester_id), appropriate contexts, or limitations compared to sibling tools.

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/kdopenshaw/zendesk-mcp-server'

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