Skip to main content
Glama

zendesk_post_comment

Post a public reply on a Zendesk ticket visible to the requester. Use for customer-facing responses.

Instructions

Post a public reply on a Zendesk ticket. The reply is visible to the requester. Use for customer-facing responses.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ticket_idYes
bodyYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The zendesk_post_comment tool handler. Accepts ticket_id (int) and body (str), and delegates to _post_comment_data with public=True to post a public comment on a Zendesk ticket.
    def zendesk_post_comment(ticket_id: int, body: str) -> str:
        """Post a public reply on a Zendesk ticket. The reply is visible to the requester. Use for customer-facing responses."""
        return _post_comment_data(ticket_id, body, public=True)
  • Core helper function _post_comment_data that creates a Zenpy Ticket and Comment object, calls client.tickets.update() to submit the comment/public note, and returns a success/error message.
    def _post_comment_data(ticket_id: int, body: str, public: bool) -> str:
        try:
            client = get_client()
            ticket = Ticket(id=ticket_id)
            ticket.comment = Comment(body=body, public=public)
            client.tickets.update(ticket)
            label = "Public comment" if public else "Internal note"
            return f"{label} posted successfully on ticket #{ticket_id}."
        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}"
  • Registration function that decorates the tool handler with @mcp.tool() and is called from server.py to register the zendesk_post_comment tool.
    def register_write_comment_tools(mcp) -> None:
        @mcp.tool()
        def zendesk_post_comment(ticket_id: int, body: str) -> str:
            """Post a public reply on a Zendesk ticket. The reply is visible to the requester. Use for customer-facing responses."""
            return _post_comment_data(ticket_id, body, public=True)
    
        @mcp.tool()
        def zendesk_post_internal_note(ticket_id: int, body: str) -> str:
            """Post an internal note on a Zendesk ticket. Internal notes are only visible to agents and are not sent to the requester."""
            return _post_comment_data(ticket_id, body, public=False)
  • Import and call that registers the write_comment tools (including zendesk_post_comment) on the MCP server.
    from zendesk_mcp.tools.write_comments import register_write_comment_tools
    from zendesk_mcp.tools.update_ticket import register_update_ticket_tools
    from zendesk_mcp.tools.time_tracking import register_time_tracking_tools
    from zendesk_mcp.tools.git_zen import register_git_zen_tools
    from zendesk_mcp.tools.create_ticket import register_create_ticket_tools
    from zendesk_mcp.tools.list_tickets import register_list_tickets_tools
    from zendesk_mcp.tools.knowledge_base import register_knowledge_base_resource
    from zendesk_mcp.tools.tags import register_tag_tools
    from zendesk_mcp.tools.views import register_view_tools
    from zendesk_mcp.tools.macros import register_macro_tools
    from zendesk_mcp.tools.users import register_user_tools
    from zendesk_mcp.tools.groups import register_group_tools
    from zendesk_mcp.tools.organizations import register_organization_tools
    from zendesk_mcp.tools.custom_statuses import register_custom_status_tools
    from zendesk_mcp.prompts import register_prompts
    
    register_ticket_tools(mcp)
    register_comments_tools(mcp)
    register_attachment_tools(mcp)
    register_gitlab_context_tools(mcp)
    register_write_comment_tools(mcp)
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 mentions that the reply is visible to the requester, which is useful. However, it does not disclose any side effects, permission requirements, or constraints (e.g., ticket must be open).

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 the essential action and purpose. Every sentence adds value, with no redundant or unnecessary information.

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?

Given the tool's simplicity and the presence of an output schema, the description covers the key aspects. It explains the purpose and visibility. It could mention that it expects a ticket ID and body, but these are clear from the schema. It is adequate for a low-complexity tool.

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 0%, so the description should add meaning to parameters. It provides no additional information beyond the parameter names and types. The parameters are self-explanatory, but the description fails to add context like formatting 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?

The description clearly states the action (post a public reply), the resource (Zendesk ticket), and the use case (customer-facing responses). It distinguishes itself from a sibling tool like zendesk_post_internal_note.

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?

It explicitly says 'Use for customer-facing responses,' which guides the agent on when to use this tool. It does not explicitly mention when not to use it, but the context implies it is for public replies only.

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