Skip to main content
Glama

zendesk_get_comments

Retrieve all public replies, internal notes, and attachment metadata for a Zendesk ticket.

Instructions

Get all comments (public replies and internal notes) for a Zendesk ticket. Includes attachment metadata but does not download files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ticket_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The helper function that executes the core logic: fetches comments from Zendesk API, resolves author info, extracts attachments, and returns JSON string.
    def _get_comments_data(ticket_id: int) -> str:
        try:
            client = get_client()
            comments = client.tickets.comments(ticket_id)
            result = []
            for comment in comments:
                try:
                    author = client.users(id=comment.author_id)
                    author_info = {
                        "name": author.name,
                        "email": author.email,
                        "role": author.role,
                    }
                except Exception:
                    author_info = {"name": "Unknown", "email": "", "role": ""}
    
                attachments = [
                    {
                        "filename": att.file_name,
                        "content_type": att.content_type,
                        "size_bytes": att.size,
                        "content_url": att.content_url,
                    }
                    for att in (comment.attachments or [])
                ]
    
                result.append({
                    "id": comment.id,
                    "author": author_info,
                    "created_at": str(comment.created_at),
                    "is_public": comment.public,
                    "body": comment.body,
                    "attachments": attachments,
                })
            return json.dumps(result, 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}"
  • The MCP tool handler function 'zendesk_get_comments', decorated with @mcp.tool(), which calls the helper _get_comments_data.
    def register_comments_tools(mcp) -> None:
        @mcp.tool()
        def zendesk_get_comments(ticket_id: int) -> str:
            """Get all comments (public replies and internal notes) for a Zendesk ticket. Includes attachment metadata but does not download files."""
            return _get_comments_data(ticket_id)
  • Where the tool registration function is called to register all comment tools (including zendesk_get_comments) on the MCP server.
    register_ticket_tools(mcp)
    register_comments_tools(mcp)
Behavior4/5

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

With no annotations, the description carries full burden. It accurately describes the scope (all comments, attachment metadata, no downloads). However, it omits potential details like pagination or rate limits, so slightly above average.

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 concise sentences with no filler. Each sentence adds distinct value: the first defines the core action, the second clarifies scope and limitations.

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

Completeness4/5

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

For a simple read tool with one required parameter and an output schema, the description covers the main purpose and return content. It could mention ordering or default behavior, but is largely complete.

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?

The input schema has one parameter (ticket_id) with 0% description coverage. The tool description does not add any extra meaning beyond the parameter name, which is self-explanatory but not helpful for format or constraints.

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?

Clearly states the verb 'Get', resource 'comments for a Zendesk ticket', and specifies it includes attachment metadata but not file downloads, distinguishing it from siblings like zendesk_download_attachment and zendesk_post_comment.

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?

The description implies usage by stating it returns comments and metadata but does not provide explicit when-to-use or alternatives. The mention of 'does not download files' hints at a trade-off but lacks clear guidance.

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