view_company
Retrieve company details from Freshdesk using a specific company ID to streamline customer support operations and enhance data accessibility within the MCP server.
Instructions
Get a company in Freshdesk.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| company_id | Yes |
Implementation Reference
- src/freshdesk_mcp/server.py:1104-1122 (handler)Handler function for the 'view_company' MCP tool. Decorated with @mcp.tool() for automatic registration. Retrieves specific company details from the Freshdesk API using the provided company_id.@mcp.tool() async def view_company(company_id: int) -> Dict[str, Any]: """Get a company in Freshdesk.""" url = f"https://{FRESHDESK_DOMAIN}/api/v2/companies/{company_id}" 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.get(url, headers=headers) response.raise_for_status() return response.json() except httpx.HTTPStatusError as e: return {"error": f"Failed to fetch company: {str(e)}"} except Exception as e: return {"error": f"An unexpected error occurred: {str(e)}"}