zendesk_post_internal_note
Post internal notes on Zendesk tickets for agent-only communication without notifying the requester.
Instructions
Post an internal note on a Zendesk ticket. Internal notes are only visible to agents and are not sent to the requester.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticket_id | Yes | ||
| body | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The tool handler for zendesk_post_internal_note. It calls the helper _post_comment_data with public=False, making the note internal (agent-only visibility).
@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) - Core helper function that creates the Zendesk API client, builds a Ticket with a Comment (public or private), and updates it via the Zenpy library. Handles configuration errors and API errors gracefully.
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}" - src/zendesk_mcp/server.py:37-37 (registration)Registration call in the main server function that registers all write comment tools (including zendesk_post_internal_note) on the FastMCP instance.
register_write_comment_tools(mcp) - src/zendesk_mcp/tools/write_comments.py:22-31 (registration)Registration function that uses @mcp.tool() decorator to register both zendesk_post_comment and zendesk_post_internal_note as MCP tools.
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)