@@ -10,7 +10,6 @@ import (
1010
1111 mcpclient "github.com/advanced-security/codeql-development-mcp-server/client/internal/mcp"
1212 itesting "github.com/advanced-security/codeql-development-mcp-server/client/internal/testing"
13- "github.com/mark3labs/mcp-go/mcp"
1413 "github.com/spf13/cobra"
1514)
1615
@@ -47,38 +46,29 @@ type mcpToolCaller struct {
4746 timeout time.Duration
4847}
4948
50- func (c * mcpToolCaller ) CallToolRaw (name string , params map [string ]any ) ([]itesting .ContentBlock , bool , error ) {
49+ func (c * mcpToolCaller ) CallToolRaw (name string , params map [string ]any ) ([]mcpclient .ContentBlock , bool , error ) {
5150 ctx := context .Background ()
5251 if c .timeout > 0 {
5352 var cancel context.CancelFunc
5453 ctx , cancel = context .WithTimeout (ctx , c .timeout )
5554 defer cancel ()
5655 }
57- result , err := c .client .CallTool (ctx , name , params )
56+
57+ result , err := mcpclient .CallTool (ctx , c .client , name , params )
5858 if err != nil {
5959 return nil , false , err
6060 }
6161
62- var blocks []itesting.ContentBlock
63- for _ , item := range result .Content {
64- if textContent , ok := item .(mcp.TextContent ); ok {
65- blocks = append (blocks , itesting.ContentBlock {
66- Type : "text" ,
67- Text : textContent .Text ,
68- })
69- }
70- }
71-
72- return blocks , result .IsError , nil
62+ return result .Content , result .IsError , nil
7363}
7464
7565func (c * mcpToolCaller ) ListToolNames () ([]string , error ) {
76- tools , err := c . client . ListTools (context .Background ())
66+ infos , err := mcpclient . ListTools (context .Background (), c . client )
7767 if err != nil {
7868 return nil , err
7969 }
80- names := make ([]string , len (tools ))
81- for i , t := range tools {
70+ names := make ([]string , len (infos ))
71+ for i , t := range infos {
8272 names [i ] = t .Name
8373 }
8474 return names , nil
0 commit comments