File tree Expand file tree Collapse file tree
ai/mcp/server/github-workflow/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,12 +70,27 @@ async function callTool(toolName, args) {
7070 throw new Error ( `Tool "${ toolName } " not found or not implemented.` ) ;
7171 }
7272
73- // This is a simplified argument handling. A real implementation would be more robust.
74- const argValues = args ? Object . values ( args ) : [ ] ;
75- return tool . handler ( ...argValues ) ;
73+ // Explicitly map arguments based on toolName
74+ switch ( toolName ) {
75+ case 'listLabels' :
76+ return tool . handler ( ) ;
77+ case 'listPullRequests' :
78+ return tool . handler ( args ) ;
79+ case 'checkoutPullRequest' :
80+ case 'getPullRequestDiff' :
81+ case 'getConversation' :
82+ return tool . handler ( args . prNumber ) ;
83+ case 'createComment' :
84+ return tool . handler ( args . prNumber , args . body ) ;
85+ case 'addLabels' :
86+ case 'removeLabels' :
87+ return tool . handler ( args . issueNumber , args . labels ) ;
88+ default :
89+ throw new Error ( `Unknown tool: ${ toolName } ` ) ;
90+ }
7691}
7792
7893export {
7994 listTools ,
8095 callTool
81- } ;
96+ } ;
You can’t perform that action at this time.
0 commit comments