Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/freshservice_mcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1599,7 +1599,7 @@ async def update_ticket_conversation(conversation_id: int,body: str)-> Dict[str,
if status_code == 200:
return response.json()
else:
return f"Cannot update conversation ${response.json()}"
return {"error": "Cannot update conversation", "details": response.json()}

#GET ALL TICKET CONVERSATION
@mcp.tool()
Expand All @@ -1614,7 +1614,7 @@ async def list_all_ticket_conversation(ticket_id: int)-> Dict[str, Any]:
if status_code == 200:
return response.json()
else:
return f"Cannot fetch ticket conversations ${response.json()}"
return {"error": "Cannot fetch ticket conversations", "details": response.json()}

#GET ALL PRODUCTS
@mcp.tool()
Expand Down Expand Up @@ -1675,7 +1675,7 @@ async def get_products_by_id(product_id:int)-> Dict[str, Any]:
if status_code == 200:
return response.json()
else:
return f"Cannot fetch products from the freshservice ${response.json()}"
return {"error": "Cannot fetch products from the freshservice", "details": response.json()}

#CREATE PRODUCT
@mcp.tool()
Expand Down Expand Up @@ -1961,7 +1961,7 @@ async def get_requester_id(requester_id:int)-> Dict[str, Any]:
if status_code == 200:
return response.json()
else:
return f"Cannot fetch requester from the freshservice ${response.json()}"
return {"error": "Cannot fetch requester from the freshservice", "details": response.json()}

#LIST ALL REQUESTER FIELDS
@mcp.tool()
Expand All @@ -1976,7 +1976,7 @@ async def list_all_requester_fields()-> Dict[str, Any]:
if status_code == 200:
return response.json()
else:
return f"Cannot fetch requester from the freshservice ${response.json()}"
return {"error": "Cannot fetch requester from the freshservice", "details": response.json()}

#UPDATE REQUESTER
@mcp.tool()
Expand Down Expand Up @@ -2106,7 +2106,7 @@ async def get_agent(agent_id:int)-> Dict[str, Any]:
if status_code == 200:
return response.json()
else:
return f"Cannot fetch requester from the freshservice ${response.json()}"
return {"error": "Cannot fetch requester from the freshservice", "details": response.json()}

#GET ALL AGENTS
@mcp.tool()
Expand Down Expand Up @@ -2221,7 +2221,7 @@ async def update_agent(agent_id, occasional=None, email=None, department_ids=Non
if status_code == 200:
return response.json()
else:
return f"Cannot fetch agents from the freshservice ${response.json()}"
return {"error": "Cannot fetch agents from the freshservice", "details": response.json()}

#GET AGENT FIELDS
@mcp.tool()
Expand All @@ -2236,7 +2236,7 @@ async def get_agent_fields()-> Dict[str, Any]:
if status_code == 200:
return response.json()
else:
return f"Cannot fetch agents from the freshservice ${response.json()}"
return {"error": "Cannot fetch agents from the freshservice", "details": response.json()}

#GET ALL AGENT GROUPS
@mcp.tool()
Expand All @@ -2251,7 +2251,7 @@ async def get_all_agent_groups()-> Dict[str, Any]:
if status_code == 200:
return response.json()
else:
return f"Cannot fetch agents from the freshservice ${response.json()}"
return {"error": "Cannot fetch agents from the freshservice", "details": response.json()}

#GET AGENT GROUP BY ID
@mcp.tool()
Expand All @@ -2266,7 +2266,7 @@ async def getAgentGroupById(group_id:int)-> Dict[str, Any]:
if status_code == 200:
return response.json()
else:
return f"Cannot fetch agents from the freshservice ${response.json()}"
return {"error": "Cannot fetch agents from the freshservice", "details": response.json()}

#ADD REQUESTER TO GROUP
@mcp.tool()
Expand Down Expand Up @@ -2415,7 +2415,7 @@ async def get_requester_groups_by_id(requester_group_id:int)-> Dict[str, Any]:
if status_code == 200:
return response.json()
else:
return f"Cannot fetch requester group from the freshservice ${response.json()}"
return {"error": "Cannot fetch requester group from the freshservice", "details": response.json()}

#CREATE REQUESTER GROUP
@mcp.tool()
Expand Down