Skip to main content
Glama
effytech

Freshdesk MCP server

by effytech

create_group

Automate support operations by creating groups in Freshdesk through the MCP server. Enhance ticket management and streamline customer support processes using structured group fields.

Instructions

Create a group in Freshdesk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
group_fieldsYes

Implementation Reference

  • The main handler function for the 'create_group' tool. It validates the input using the GroupCreate Pydantic model and sends a POST request to the Freshdesk API to create a new group.
    @mcp.tool()
    async def create_group(group_fields: Dict[str, Any]) -> Dict[str, Any]:
        """Create a group in Freshdesk."""
        # Validate input using Pydantic model
        try:
            validated_fields = GroupCreate(**group_fields)
            # Convert to dict for API request
            group_data = validated_fields.model_dump(exclude_none=True)
        except Exception as e:
            return {"error": f"Validation error: {str(e)}"}
    
        url = f"https://{FRESHDESK_DOMAIN}/api/v2/groups"
        headers = {
            "Authorization": f"Basic {base64.b64encode(f'{FRESHDESK_API_KEY}:X'.encode()).decode()}",
            "Content-Type": "application/json"
        }
    
        async with httpx.AsyncClient() as client:
            try:
                response = await client.post(url, headers=headers, json=group_data)
                response.raise_for_status()
                return response.json()
            except httpx.HTTPStatusError as e:
                return {
                    "error": f"Failed to create group: {str(e)}",
                    "details": e.response.json() if e.response else None
                }
  • Pydantic model defining the schema and validation rules for the input parameters of the create_group tool.
    class GroupCreate(BaseModel):
        name: str = Field(..., description="Name of the group")
        description: Optional[str] = Field(None, description="Description of the group")
        agent_ids: Optional[List[int]] = Field(
            default=None,
            description="Array of agent user ids"
        )
        auto_ticket_assign: Optional[int] = Field(
            default=0,
            ge=0,
            le=1,
            description="Automatic ticket assignment type (0 or 1)"
        )
        escalate_to: Optional[int] = Field(
            None,
            description="User ID to whom escalation email is sent if ticket is unassigned"
        )
        unassigned_for: Optional[UnassignedForOptions] = Field(
            default=UnassignedForOptions.THIRTY_MIN,
            description="Time after which escalation email will be sent"
        )
  • The @mcp.tool() decorator registers the create_group function as an MCP tool with the name 'create_group'.
    @mcp.tool()
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. It states 'Create' implies a write operation but doesn't specify required permissions, potential side effects, error conditions, or response format. This is a significant gap for a mutation tool with zero annotation coverage.

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 a single, efficient sentence with no wasted words, making it easy to parse and front-loaded with the core action. It appropriately sized for the basic information it conveys.

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?

Given the complexity of a creation tool with no annotations, 0% schema coverage, no output schema, and a nested object parameter, the description is incomplete. It lacks details on parameters, behavioral traits, and usage context, making it inadequate for effective tool invocation.

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%, and the description provides no information about the single parameter 'group_fields'. It doesn't explain what fields are needed, their types, or examples, failing to compensate for the lack of schema documentation.

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 verb ('Create') and resource ('a group in Freshdesk'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'update_group' or 'list_groups', which would require mentioning creation versus modification or listing.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing admin permissions or when to choose 'create_group' over 'update_group' or 'list_groups', leaving the agent without context for selection.

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