Skip to main content
Glama

get_ticket_comments

Retrieve all comments for a Zendesk ticket by its ID to view discussion history and support interactions.

Instructions

Retrieve all comments for a Zendesk ticket by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ticket_idYesThe ID of the ticket to get comments for

Implementation Reference

  • The actual implementation of fetching ticket comments using the Zenpy client.
    def get_ticket_comments(self, ticket_id: int) -> List[Dict[str, Any]]:
        """
        Get all comments for a specific ticket.
        """
        try:
            comments = self.client.tickets.comments(ticket=ticket_id)
            return [{
                'id': comment.id,
                'author_id': comment.author_id,
                'body': comment.body,
                'html_body': comment.html_body,
                'public': comment.public,
                'created_at': str(comment.created_at)
            } for comment in comments]
        except Exception as e:
            raise Exception(f"Failed to get comments for ticket {ticket_id}: {str(e)}")
  • Tool handler in server.py that routes the "get_ticket_comments" request to the ZendeskClient.
    elif name == "get_ticket_comments":
        if not arguments:
            raise ValueError("Missing arguments")
        comments = zendesk_client.get_ticket_comments(
            arguments["ticket_id"])
        return [types.TextContent(
            type="text",
            text=json.dumps(comments)
        )]
  • Registration of the "get_ticket_comments" tool, defining its schema and description.
        name="get_ticket_comments",
        description="Retrieve all comments for a Zendesk ticket by its ID",
        inputSchema={
            "type": "object",
            "properties": {
                "ticket_id": {
                    "type": "integer",
                    "description": "The ID of the ticket to get comments for"
                }
            },
            "required": ["ticket_id"]
        }
    ),
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. It mentions retrieval but doesn't specify whether this is a read-only operation, if it requires authentication, what format comments are returned in, or if there are rate limits. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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, efficient sentence that states the core functionality without unnecessary words. It's front-loaded with the main action and resource, making it immediately understandable with zero wasted content.

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?

For a simple retrieval tool with one parameter and no output schema, the description covers the basic purpose adequately. However, without annotations or output schema, it lacks details about return format, error handling, or behavioral constraints that would make it more complete for agent use.

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 description coverage is 100%, so the schema already fully documents the single parameter 'ticket_id'. The description adds no additional parameter information beyond what's in the schema, maintaining the baseline score of 3 for adequate but not enhanced parameter semantics.

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 ('Retrieve all comments') and target resource ('for a Zendesk ticket by its ID'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'get_ticket' or 'create_ticket_comment', but the specificity of retrieving comments rather than ticket details or creating comments provides implicit distinction.

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 'get_ticket' (which might include comments) or 'search_tickets' (which might filter tickets with comments). It states what the tool does but offers no context about prerequisites, timing, or comparison 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