Skip to main content
Glama
effytech

Freshdesk MCP server

by effytech

update_ticket

Modify ticket details in Freshdesk using the MCP server. Input the ticket ID and updated fields to automate and streamline support ticket management.

Instructions

Update a ticket in Freshdesk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ticket_fieldsYes
ticket_idYes

Implementation Reference

  • The core handler function for the update_ticket tool, including the @mcp.tool() decorator which also serves as its registration in the FastMCP server. This async function handles updating a Freshdesk ticket by sending a PUT request to the tickets/{ticket_id} endpoint with the provided ticket_fields, handling custom fields separately, and returning success/error responses.
    @mcp.tool()
    async def update_ticket(ticket_id: int, ticket_fields: Dict[str, Any]) -> Dict[str, Any]:
        """Update a ticket in Freshdesk."""
        if not ticket_fields:
            return {"error": "No fields provided for update"}
    
        url = f"https://{FRESHDESK_DOMAIN}/api/v2/tickets/{ticket_id}"
        headers = {
            "Authorization": f"Basic {base64.b64encode(f'{FRESHDESK_API_KEY}:X'.encode()).decode()}",
            "Content-Type": "application/json"
        }
    
        # Separate custom fields from standard fields
        custom_fields = ticket_fields.pop('custom_fields', {})
    
        # Prepare the update data
        update_data = {}
    
        # Add standard fields if they are provided
        for field, value in ticket_fields.items():
            update_data[field] = value
    
        # Add custom fields if they exist
        if custom_fields:
            update_data['custom_fields'] = custom_fields
    
        async with httpx.AsyncClient() as client:
            try:
                response = await client.put(url, headers=headers, json=update_data)
                response.raise_for_status()
    
                return {
                    "success": True,
                    "message": "Ticket updated successfully",
                    "ticket": response.json()
                }
    
            except httpx.HTTPStatusError as e:
                error_message = f"Failed to update ticket: {str(e)}"
                try:
                    error_details = e.response.json()
                    if "errors" in error_details:
                        error_message = f"Validation errors: {error_details['errors']}"
                except Exception:
                    pass
                return {
                    "success": False,
                    "error": error_message
                }
            except Exception as e:
                return {
                    "success": False,
                    "error": f"An unexpected error occurred: {str(e)}"
                }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Update' implies a mutation operation, the description doesn't address important behavioral aspects like authentication requirements, rate limits, what fields can be updated, whether the operation is idempotent, or what happens on failure. This leaves significant gaps for an agent trying to use this tool effectively.

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 extremely concise at just 6 words, with zero wasted language. It's front-loaded with the essential information (update + ticket + Freshdesk context) in a single clear sentence.

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

Completeness2/5

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

For a mutation tool with 2 parameters (one being a nested object), 0% schema coverage, no annotations, and no output schema, the description is inadequate. It doesn't provide enough context about what the tool actually does, what parameters mean, what behavior to expect, or what the tool returns. The agent would struggle to use this tool correctly without additional information.

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?

With 0% schema description coverage for both parameters, the description provides no information about what 'ticket_id' and 'ticket_fields' represent or how they should be used. The description doesn't compensate for this complete lack of parameter documentation in the schema, leaving the agent with no guidance on what data to provide.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Update') and resource ('a ticket in Freshdesk'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from sibling update tools like update_ticket_conversation or update_ticket_summary, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There are multiple sibling tools for updating ticket-related entities (update_ticket_conversation, update_ticket_summary, etc.), but no indication of when this specific ticket update tool is appropriate versus those other options.

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

Related 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/effytech/freshdesk_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server