Skip to main content
Glama

PR Reviewer

github_integration.cpython-312.pyc2.79 kB
� |��g ��r�ddlZddlZddlZddlmZe�ej d�Zdededede fd�Z y) �N)� load_dotenv� GITHUB_TOKEN� repo_owner� repo_name� pr_number�returnc ��td|�d|�d|���d|�d|�d|��}|�d�}ddt��i} tj||� �}|j �|j �}tj||� �}|j �|j �} g} | D]]} | d | d | d | d | d| jdd�| jdd�| jdd�d�} | j | ��_|d|d|dd|d|d|dt| �| d�} tdt| ��d��| S#t$r5}tdt|����tj�Yd}~yd}~wwxYw) aGFetch changes from a GitHub pull request. Args: repo_owner: The owner of the GitHub repository repo_name: The name of the GitHub repository pr_number: The number of the pull request to analyze Returns: A list of file changes with detailed information about each change z Fetching PR changes for �/�#zhttps://api.github.com/repos/z/pulls/z/files� Authorizationztoken )�headers�filename�status� additions� deletions�changes�patch��raw_url� contents_url)rrrrrrrr�title�body�user�login� created_at� updated_at�state)r� description�authorrrr� total_changesrzSuccessfully fetched z changeszError fetching PR changes: N) �printr�requests�get�raise_for_status�json�append�len� Exception�str� traceback� print_exc)rrr�pr_url� files_urlr � pr_response�pr_data�files_response� files_datar�file�change�pr_info�es �;/Users/kalyankumarkonduru/pr_reviewer/github_integration.py�fetch_pr_changesr7 s��� � %�j�\��9�+�Q�y�k� J�K�-�Z�L��)��G�I�;� W�F��(�&�!�I��&��� 7�8�G�,��l�l�6�7�;� ��$�$�&��"�"�$��"���i��A���'�'�)�#�(�(�*� ���� #�D� ��,��x�.�!�+�.�!�+�.�� �?����'�2�.��8�8�I�r�2� $����� <� �F� �N�N�6� "� #��W�%�"�6�?��f�o�g�.�!�,�/�!�,�/��W�%� ��\��  �� �%�c�'�l�^�8�<�=���� �� �+�C��F�8�4�5��������s�DE� F�+E?�?F) �osr"r*�dotenvr�getenvrr)�int�listr7��r6�<module>r?sI�� ���� � ��r�y�y��(� �>��>��>��>��>r>

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/KalyankumarKonduru/MCP_test'

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