@@ -529,7 +529,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
529
529
case "fork_repository" : {
530
530
const args = ForkRepositorySchema . parse ( request . params . arguments ) ;
531
531
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 ) } ] } ;
533
533
}
534
534
535
535
case "create_branch" : {
@@ -562,25 +562,25 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
562
562
sha
563
563
} ) ;
564
564
565
- return { toolResult : branch } ;
565
+ return { content : [ { type : "text" , text : JSON . stringify ( branch , null , 2 ) } ] } ;
566
566
}
567
567
568
568
case "search_repositories" : {
569
569
const args = SearchRepositoriesSchema . parse ( request . params . arguments ) ;
570
570
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 ) } ] } ;
572
572
}
573
573
574
574
case "create_repository" : {
575
575
const args = CreateRepositorySchema . parse ( request . params . arguments ) ;
576
576
const repository = await createRepository ( args ) ;
577
- return { toolResult : repository } ;
577
+ return { content : [ { type : "text" , text : JSON . stringify ( repository , null , 2 ) } ] } ;
578
578
}
579
579
580
580
case "get_file_contents" : {
581
581
const args = GetFileContentsSchema . parse ( request . params . arguments ) ;
582
582
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 ) } ] } ;
584
584
}
585
585
586
586
case "create_or_update_file" : {
@@ -594,7 +594,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
594
594
args . branch ,
595
595
args . sha
596
596
) ;
597
- return { toolResult : result } ;
597
+ return { content : [ { type : "text" , text : JSON . stringify ( result , null , 2 ) } ] } ;
598
598
}
599
599
600
600
case "push_files" : {
@@ -606,21 +606,21 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
606
606
args . files ,
607
607
args . message
608
608
) ;
609
- return { toolResult : result } ;
609
+ return { content : [ { type : "text" , text : JSON . stringify ( result , null , 2 ) } ] } ;
610
610
}
611
611
612
612
case "create_issue" : {
613
613
const args = CreateIssueSchema . parse ( request . params . arguments ) ;
614
614
const { owner, repo, ...options } = args ;
615
615
const issue = await createIssue ( owner , repo , options ) ;
616
- return { toolResult : issue } ;
616
+ return { content : [ { type : "text" , text : JSON . stringify ( issue , null , 2 ) } ] } ;
617
617
}
618
618
619
619
case "create_pull_request" : {
620
620
const args = CreatePullRequestSchema . parse ( request . params . arguments ) ;
621
621
const { owner, repo, ...options } = args ;
622
622
const pullRequest = await createPullRequest ( owner , repo , options ) ;
623
- return { toolResult : pullRequest } ;
623
+ return { content : [ { type : "text" , text : JSON . stringify ( pullRequest , null , 2 ) } ] } ;
624
624
}
625
625
626
626
default :
0 commit comments