MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / bindToolsApi

Function bindToolsApi

packages/agentflow/src/infrastructure/api/tools.ts:8–30  ·  view source on GitHub ↗
(client: AxiosInstance)

Source from the content-addressed store, hash-verified

6 * Create tools API functions bound to a client instance
7 */
8export function bindToolsApi(client: AxiosInstance) {
9 return {
10 /**
11 * Get all available tools
12 */
13 getAllTools: async (nodeName = 'toolAgentflow'): Promise<Tool[]> => {
14 const response = await client.post(`/node-load-method/${encodeURIComponent(nodeName)}`, { loadMethod: 'listTools' })
15 return response.data
16 },
17
18 /**
19 * Get input argument names for the currently selected tool.
20 * Passes current node inputs as `currentNode.inputs` so the server can resolve the selected tool.
21 */
22 getToolInputArgs: async (inputs: Record<string, unknown>, nodeName = 'toolAgentflow'): Promise<Tool[]> => {
23 const response = await client.post(`/node-load-method/${encodeURIComponent(nodeName)}`, {
24 loadMethod: 'listToolInputArgs',
25 currentNode: { inputs }
26 })
27 return response.data
28 }
29 }
30}
31
32export type ToolsApi = ReturnType<typeof bindToolsApi>

Callers 2

ApiProviderFunction · 0.90
tools.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected