Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ func (t *mcpTool) Call(ctx context.Context, input string) (string, error) {
return fmt.Sprintf("call the tool error: %s", err), nil
}

return res.Content[0].(mcp.TextContent).Text, nil
var texts []string
for _, content := range res.Content {
if textContent, ok := content.(mcp.TextContent); ok {
texts = append(texts, textContent.Text)
}
}
return strings.Join(texts, "\n"), nil
}

// MCPAdapter adapts an MCP client to the LangChain Go tools interface.
Expand Down