update_contact_field
Modify specific fields for a contact in Freshdesk to maintain accurate and up-to-date customer information during support operations.
Instructions
Update a contact field in Freshdesk.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contact_field_fields | Yes | ||
| contact_field_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"contact_field_fields": {
"title": "Contact Field Fields",
"type": "object"
},
"contact_field_id": {
"title": "Contact Field Id",
"type": "integer"
}
},
"required": [
"contact_field_id",
"contact_field_fields"
],
"title": "update_contact_fieldArguments",
"type": "object"
}
Implementation Reference
- src/freshdesk_mcp/server.py:977-985 (handler)The handler function for the 'update_contact_field' tool. It is decorated with @mcp.tool() for registration and performs a PUT request to the Freshdesk API endpoint /contact_fields/{contact_field_id} to update the contact field with the provided fields.async def update_contact_field(contact_field_id: int, contact_field_fields: Dict[str, Any]) -> Dict[str, Any]: """Update a contact field in Freshdesk.""" url = f"https://{FRESHDESK_DOMAIN}/api/v2/contact_fields/{contact_field_id}" headers = { "Authorization": f"Basic {base64.b64encode(f'{FRESHDESK_API_KEY}:X'.encode()).decode()}" } async with httpx.AsyncClient() as client: response = await client.put(url, headers=headers, json=contact_field_fields) return response.json()
- src/freshdesk_mcp/server.py:112-148 (schema)Pydantic BaseModel schema defining the input structure and validation for contact fields, used in the create_contact_field tool and relevant for understanding the expected fields in updates.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" )