Skip to main content
Glama
scenarios.cpython-312.pyc2.43 kB
� φ8h�����ddlmZddlZddlmZmZmZddlmZGd�d�Z Gd�de�Z e d d � �e d d � �e dd� �e dd� �e dd� �gZ y)�)�OptionalN)� BaseModel�ValidationError�Field)� TypeAdapterc�,�eZdZdedefd�Zdedefd�Zy)�Scenario�name�promptc� �||_||_y)N�r r )�selfr r s �C/home/suavendas/github/fastapi-crud-mcp/backend/client/scenarios.py�__init__zScenario.__init__s���� ��� �� raw_output�returnc��� tj|�}t|j�}|j |�y#t tj f$r%}td|j�d|���Yd}~yd}~wwxYw)NTzValidation error for scenario 'z': F) �json�loadsr�validator_model�validate_pythonr�JSONDecodeError�printr )rr�data�adapter�es r�validatezScenario.validate sn�� ��:�:�j�)�D�!�$�"6�"6�7�G� � #� #�D� )�����!5�!5�6� � �3�D�I�I�;�c�!��E� F��� �s�;>�A<�A7�7A<N)�__name__� __module__� __qualname__�strr�boolr�rrr r s(���S��#���3��4�rr c�P�eZdZUedd��Zeed<edd��Zee ed<y)�ScenarioResult.z/Whether the scenario was successfully fulfilled)� description�successNz-Reason for failure or confirmation of success�reason) rr r!rr(r#�__annotations__r)rr"r$rrr&r&s*���#�+\�]�G�T�]�!�$�4c�d�F�H�S�M�drr&z Create ItemzKCreate a new item named 'Test Item' with description 'This is a test item.'r z List Itemsz List all items in the inventory.z Update Itemz`Update the item with ID 1 to have the name 'Updated Item' and description 'Updated description.'zGet ItemzRetrieve the item with ID 1.z Delete ItemzDelete the item with ID 1.) �typingrr�pydanticrrr�pydantic.type_adapterrr r&�scenarios_listr$rr�<module>r/s���� �6�6�-� � �e�Y�e�  � �\�� � �1�� � �q�� � �-�� � �+��#�r

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/brunolnetto/fastapi-crud-mcp'

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