Skip to main content
Glama
effytech

Freshdesk MCP server

by effytech

create_agent

Create an agent within Freshdesk to manage support operations. Define agent details to streamline ticket handling and enhance customer support efficiency.

Instructions

Create an agent in Freshdesk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_fieldsYes

Implementation Reference

  • The primary handler function for the 'create_agent' tool. It is decorated with @mcp.tool(), which registers it in the FastMCP server. Performs input validation for required fields (email, ticket_scope) and makes a POST request to the Freshdesk API to create a new agent.
    @mcp.tool()
    async def create_agent(agent_fields: Dict[str, Any]) -> Dict[str, Any]:
        """Create an agent in Freshdesk."""
        # Validate mandatory fields
        if not agent_fields.get("email") or not agent_fields.get("ticket_scope"):
            return {
                "error": "Missing mandatory fields. Both 'email' and 'ticket_scope' are required."
            }
        if agent_fields.get("ticket_scope") not in [e.value for e in AgentTicketScope]:
            return {
                "error": "Invalid value for ticket_scope. Must be one of: " + ", ".join([e.name for e in AgentTicketScope])
            }
    
        url = f"https://{FRESHDESK_DOMAIN}/api/v2/agents"
        headers = {
            "Authorization": f"Basic {base64.b64encode(f'{FRESHDESK_API_KEY}:X'.encode()).decode()}"
        }
    
        async with httpx.AsyncClient() as client:
            try:
                response = await client.post(url, headers=headers, json=agent_fields)
                response.raise_for_status()
                return response.json()
            except httpx.HTTPStatusError as e:
                return {
                    "error": f"Failed to create agent: {str(e)}",
                    "details": e.response.json() if e.response else None
                }
  • IntEnum defining the possible ticket scope values (GLOBAL_ACCESS=1, GROUP_ACCESS=2, RESTRICTED_ACCESS=3) used for validating the 'ticket_scope' field in the create_agent handler.
    class AgentTicketScope(IntEnum):
        GLOBAL_ACCESS = 1
        GROUP_ACCESS = 2
        RESTRICTED_ACCESS = 3
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool creates an agent but offers no additional context about what this entails—such as required authentication, potential side effects (e.g., email notifications), rate limits, or what happens on failure. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse. Every part of the sentence earns its place by conveying essential information concisely.

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 tool's complexity (a mutation operation with nested object parameters), lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't address key aspects like what data is needed for creation, what the tool returns, or behavioral traits. For a create tool in a system with many siblings, more context is needed to guide effective use.

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?

The input schema has 1 parameter with 0% description coverage, and the description provides no information about parameters. It doesn't explain what 'agent_fields' should contain, such as required fields (e.g., name, email) or format. With low schema coverage, the description fails to compensate, leaving the parameter's meaning unclear beyond its name.

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 ('Create') and resource ('an agent in Freshdesk'), making the purpose immediately understandable. It distinguishes from sibling tools like 'update_agent' or 'get_agents' by specifying creation rather than modification or retrieval. However, it doesn't explicitly differentiate from other creation tools like 'create_group' or 'create_contact_field' beyond the resource type.

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. It doesn't mention prerequisites (e.g., required permissions), when not to use it (e.g., for updating existing agents), or direct alternatives like 'update_agent' for modifications. Usage is implied only by the verb 'Create,' but no explicit context or exclusions are provided.

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