2121import logging
2222import traceback
2323from os import getenv
24- from typing import Any , Dict , List , Literal
24+ from typing import Annotated , Any , Dict , List , Literal
2525from mcp .server .fastmcp import FastMCP
2626from .github_integration import GitHubIntegration as GI
2727from .ip_integration import IPIntegration as IP
@@ -210,7 +210,13 @@ async def add_github_pr_comment(repo_owner: str, repo_name: str, pr_number: int,
210210 return {"status" : "error" , "message" : error_msg }
211211
212212 @self .mcp .tool ()
213- async def list_github_issues_prs (repo_owner : str , issue : Literal ['pr' , 'issue' ] = 'pr' , filtering : Literal ['user' , 'owner' , 'involves' ] = 'involves' ) -> dict [str , Any ]:
213+ async def list_github_issues_prs (
214+ repo_owner : str ,
215+ issue : Literal ['pr' , 'issue' ] = 'pr' ,
216+ filtering : Literal ['user' , 'owner' , 'involves' ] = 'involves' ,
217+ per_page : Annotated [GI .PerPage , "Number of results per page (1-100)" ] = 50 ,
218+ page : int = 1
219+ ) -> dict [str , Any ]: # type: ignore
214220 """
215221 Lists open issues or pull requests for a specified GitHub repository.
216222 - Present the issues or pull requests in a markdown table format.
@@ -219,13 +225,15 @@ async def list_github_issues_prs(repo_owner: str, issue: Literal['pr', 'issue']
219225 repo_owner (str): The owner of the GitHub repository.
220226 issue (Literal['pr', 'issue']): The type of item to list, either 'pr' for pull requests or 'issue' for issues. Defaults to 'pr'.
221227 filtering (Literal['user', 'owner', 'involves']): The filtering criteria for the search. Defaults to 'involves'.
228+ per_page (Annotated[PerPage, "Number of results per page (1-100)"]): The number of results to return per page, range 1-100. Defaults to 50.
229+ page (int): The page number to retrieve. Defaults to 1.
222230 Returns:
223- dict[str, Any]: A dictionary containing the list of open issues or pull requests.
224- Returns an error message if an exception occurs during the listing process.
231+ dict[str, Any]: A dictionary containing the list of open issues or pull requests.
232+ Returns an error message if an exception occurs during the listing process.
225233 """
226234 logging .info ({"status" : "info" , "message" : f"Listing open { issue } for { repo_owner } " })
227235 try :
228- open_issues_prs = self .gi .list_open_issues_prs (repo_owner , issue , filtering )
236+ open_issues_prs = self .gi .list_open_issues_prs (repo_owner , issue , filtering , per_page = per_page , page = page )
229237 return open_issues_prs
230238 except Exception as e :
231239 error_msg = f"Error listing { issue } for { repo_owner } : { str (e )} "
0 commit comments