Skip to main content
Glama

goodday-mcp

by cdmx-in
main.cpython-313.pyc18.4 kB
� �Oh$4����SSKJrJrJr SSKrSSKrSSKJr SSKJr \"S5r Sr Sr S=S\ S \ S \ S \ \ \4S-4S jjrS \ S \ 4SjrS\ S \ 4SjrS\ S \ 4Sjr\ R%5S>S\S\S \ 4Sjj5r\ R%5S\ S \ 4Sj5r\ R%5S?S\ S\ S\ S\\ S\\S\\ S\\ S\\ S \\ S \ 4S!jj5r\ R%5S>S\ S"\S#\S \ 4S$jj5r\ R%5S@S%\ S"\S \ 4S&jj5r\ R%5S%\ S \ 4S'j5r\ R%5S(\ S \ 4S)j5r\ R%5SAS\ S*\ S+\ S,\\ S-\\ S.\\ S/\\ S\\ S\\ S \\ S0\\S1\\S2\\S \ 4S3jj5r\ R%5SBS(\ S%\ S4\ S-\\ S \ 4 S5jj5r\ R%5S(\ S%\ S-\ S \ 4S6j5r\ R%5S \ 4S7j5r\ R%5S%\ S \ 4S8j5r \ R%5S\ S \ 4S9j5r!\"S::Xa\ RGS;S<9 gg)C�)�Any�Optional�ListN)�datetime)�FastMCPz goodday-mcpzhttps://api.goodday.work/2.0zgoodday-mcp/1.0�endpoint�method�data�returnc��<# �[R"S5nU(d [S5e[USS.n[SUR S53n[ R"5IShv�N nUR5S:XaURXTUSS 9IShv�N nOsUR5S :XaURXTUSS 9IShv�N nOEUR5S :XaURXTSS 9IShv�N nOURXTSS 9IShv�N nUR5 UR5sSSS5IShv�N $N�N�NNTN=N![a)nS [!U50sSnAsSSS5IShv�N $SnAff=f!,IShv�N (df  g=f7f)z=Make a request to the Goodday API with proper error handling.�GOODDAY_API_TOKENz2GOODDAY_API_TOKEN environment variable is requiredzapplication/json)z User-Agentz gd-api-tokenz Content-Type�/N�POSTg>@)�headers�json�timeout�PUT�DELETE)rr�error)�os�getenv� ValueError� USER_AGENT�GOODDAY_API_BASE�lstrip�httpx� AsyncClient�upper�post�put�delete�get�raise_for_statusr� Exception�str) rr r � api_tokenr�url�client�response�es �/home/roney/goodday-mcp/main.py�make_goodday_requestr,sW���� � �-�.�I� ��M�N�N�!�!�*��G� � �a����� 4�5� 6�C�� � �"�"�f� %��|�|�~��'�!'���S��VZ��![�[������5�(�!'���C�t�UY��!Z�Z������8�+�!'���s�T��!R�R��!'���C�$��!O�O�� � %� %� '��=�=�?�#�"�"�\�Z�R�O�#��� %��S��V�$� $�#�"�"�� %��#�"�"�s��A&F�(E�)F�,F�.(E �E�-E �E�,E �1E�2E � E� #E �. F�:E �;F�E �E �E �E � F� E?� E:�"E?�#F�' F�3E6�4F�:E?�?F�F�F � F�F�taskc� �SURSS5SURSS5SURS05RSS5S URS 05RSS5S URS 05RSS 5SURSS5SURSS5SURSS5SURSS5SURSS5SURSS5S3$)z%Format a task into a readable string.z Task ID: �id�N/Az Title: �title� Status: �status�namez Project: �projectz Assigned To: �assignedToUser� Unassignedz Priority: �priority� Start Date: � startDate� End Date: �endDatez Deadline: �deadline� Progress: �progressrz% Description: �messagezNo description� �r")r-s r+� format_taskrC,s-�� � �(�(�4�� � �!� ����%� �!�" � ���(�B� � #� #�F�E� 2�3�4 � �(�(�9�b� !� %� %�f�e� 4� 5�6��h�h�'��,�0�0���F� G�H � �8�8�J�� &� '�( � �X�X�k�5� )� *�+ � �8�8�I�u� %� &�' � �8�8�J�� &� '�( � �8�8�J�� "� #�$��h�h�y�"2�3� 4�5� � �r5c�x�SURSS5SURSS5SURSS5SURS 05RSS5S URS S5S URS S5SURSS5SURS05RSS5S3$)z(Format a project into a readable string.z Project ID: r/r0� Name: r4z Health: �healthr2r3r9r:r;r<r>r?rz % Owner: �ownerrArB)r5s r+�format_projectrI<s��� � �[�[��u� %� &�'��{�{�6�5�!�"�# � ���X�u� %�&�' � ���X�r� "� &� &�v�u� 5�6�7 � �[�[��e� ,� -�. � �;�;�y�%� (� )�* � �;�;�z�1� %� &�'�� � �G�R� �$�$�V�U�3�4�5� � rD�userc ���SURSS5SURSS5SURSS5SURS 05RSS5S URS S5S 3 $) z%Format a user into a readable string.z User ID: r/r0rFr4z Email: �emailz Role: �roler2r3rArB)rJs r+� format_userrNIs��� � �(�(�4�� � �!� �x�x����� � ����%� �!�"� �x�x��������.�/�0 � ���(�E� "�#�$�  �rD�archived� root_onlyc��# �/nU(aURS5 U(aURS5 SnU(aUSSRU5-- n[U5IShv�N nU(aSU;aSURSS 53$U(dg UVs/sHn[ U5PM nnS RU5$NZs snf7f) z�Get list of projects from Goodday. Args: archived: Set to true to retrieve archived/closed projects root_only: Set to true to return only root projects z archived=truez rootOnly=true�projects�?�&NrzUnable to fetch projects: � Unknown errorzNo projects found.� --- )�append�joinr,r"rI)rOrP�paramsrr r5rRs r+� get_projectsrZTs�����F��� � �o�&��� � �o�&��H� ��C�#�(�(�6�*�*�*��%�h�/� /�D� �7�d�?�+�D�H�H�W�o�,N�+O�P�P� �#�7;�<�t�G��w�'�t�H�<� �>�>�(� #�#� 0��=�s$�A!C�#B>�$2C�C�+C�C� project_idc��# �[SU35IShv�N nU(aSU;aSURSS53$[U5$N17f)z\Get details of a specific project. Args: project_id: The ID of the project to retrieve �project/NrzUnable to fetch project: rU�r,r"rI)r[r s r+� get_projectr_qsM���&��� �&=�>� >�D� �7�d�?�*�4�8�8�G�_�+M�*N�O�O� �$� �� ?���A�A�2Ar4�created_by_user_id�project_template_id�parent_project_id�color�project_owner_user_id� start_date�end_dater=c ��(# �UUUS.n U(aX9S'U(aXIS'U(aXYS'U(aXiS'U(aXyS'U(aX�S'[SS U 5IS hv�N n U (aS U ;aS U RS S 53$S[U 53$N47f)u�Create a new project in Goodday. Args: name: Project name created_by_user_id: ID of user creating the project project_template_id: Project template ID (found in Organization settings → Project templates) parent_project_id: Parent project ID to create a sub project color: Project color (1-24) project_owner_user_id: Project owner user ID start_date: Project start date (YYYY-MM-DD) end_date: Project end date (YYYY-MM-DD) deadline: Project deadline (YYYY-MM-DD) )r4�createdByUserId�projectTemplateId�parentProjectIdrd�projectOwnerUserIdr:r<r=zprojects/new-projectrNrzUnable to create project: rUzProject created successfully: r^) r4rarbrcrdrerfrgr=r �results r+�create_projectrns����4�-�0� �D� �"3� �� ��W� ��%:� !�"��&�[���"�Y���#�Z��'�(>���M� M�F� �W��&�+�F�J�J�w��,P�+Q�R�R� +�N�6�,B�+C� D�D� N�s�AB�B�5B�closed� subfoldersc��# �/nU(aURS5 U(aURS5 SUS3nU(aUSSRU5-- n[U5IShv�N nU(aSU;aS URSS 53$U(dg UVs/sHn[ U5PM nnS RU5$NZs snf7f) z�Get tasks from a specific project. Args: project_id: The ID of the project closed: Set to true to retrieve all open and closed tasks subfolders: Set to true to return tasks from project subfolders � closed=truezsubfolders=truer]z/tasksrSrTNrzUnable to fetch tasks: rUzNo tasks found.rV�rWrXr,r"rC)r[rorprYrr r-�taskss r+�get_project_tasksru�s�����F� �� � �m�$��� � �'�(��*��V�,�H� ��C�#�(�(�6�*�*�*��%�h�/� /�D� �7�d�?�(����'�?�)K�(L�M�M� � �+/� 0�4�4�[�� �4�E� 0� �>�>�%� � � 0�� 1�s$�A%C �'C�(2C �C�/C �C �user_idc��f# �/nU(aURS5 SUS3nU(aUSSRU5-- n[U5IShv�N nU(aSU;aSURSS 53$U(dg UVs/sHn[ U5PM nnS RU5$NZs snf7f) z�Get tasks assigned to a specific user. Args: user_id: The ID of the user closed: Set to true to retrieve all open and closed tasks rr�user/z/assigned-tasksrSrTNrz Unable to fetch assigned tasks: rUzNo assigned tasks found.rVrs)rvrorYrr r-rts r+�get_user_assigned_tasksry�s�����F� �� � �m�$��w�i��/�H� ��C�#�(�(�6�*�*�*��%�h�/� /�D� �7�d�?�1�$�(�(�7�O�2T�1U�V�V� �)�+/� 0�4�4�[�� �4�E� 0� �>�>�%� � � 0�� 1�s$�A B1�B*�2B1�B,�B1�,B1c���# �[SUS35IShv�N nU(aSU;aSURSS53$U(dgUVs/sHn[U5PM nnSRU5$NZs snf7f) zVGet action required tasks for a specific user. Args: user_id: The ID of the user rxz/action-required-tasksNrz'Unable to fetch action required tasks: rUzNo action required tasks found.rV)r,r"rCrX)rvr r-rts r+�get_user_action_required_tasksr{�sy���&��g�Y�6L�&M�N� N�D� �7�d�?�8����'�?�9[�8\�]�]� �0�+/� 0�4�4�[�� �4�E� 0� �>�>�%� � � O�� 1��!�A7�A0�2A7�A2�A7�2A7�task_idc��# �[SU35IShv�N nU(aSU;aSURSS53$[U5$N17f)zSGet details of a specific task. Args: task_id: The ID of the task to retrieve �task/NrzUnable to fetch task: rU�r,r"rC)r}r s r+�get_taskr���M���&��g�Y�&7�8� 8�D� �7�d�?�'�����/�(J�'K�L�L� �t� �� 9�r`r1� from_user_id�parent_task_idr@� to_user_id� task_type_id�estimate� story_pointsr8c ��# �UUUS.n U(aX=S'U(aXMS'U(aX]S'U(aXmS'U(aX}S'U(aX�S'U (aX�S'U (aX�S 'U (aX�S 'U (aX�S '[S S U 5IShv�N nU(aSU;aSURSS53$S[U53$N47f)aTCreate a new task in Goodday. Args: project_id: Task project ID title: Task title from_user_id: Task created by user ID parent_task_id: Parent task ID to create a subtask message: Task description/initial message to_user_id: Assigned To/Action required user ID task_type_id: Task type ID start_date: Task start date (YYYY-MM-DD) end_date: Task end date (YYYY-MM-DD) deadline: Task deadline (YYYY-MM-DD) estimate: Task estimate in minutes story_points: Task story points estimate priority: Task priority (1-10), 50 - Blocker, 100 - Emergency )� projectIdr1� fromUserId� parentTaskIdr@�toUserId� taskTypeIdr:r<r=r�� storyPointsr8rtrNrzUnable to create task: rUzTask created successfully: r�)r[r1r�r�r@r�r�rfrgr=r�r�r8r rms r+� create_taskr� s����D ��"� �D� �-�^���!�Y���%�Z���)�\���&�[���"�Y���#�Z���#�Z���*�]���#�Z��'����>� >�F� �W��&�(����G�_�)M�(N�O�O� (��V�)<�(=� >�>� ?�s�BB>�B<�5B>� status_idc��# �UUS.nU(aX4S'[SUS3SU5IShv�N nU(aSU;aSURSS 53$g N'7f) z�Update the status of a task. Args: task_id: The ID of the task to update user_id: User on behalf of whom API will execute update status_id: New status ID message: Optional comment )�userId�statusIdr@rz/statusrNrzUnable to update task status: rUz Task status updated successfully�r,r")r}rvr�r@r rms r+�update_task_statusr�Osf����� �D� �!�Y��'�%��y��(@�%��N� N�F� �W��&�/�� � �7�O�0T�/U�V�V�.� O�s�%A�A�(Ac��# �UUS.n[SUS3SU5IShv�N nU(aSU;aSURSS53$g N'7f) z�Add a comment to a task. Args: task_id: The ID of the task user_id: User on behalf of whom API will execute update message: Comment text )r�r@rz/commentrNrzUnable to add comment: rUzComment added successfullyr�)r}rvr@r rms r+�add_task_commentr�hs\����� �D� (�%��y��(A�6�4�P� P�F� �W��&�(����G�_�)M�(N�O�O�(� Q�s�A�A�(Ac���# �[S5IShv�N nU(aSU;aSURSS53$U(dgUVs/sHn[U5PM nnSRU5$NZs snf7f)zGet list of organization users.�usersNrzUnable to fetch users: rUzNo users found.rV�r,r"rNrX)r rJr�s r+� get_usersr�~sn���&�g�.� .�D� �7�d�?�(����'�?�)K�(L�M�M� � �+/� 0�4�4�[�� �4�E� 0� �>�>�%� � � /�� 1�s!�A3�A,�2A3�A.�A3�.A3c��# �[SU35IShv�N nU(aSU;aSURSS53$[U5$N17f)zSGet details of a specific user. Args: user_id: The ID of the user to retrieve rxNrzUnable to fetch user: rU)r,r"rN)rvr s r+�get_userr��r�r`c���# �[SUS35IShv�N nU(aSU;aSURSS53$U(dgUVs/sHn[U5PM nnSRU5$NZs snf7f) z[Get users associated with a specific project. Args: project_id: The ID of the project r]z/usersNrzUnable to fetch project users: rUz No users found for this project.rVr�)r[r rJr�s r+�get_project_usersr��sx���&��� �F�&C�D� D�D� �7�d�?�0����'�?�1S�0T�U�U� �1�+/� 0�4�4�[�� �4�E� 0� �>�>�%� � � E�� 1�r|�__main__�stdio)� transport)�GETN)FF)NNNNNN)F) NNNNNNNNNN)N)$�typingrrrrrr�mcp.server.fastmcpr�mcprrr%�dictr,rCrIrN�tool�boolrZr_�intrnruryr{r�r�r�r�r�r�r��__name__�run�rDr+�<module>r�sa��&�&� � ��&��m���2�� � �%��%�c�%��%�Y]�^a�cf�^f�Yg�jn�Yn�%�<�d��s�� �D� �S� ��d��s������$��$�$�$�3�$� �$�8����  �#�  �#�  � �  ����� (,��+/� $�"�"�0E� �0E��0E��0E� ��}� 0E� �C�=� 0E� $�C�=� 0E��� �0E��s�m�0E��s�m�0E� �0E� �0E�f����!��!�T�!�t�!�`c�!� �!�:����!�3�!��!��!� �!�4����!�#�!�#�!� �!�"���� �C� �C� � � ����� %)�!� $�"&� $�"�"�"�"&�"�@?��@?� �@?��@?��S�M� @?� �c�]� @?� �� � @?��3�-�@?��� �@?��s�m�@?��s�m�@?��s�m�@?��3�-�@?��s�m�@?� �@?� �@?�D����/�c�/�C�/�C�/�RZ�[^�R_�/�kn�/� �/�0����)�C�)�#�)��)��)� �)�*���� !�� !� � !����� �C� �C� � � �����!��!��!� �!�" �z���G�G�g�G��rD

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/cdmx-in/goodday-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server