zendesk_list_custom_statuses
Retrieve all custom ticket statuses from Zendesk, including IDs, labels, and status categories. Use the returned IDs to set custom statuses on tickets.
Instructions
List all custom ticket statuses defined in Zendesk. Returns JSON array of {id, agent_label, end_user_label, status_category, active, default}. Use the id when setting custom_status_id on a ticket.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The tool handler function that is exposed as an MCP tool. It delegates to _list_custom_statuses_data() to fetch and return the data.
def zendesk_list_custom_statuses() -> str: """List all custom ticket statuses defined in Zendesk. Returns JSON array of {id, agent_label, end_user_label, status_category, active, default}. Use the id when setting custom_status_id on a ticket.""" return _list_custom_statuses_data() - Helper function that performs the actual API call to Zendesk's /api/v2/custom_statuses endpoint, extracts relevant fields, and returns a JSON string.
def _list_custom_statuses_data() -> str: try: subdomain, token = get_oauth_session() except ConfigError as e: return str(e) url = f"https://{subdomain}.zendesk.com/api/v2/custom_statuses" try: response = httpx.get(url, headers={"Authorization": f"Bearer {token}"}, timeout=30) response.raise_for_status() statuses = response.json().get("custom_statuses", []) return json.dumps([{ "id": s.get("id"), "agent_label": s.get("agent_label"), "end_user_label": s.get("end_user_label"), "status_category": s.get("status_category"), "active": s.get("active"), "default": s.get("default"), } for s in statuses], indent=2) except Exception as e: return f"Zendesk API error: {e}" - src/zendesk_mcp/tools/custom_statuses.py:28-32 (registration)Registration function that decorates the handler with @mcp.tool() to register it as an MCP tool.
def register_custom_status_tools(mcp) -> None: @mcp.tool() def zendesk_list_custom_statuses() -> str: """List all custom ticket statuses defined in Zendesk. Returns JSON array of {id, agent_label, end_user_label, status_category, active, default}. Use the id when setting custom_status_id on a ticket.""" return _list_custom_statuses_data() - src/zendesk_mcp/server.py:30-50 (registration)Import and invocation of the registration function from server.py main() to hook the tool into the MCP server.
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) register_update_ticket_tools(mcp) register_time_tracking_tools(mcp) register_git_zen_tools(mcp) register_create_ticket_tools(mcp) register_list_tickets_tools(mcp) register_knowledge_base_resource(mcp) register_tag_tools(mcp) register_view_tools(mcp) register_macro_tools(mcp) register_user_tools(mcp) register_group_tools(mcp) register_organization_tools(mcp) register_custom_status_tools(mcp)