Skip to main content
Glama
effytech

Freshdesk MCP server

by effytech

create_contact_field

Add custom contact fields in Freshdesk to store and organize specific customer information, enhancing support ticket management and personalization.

Instructions

Create a contact field in Freshdesk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contact_field_fieldsYes

Implementation Reference

  • The handler function for create_contact_field tool that validates input using ContactFieldCreate schema, makes POST request to Freshdesk API /contact_fields endpoint to create the field, and returns the response.
    @mcp.tool()
    async def create_contact_field(contact_field_fields: Dict[str, Any]) -> Dict[str, Any]:
        """Create a contact field in Freshdesk."""
        # Validate input using Pydantic model
        try:
            validated_fields = ContactFieldCreate(**contact_field_fields)
            # Convert to dict for API request
            contact_field_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/contact_fields"
        headers = {
            "Authorization": f"Basic {base64.b64encode(f'{FRESHDESK_API_KEY}:X'.encode()).decode()}"
        }
        async with httpx.AsyncClient() as client:
            response = await client.post(url, headers=headers, json=contact_field_data)
            return response.json()
  • Pydantic BaseModel schema defining the structure and validation rules for the input parameters to create_contact_field tool.
    class ContactFieldCreate(BaseModel):
        label: str = Field(..., description="Display name for the field (as seen by agents)")
        label_for_customers: str = Field(..., description="Display name for the field (as seen by customers)")
        type: str = Field(
            ...,
            description="Type of the field",
            pattern="^(custom_text|custom_paragraph|custom_checkbox|custom_number|custom_dropdown|custom_phone_number|custom_url|custom_date)$"
        )
        editable_in_signup: bool = Field(
            default=False,
            description="Set to true if the field can be updated by customers during signup"
        )
        position: int = Field(
            default=1,
            description="Position of the company field"
        )
        required_for_agents: bool = Field(
            default=False,
            description="Set to true if the field is mandatory for agents"
        )
        customers_can_edit: bool = Field(
            default=False,
            description="Set to true if the customer can edit the fields in the customer portal"
        )
        required_for_customers: bool = Field(
            default=False,
            description="Set to true if the field is mandatory in the customer portal"
        )
        displayed_for_customers: bool = Field(
            default=False,
            description="Set to true if the customers can see the field in the customer portal"
        )
        choices: Optional[List[Dict[str, Union[str, int]]]] = Field(
            default=None,
            description="Array of objects in format {'value': 'Choice text', 'position': 1} for dropdown choices"
        )
  • Registration of the create_contact_field tool using the @mcp.tool() decorator.
    @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' which implies a write operation, but doesn't mention potential side effects, authentication requirements, rate limits, or what happens on failure. This leaves significant gaps for a mutation tool.

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. It's front-loaded with the core action and resource, making it easy to scan and understand quickly.

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 no annotations, 0% schema coverage, no output schema, and a nested object parameter, the description is inadequate. It doesn't cover parameter details, behavioral traits, or usage context, making it incomplete for effective tool selection and 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%, so the description must compensate, but it provides no information about the single parameter 'contact_field_fields'. The description doesn't explain what fields are required, their formats, or examples, leaving the parameter entirely undocumented.

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 ('contact field in Freshdesk'), making the purpose evident. It distinguishes from siblings like 'create_ticket_field' by specifying the contact context, though it doesn't explicitly contrast with all similar tools.

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 like 'update_contact_field' or 'list_contact_fields'. The description lacks context about prerequisites, such as needing specific permissions or when contact fields are applicable.

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