Skip to main content
Glama

zendesk_search_tickets

Search Zendesk tickets by keyword or status to retrieve ticket details like subject, requester, and assignee.

Instructions

Search Zendesk tickets by keyword and/or status. keywords: free-text search (e.g. 'login failure LDAP'). status: new, open, pending, hold, solved, closed — leave empty for all statuses. Returns id, subject, status, requester, assignee, and dates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordsNo
statusNo
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core handler function that executes the Zendesk search query, processes results, and returns JSON. Takes keywords, status, and limit parameters; uses the Zendesk API client to search tickets and returns structured data.
    def _search_tickets_data(keywords: str | None, status: str | None, limit: int) -> str:
        try:
            client = get_client()
            query = "type:ticket"
            if keywords:
                query += f" {keywords}"
            if status:
                query += f" status:{status}"
            results = client.search(query=query, sort_by="created_at", sort_order="desc")
            tickets = []
            for ticket in results:
                if len(tickets) >= limit:
                    break
                tickets.append({
                    "id": ticket.id,
                    "subject": ticket.subject,
                    "status": ticket.status,
                    "priority": ticket.priority,
                    "requester": {
                        "name": ticket.requester.name,
                        "email": ticket.requester.email,
                    },
                    "assignee": {
                        "name": ticket.assignee.name,
                        "email": ticket.assignee.email,
                    } if ticket.assignee else None,
                    "created_at": str(ticket.created_at),
                    "updated_at": str(ticket.updated_at),
                    "description": ticket.description[:300] if ticket.description else "",
                })
            return json.dumps(tickets, indent=2)
        except ConfigError as e:
            return str(e)
        except Exception as e:
            return f"Zendesk API error: {e}"
  • The MCP tool decorator defines the input schema: keywords (str, default ''), status (str, default ''), limit (int, default 50). The docstring documents parameter usage. It delegates to _search_tickets_data.
    def zendesk_search_tickets(keywords: str = "", status: str = "", limit: int = 50) -> str:
        """Search Zendesk tickets by keyword and/or status. keywords: free-text search (e.g. 'login failure LDAP'). status: new, open, pending, hold, solved, closed — leave empty for all statuses. Returns id, subject, status, requester, assignee, and dates."""
        return _search_tickets_data(keywords or None, status or None, limit)
  • Registration call in main() function - register_ticket_tools(mcp) registers all ticket tools (including zendesk_search_tickets) on the FastMCP server instance.
    register_ticket_tools(mcp)
  • The register_ticket_tools function contains the @mcp.tool() decorator that registers zendesk_search_tickets as an MCP tool on the server.
    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)
    
        @mcp.tool()
        def zendesk_search_tickets(keywords: str = "", status: str = "", limit: int = 50) -> str:
            """Search Zendesk tickets by keyword and/or status. keywords: free-text search (e.g. 'login failure LDAP'). status: new, open, pending, hold, solved, closed — leave empty for all statuses. Returns id, subject, status, requester, assignee, and dates."""
            return _search_tickets_data(keywords or None, status or None, limit)
Behavior3/5

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

No annotations are provided, so the description must convey behavioral traits. It states the return fields but omits details like pagination, rate limits, default limit of 50, or sorting behavior. This partial disclosure leaves some behavioral aspects unknown.

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 with two sentences, no fluff, and information is front-loaded. Every word adds value.

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?

The description covers search functionality, inputs, and outputs adequately given the output schema exists. However, it omits critical detail about the limit parameter (default value, max, behavior), which limits completeness for parameter understanding.

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?

With 0% schema description coverage, the description must add meaning to parameters. It explains keywords (examples) and status (valid values) but the limit parameter is not mentioned at all. The description partially compensates but is incomplete for all three parameters.

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 tool searches Zendesk tickets by keyword and/or status, with a distinct verb+resource. It differentiates from sibling tools like zendesk_search_users and zendesk_get_tickets (which retrieves individual tickets), establishing a unique purpose.

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 provides practical guidance: explains keywords as free-text with an example, lists valid statuses, and notes leaving status empty returns all. However, it does not explicitly contrast with alternative tools or mention 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