@@ -529,7 +529,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
529529 case "fork_repository" : {
530530 const args = ForkRepositorySchema . parse ( request . params . arguments ) ;
531531 const fork = await forkRepository ( args . owner , args . repo , args . organization ) ;
532- return { toolResult : fork } ;
532+ return { content : [ { type : "text" , text : JSON . stringify ( fork , null , 2 ) } ] } ;
533533 }
534534
535535 case "create_branch" : {
@@ -562,25 +562,25 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
562562 sha
563563 } ) ;
564564
565- return { toolResult : branch } ;
565+ return { content : [ { type : "text" , text : JSON . stringify ( branch , null , 2 ) } ] } ;
566566 }
567567
568568 case "search_repositories" : {
569569 const args = SearchRepositoriesSchema . parse ( request . params . arguments ) ;
570570 const results = await searchRepositories ( args . query , args . page , args . perPage ) ;
571- return { toolResult : results } ;
571+ return { content : [ { type : "text" , text : JSON . stringify ( results , null , 2 ) } ] } ;
572572 }
573573
574574 case "create_repository" : {
575575 const args = CreateRepositorySchema . parse ( request . params . arguments ) ;
576576 const repository = await createRepository ( args ) ;
577- return { toolResult : repository } ;
577+ return { content : [ { type : "text" , text : JSON . stringify ( repository , null , 2 ) } ] } ;
578578 }
579579
580580 case "get_file_contents" : {
581581 const args = GetFileContentsSchema . parse ( request . params . arguments ) ;
582582 const contents = await getFileContents ( args . owner , args . repo , args . path , args . branch ) ;
583- return { toolResult : contents } ;
583+ return { content : [ { type : "text" , text : JSON . stringify ( contents , null , 2 ) } ] } ;
584584 }
585585
586586 case "create_or_update_file" : {
@@ -594,7 +594,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
594594 args . branch ,
595595 args . sha
596596 ) ;
597- return { toolResult : result } ;
597+ return { content : [ { type : "text" , text : JSON . stringify ( result , null , 2 ) } ] } ;
598598 }
599599
600600 case "push_files" : {
@@ -606,21 +606,21 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
606606 args . files ,
607607 args . message
608608 ) ;
609- return { toolResult : result } ;
609+ return { content : [ { type : "text" , text : JSON . stringify ( result , null , 2 ) } ] } ;
610610 }
611611
612612 case "create_issue" : {
613613 const args = CreateIssueSchema . parse ( request . params . arguments ) ;
614614 const { owner, repo, ...options } = args ;
615615 const issue = await createIssue ( owner , repo , options ) ;
616- return { toolResult : issue } ;
616+ return { content : [ { type : "text" , text : JSON . stringify ( issue , null , 2 ) } ] } ;
617617 }
618618
619619 case "create_pull_request" : {
620620 const args = CreatePullRequestSchema . parse ( request . params . arguments ) ;
621621 const { owner, repo, ...options } = args ;
622622 const pullRequest = await createPullRequest ( owner , repo , options ) ;
623- return { toolResult : pullRequest } ;
623+ return { content : [ { type : "text" , text : JSON . stringify ( pullRequest , null , 2 ) } ] } ;
624624 }
625625
626626 default :
0 commit comments