MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / Tools

Function Tools

packages/ui/src/views/tools/index.jsx:35–446  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33// ==============================|| TOOLS ||============================== //
34
35const Tools = () => {
36 const theme = useTheme()
37 const getAllToolsApi = useApi(toolsApi.getAllTools)
38 const getAllCustomMcpServersApi = useApi(customMcpServersApi.getAllCustomMcpServers)
39 const { error, setError } = useError()
40
41 const [tabValue, setTabValue] = useState(0)
42
43 const [isLoading, setLoading] = useState(true)
44 const [showDialog, setShowDialog] = useState(false)
45 const [dialogProps, setDialogProps] = useState({})
46 const [view, setView] = useState(localStorage.getItem('toolsDisplayStyle') || 'card')
47
48 const inputRef = useRef(null)
49
50 // MCP Servers state
51 const [mcpLoading, setMcpLoading] = useState(true)
52 const [showMcpDialog, setShowMcpDialog] = useState(false)
53 const [mcpDialogProps, setMcpDialogProps] = useState({})
54 const [mcpTotal, setMcpTotal] = useState(0)
55 const [mcpCurrentPage, setMcpCurrentPage] = useState(1)
56 const [mcpPageLimit, setMcpPageLimit] = useState(DEFAULT_ITEMS_PER_PAGE)
57
58 /* Table Pagination */
59 const [currentPage, setCurrentPage] = useState(1)
60 const [pageLimit, setPageLimit] = useState(DEFAULT_ITEMS_PER_PAGE)
61 const [total, setTotal] = useState(0)
62
63 const onChange = (page, pageLimit) => {
64 setCurrentPage(page)
65 setPageLimit(pageLimit)
66 refresh(page, pageLimit)
67 }
68
69 const refresh = (page, limit) => {
70 const params = {
71 page: page || currentPage,
72 limit: limit || pageLimit
73 }
74 getAllToolsApi.request(params)
75 }
76
77 const onCustomMcpPageChange = (page, limit) => {
78 setMcpCurrentPage(page)
79 setMcpPageLimit(limit)
80 refreshCustomMcp(page, limit)
81 }
82
83 const refreshCustomMcp = (page, limit) => {
84 const params = {
85 page: page || mcpCurrentPage,
86 limit: limit || mcpPageLimit
87 }
88 getAllCustomMcpServersApi.request(params)
89 }
90
91 const handleChange = (event, nextView) => {
92 if (nextView === null) return

Callers

nothing calls this directly

Calls 7

useErrorFunction · 0.90
refreshCustomMcpFunction · 0.85
renderCustomToolsToolbarFunction · 0.85
renderMcpServersToolbarFunction · 0.85
renderCustomToolsTabFunction · 0.85
renderMcpServersTabFunction · 0.85
refreshFunction · 0.70

Tested by

no test coverage detected