zendesk_post_internal_note
Post an internal note on a Zendesk ticket to communicate with agents 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. Calls _post_comment_data with public=False to post an internal (agent-only) note on a Zendesk ticket.
@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) - Shared helper _post_comment_data that handles the actual Zendesk API call via Zenpy client. Creates a Ticket with a Comment (public or internal) and updates it.
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:26-31 (registration)Registration call that registers all write_comment tools (including zendesk_post_internal_note) via register_write_comment_tools(mcp).
register_write_comment_tools(mcp) register_update_ticket_tools(mcp) register_time_tracking_tools(mcp) register_git_zen_tools(mcp) mcp.run() - src/zendesk_mcp/tools/write_comments.py:22-29 (registration)Registration function that decorates both zendesk_post_comment and zendesk_post_internal_note with @mcp.tool() on the FastMCP instance.
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: - src/zendesk_mcp/client.py:10-16 (helper)The get_client() helper used by _post_comment_data to obtain a Zenpy client configured with subdomain and OAuth token.
def get_client(config_file: Path | None = None) -> Zenpy: cfg = load_config(config_file) subdomain = cfg.get("subdomain", "").strip() token = cfg.get("oauth_token", "").strip() if not subdomain or not token: raise ConfigError("Zendesk not configured. Run: zendesk-mcp setup") return Zenpy(subdomain=subdomain, oauth_token=token)