Skip to main content
Glama
main.cpython-313.pyc22.6 kB
� �OhO?����SSKJrJrJr SSKrSSKrSSKJr SSKJr \"S5r Sr Sr S<S\ S \ S \ S \ \ \4\\-S-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'5S@S\ S*\ S+\ S,\\ S-\\ S.\\ S/\\ S\\ S\\ S \\ S0\\S1\\S2\\S \ 4S3jj5r\ R'5SAS(\ S%\ S4\ S-\\ S \ 4 S5jj5r\ R'5S(\ S%\ S-\ S \ 4S6j5r\ R'5S \ 4S7j5r \ R'5S%\ S \ 4S8j5r!\ R'5S\ S \ 4S9j5r"S:r#\$S;:Xa\#"5 gg)B�)�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�N�NUN>N![a$ S URS.ssSSS5IShv�N $f=f![ R aNnSSUR"R$SUR"R30sSnAsSSS5IShv�N $SnAf[ R&a,nSS[)U530sSnAsSSS5IShv�N $SnAf[*a,nSS[)U530sSnAsSSS5IShv�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)rrz Invalid JSON)�error� raw_responserz HTTP error z: zRequest error: zUnexpected error: )�os�getenv� ValueError� USER_AGENT�GOODDAY_API_BASE�lstrip�httpx� AsyncClient�upper�post�put�delete�get�raise_for_statusr�text�HTTPStatusError�response� status_code� RequestError�str� Exception) rr r � api_tokenr�url�clientr'�es �+/home/roney/goodday-mcp/goodday_mcp/main.py�make_goodday_requestr1s ���� � �-�.�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�� � %� %� '� P��}�}��#�"�"�\�Z�R�O�#��� P�!/����O�O�##�"�"� P���$�$� X��{�1�:�:�+A�+A�*B�"�Q�Z�Z�_�_�DU�V�W� W�)#�"�"��*�!�!� 9���s�1�v�h�7�8� 8�-#�"�"��.� <��1�#�a�&��:�;� ;�1#�"�"��. <��/#�"�"�sP�A&I/�(E�)I/�,I�.(E>�E�-E>�E�,E>�1E�2E>� E � E>� E �/ I/�;E �<I/�E>�E>�E>� E>� I/� E;�&E>�' I/�3E6�4I/�:E;�;E>�>I�1G�I�I� I/�G�I/�I�2H�I�I� I/�H�I/� I�&I �5I�6I�: I/�I �I/� I�I�I,�I � I,�(I/�taskc�V�[U[5(dS[U53$[URS5[5(aURS5O0n[URS5[5(aURS5O0n[URS5[5(aURS5O0nSURSS5SURS S5S URS S5S URS S5S URS S5SURSS5SURSS5SURSS5SURSS5SURSS5SURSS5S3R 5$)z6Format a task into a readable string with safe checks.zInvalid task data: �status�project�assignedToUserz Task ID: �id�N/Az Title: �title� Status: �namez Project: z Assigned To: � Unassignedz Priority: �priority� Start Date: � startDate� End Date: �endDatez Deadline: �deadline� Progress: �progressrz% Description: �messagezNo description� �� isinstance�dict�reprr#�strip)r2r4r5� assigned_users r0� format_taskrM6s��� �d�D� !� !�$�T�$�Z�L�1�1�$.�d�h�h�x�.@�$�#G�#G�T�X�X�h� �R�F�%/�����0C�T�%J�%J�d�h�h�y�!�PR�G�2<�T�X�X�FV�=W�Y]�2^�2^�D�H�H�-�.�df�M� � �(�(�4�� � �!� ����%� �!�" � ���F�E� "�#�$ � �+�+�f�e� $� %�&����� �5� 6�7 � �8�8�J�� &� '�( � �X�X�k�5� )� *�+ � �8�8�I�u� %� &�' � �8�8�J�� &� '�( � �8�8�J�� "� #�$��h�h�y�"2�3� 4�5� � �E�G�  �r5c�v�[U[5(dS[U53$[URS5[5(aURS5O0n[URS5[5(aURS5O0nSURSS5SURSS5S URS S5S URSS5S URS S5SURSS5SURSS5SURSS5S3R 5$)z9Format a project into a readable string with safe checks.zInvalid project data: r4�ownerz Project ID: r7r8� Name: r;z Health: �healthr:r>r?r@rArCrDrz % Owner: rFrG)r5r4rPs r0�format_projectrSNs6�� �g�t� $� $�'��W� ��7�7�'1����X�1F��&M�&M�W�[�[�� "�SU�F�$.�w�{�{�7�/C�T�$J�$J�G�K�K�� �PR�E� � �[�[��u� %� &�'��{�{�6�5�!�"�# � ���X�u� %�&�' � ���F�E� "�#�$ � �[�[��e� ,� -�. � �;�;�y�%� (� )�* � �;�;�z�1� %� &�'� � � �&�%� �!�"� � �E�G�  rN�userc ��[U[5(dS[U53$[URS5[5(aURS5O0nSURSS5SURSS5SURS S5S URSS5S URS S5S 3 R 5$)z6Format a user into a readable string with safe checks.zInvalid user data: �rolez User ID: r7r8rQr;z Email: �emailz Role: r:r4rFrG)rTrVs r0� format_userrXbs��� �d�D� !� !�$�T�$�Z�L�1�1� *�$�(�(�6�*:�D�A�A�4�8�8�F� �r�D� � �(�(�4�� � �!� �x�x����� � ����%� �!�"� �x�x����� � ���(�E� "�#�$�  �  �E�G�  rN�archived� root_onlyc��R# �/nU(aURS5 U(aURS5 SnU(aUSSRU5-- n[U5IShv�N nU(dg[U[5(aSU;aS UR SS 53$OS[U[ 5(aS U3$[U[5(d$S [U5RS [ U53$UVs/sHn[U5PM nnSRU5$N�s 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�?�&NzNo projects found.rzUnable to fetch projects: � Unknown errorz%Unexpected string response from API: �Unexpected response format: z - � --- ) �append�joinr1rHrIr#r*�list�type�__name__rS)rYrZ�paramsrr r5r\s r0� get_projectsrhss ����F��� � �o�&��� � �o�&��H� ��C�#�(�(�6�*�*�*��%�h�/� /�D� �#��$���� �d�?�/�����/�0R�/S�T� T� � �D�#� � �6�t�f�=�=� ��d� #� #�-�d�4�j�.A�.A�-B�#�c�$�i�[�Q�Q�7;�<�t�G��w�'�t�H�<� �>�>�(� #�#� 0��=�s%�A!D'�#D �$BD'�8D"� D'�"D'� project_idc���# �[SU35IShv�N nU(dg[U[5(aSU;aSURSS53$[ U5$NG7f)z\Get details of a specific project. Args: project_id: The ID of the project to retrieve �project/NzProject not found.rzUnable to fetch project: r_�r1rHrIr#rS)rir s r0� get_projectrm�s]���&��� �&=�>� >�D� �#��$����'�T�/�*�4�8�8�G�_�+M�*N�O�O� �$� �� ?���A�A�AAr;�created_by_user_id�project_template_id�parent_project_id�color�project_owner_user_id� start_date�end_daterBc ��T# �UUUS.n U(aX9S'U(aXIS'U(aXYS'U(aXiS'U(aXyS'U(aX�S'[SS U 5IS hv�N n U (dg [U [5(aS U ;aS U RS S53$S[ U 53$NJ7f)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) )r;�createdByUserId�projectTemplateId�parentProjectIdrr�projectOwnerUserIdr?rArBzprojects/new-projectrNz.Unable to create project: No response receivedrzUnable to create project: r_zProject created successfully: rl) r;rorprqrrrsrtrurBr �results r0�create_projectr|�s����4�-�0� �D� �"3� �� ��W� ��%:� !�"��&�[���"�Y���#�Z��'�(>���M� M�F� �?��&�$���G�v�$5�+�F�J�J�w��,P�+Q�R�R� +�N�6�,B�+C� D�D�N�s�AB(�B&�A B(�closed� subfoldersc���# �/nU(aURS5 U(aURS5 SUS3nU(aUSSRU5-- n[U5IShv�N nU(dg[U[5(aS U;aS UR S S 53$[U[ 5(dS [U53$UVs/sHn[U5PM nnS RU5$N�s 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=truerkz/tasksr]r^NzNo tasks found.rzUnable to fetch tasks: r_r`ra� rbrcr1rHrIr#rdr*rM)rir}r~rgrr r2�taskss r0�get_project_tasksr��s�����F� �� � �m�$��� � �'�(��*��V�,�H� ��C�#�(�(�6�*�*�*��%�h�/� /�D� � ��$����'�T�/�(����'�?�)K�(L�M�M� �d�D� !� !�-�c�$�i�[�9�9�+/� 0�4�4�[�� �4�E� 0� �>�>�%� � � 0�� 1�s%�A%C:�'C3�(A#C:� C5� C:�5C:�user_idc���# �/nU(aURS5 SUS3nU(aUSSRU5-- n[U5IShv�N nU(dg[U[5(aSU;aS UR SS 53$[U[ 5(dS [U53$UVs/sHn[U5PM nnS RU5$N�s 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 r��user/z/assigned-tasksr]r^NzNo assigned tasks found.rz Unable to fetch assigned tasks: r_r`rar�)r�r}rgrr r2r�s r0�get_user_assigned_tasksr��s�����F� �� � �m�$��w�i��/�H� ��C�#�(�(�6�*�*�*��%�h�/� /�D� �)��$����'�T�/�1�$�(�(�7�O�2T�1U�V�V� �d�D� !� !�-�c�$�i�[�9�9�+/� 0�4�4�[�� �4�E� 0� �>�>�%� � � 0�� 1�s%�A C"�C�A#C"�3C�C"�C"c��T# �[SUS35IShv�N nU(dg[U[5(aSU;aSURSS53$[U[5(dS[ U53$UVs/sHn[ U5PM nnS RU5$N�s snf7f) zVGet action required tasks for a specific user. Args: user_id: The ID of the user r�z/action-required-tasksNzNo action required tasks found.rz'Unable to fetch action required tasks: r_r`ra)r1rHrIr#rdr*rMrc)r�r r2r�s r0�get_user_action_required_tasksr�s����&��g�Y�6L�&M�N� N�D� �0��$����'�T�/�8����'�?�9[�8\�]�]� �d�D� !� !�-�c�$�i�[�9�9�+/� 0�4�4�[�� �4�E� 0� �>�>�%� � � O�� 1��"�B(�B!�A#B(�9B#�B(�#B(�task_idc���# �[SU35IShv�N nU(dg[U[5(aSU;aSURSS53$[ U5$NG7f)zSGet details of a specific task. Args: task_id: The ID of the task to retrieve �task/NzTask not found.rzUnable to fetch task: r_�r1rHrIr#rM)r�r s r0�get_taskr�1�]���&��g�Y�&7�8� 8�D� � ��$����'�T�/�'�����/�(J�'K�L�L� �t� �� 9�rnr9� from_user_id�parent_task_idrE� to_user_id� task_type_id�estimate� story_pointsr=c ��# �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(dg[U[5(aSU;aSURSS53$S[ U53$NJ7f)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 )� projectIdr9� fromUserId� parentTaskIdrE�toUserId� taskTypeIdr?rArBr�� storyPointsr=r�rNz+Unable to create task: No response receivedrzUnable to create task: r_zTask created successfully: r�)rir9r�r�rEr�r�rtrurBr�r�r=r r{s r0� create_taskr�Bs����D ��"� �D� �-�^���!�Y���%�Z���)�\���&�[���"�Y���#�Z���#�Z���*�]���#�Z��'����>� >�F� �<��&�$���G�v�$5�(����G�_�)M�(N�O�O� (��V�)<�(=� >�>�?�s�BC�C�A C� status_idc���# �UUS.nU(aX4S'[SUS3SU5IShv�N nU(dg[U[5(aSU;aS URSS 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�statusIdrEr�z/statusrNz2Unable to update task status: No response receivedrzUnable to update task status: r_z Task status updated successfully�r1rHrIr#)r�r�r�rEr r{s r0�update_task_statusr��sv����� �D� �!�Y��'�%��y��(@�%��N� N�F� �C��&�$���G�v�$5�/�� � �7�O�0T�/U�V�V� -�O�s�%A'�A%�>A'c��# �UUS.n[SUS3SU5IShv�N nU(dg[U[5(aSU;aSURSS 53$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�rEr�z/commentrNz+Unable to add comment: No response receivedrzUnable to add comment: r_zComment added successfullyr�)r�r�rEr r{s r0�add_task_commentr��sl����� �D� (�%��y��(A�6�4�P� P�F� �<��&�$���G�v�$5�(����G�_�)M�(N�O�O� '�Q�s�A�A�>Ac��L# �[S5IShv�N nU(dg[U[5(aSU;aSURSS53$[U[5(dS[ U53$UVs/sHn[ U5PM nnSRU5$N�s snf7f) zGet list of organization users.�usersNzNo users found.rzUnable to fetch users: r_r`ra�r1rHrIr#rdr*rXrc)r rTr�s r0� get_usersr��s����&�g�.� .�D� � ��$����'�T�/�(����'�?�)K�(L�M�M� �d�D� !� !�-�c�$�i�[�9�9�+/� 0�4�4�[�� �4�E� 0� �>�>�%� � � /�� 1�s"�B$�B�A#B$�5B� B$�B$c���# �[SU35IShv�N nU(dg[U[5(aSU;aSURSS53$[ U5$NG7f)zSGet details of a specific user. Args: user_id: The ID of the user to retrieve r�NzUser not found.rzUnable to fetch user: r_)r1rHrIr#rX)r�r s r0�get_userr��r�rnc��T# �[SUS35IShv�N nU(dg[U[5(aSU;aSURSS53$[U[5(dS[ U53$UVs/sHn[ U5PM nnS RU5$N�s snf7f) z[Get users associated with a specific project. Args: project_id: The ID of the project rkz/usersNz No users found for this project.rzUnable to fetch project users: r_r`rar�)rir rTr�s r0�get_project_usersr��s����&��� �F�&C�D� D�D� �1��$����'�T�/�0����'�?�1S�0T�U�U� �d�D� !� !�-�c�$�i�[�9�9�+/� 0�4�4�[�� �4�E� 0� �>�>�%� � � E�� 1�r�c�*�[RSS9 g)z+CLI entry point for the goodday-mcp server.�stdio)� transportN)�mcp�run�rNr0�run_clir��s���G�G�g�G�rN�__main__)�GETN)FF)NNNNNN)F) NNNNNNNNNN)N)%�typingrrrrrr�mcp.server.fastmcprr�rrr*rIrdr1rMrSrX�tool�boolrhrm�intr|r�r�r�r�r�r�r�r�r�r�r�rfr�rNr0�<module>r�sl��&�&� � ��&��m���2�� � �&<��&<�c�&<��&<�Y]�^a�cf�^f�Yg�jn�or�js�Ys�vz�Yz�&<�P �d� �s� �0 �D� �S� �( �d� �s� �"����$��$�$�$�3�$� �$�B���� �#� �#� � � � ���� (,��+/� $�"�"�3E� �3E��3E��3E� ��}� 3E� �C�=� 3E� $�C�=� 3E��� �3E��s�m�3E��s�m�3E� �3E� �3E�l����!��!�T�!�t�!�`c�!� �!�@����!�3�!��!��!� �!�:����!�#�!�#�!� �!�(�����C��C�� �� ���� %)�!� $�"&� $�"�"�"�"&�"�C?��C?� �C?��C?��S�M� C?� �c�]� C?� �� � C?��3�-�C?��� �C?��s�m�C?��s�m�C?��s�m�C?��3�-�C?��s�m�C?� �C?� �C?�J����.�c�.�C�.�C�.�RZ�[^�R_�.�kn�.� �.�6����(�C�(�#�(��(��(� �(�0����!��!� �!� �����C��C�� �� ����!��!��!� �!�(� �z�� �I�rN

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

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