Team Ai
Apppublic

programmingwithabdullah/todo-aipowered

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
add_task.cpython-314.pyc29 linesDownload Raw Back to __pycache__
1+
20~�i����Rt^RIHt^RIHtHt^RIHt^RIH	t	]!RR7]!R^^�R7]!R	R3RR73R
Rllt4R#)z:5MCP Tool: add_task6Purpose: Create new task for the user7)�Field)�Dict�Any)�get_session_context)�SessionzUser's ID from JWT context)�descriptionz$Task title (required, max 200 chars))r�8min_length�9max_lengthz*Optional task description (max 1000 chars)i��)rr	�defaultc10�j�V^8�dQhR\R\R\R\\\3,/#)��user_id�titler�return)�strrr)�formats"�XD:\hackathon - II\phase - III\phase - iii\phase-III\backend\mcp_server\tools\add_task.py�__annotate__rs>��9K�9K�
�9K��9K�11�9K�12�#�s�(�^�9K�c��f"�V'd\VP44^8XdRRRR/#\4;_uu_4p^RIHpV!4p^RIHpV!VP4VP4R7pVPWVR7pRVPR	VPRR13RRVPR
2/uuRRR4# +'giR#;i \dKp	^RIHp14\Y�4'dRR\T	42RR/uRp	?	#RR\T	42RR/uRp	?	#Rp	?	ii;i5i)z�15Create a new task for the user.16 17Args:18    user_id: User's ID from JWT context19    title: Task title (required, max 200 chars)20    description: Optional task description (max 1000 chars)21 22Returns:23    dict: {task_id, title, status, message}24�errorzTitle cannot be empty�status)�TaskService)�25TaskCreate)rr)r�task�db�task_idr�created�messagezTask 'z' created successfullyN)�SQLAlchemyErrorzDatabase error: zUnexpected error: )�len�stripr�services.task_servicer�schemas.task_schemasr�create_task�idr�	Exception�sqlalchemy.excr �26isinstancer)rrrrr�task_servicer�task_creater�er s&&&        r�add_taskr-s���,#K���E�K�K�M�*�a�/��4�h��H�H�!�
"�
"�b�9�&�=�L�
8�$��k�k�m��1B�1B�1D��K�27 �+�+�G�RT�+�U�D��4�7�7������)��V�D�J�J�<�/E�F�	�##�
"�
"�
"��0�K�2��a�)�)��/��A��x�8�(�G�L�L��-�c�!�f�X�6��'�J�J��K�su�D1�+C�D1�C�A8C�:28C�D1�C	�C�D1�C�D.�$(D)�D.�
D1�D)�#D.�$D1�)D.�.D1N)�__doc__�pydanticr�typingrr�databaser�sqlmodelrr-�rr�<module>r4sR���29��(���%A�B��:�q�UX���@����9K�9Kr