MCPcopy Index your code
hub / github.com/CommandCodeAI/BaseAI / getAvailableTools

Function getAvailableTools

packages/baseai/src/utils/get-available-tools.ts:4–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import path from 'path';
3
4export async function getAvailableTools() {
5 // Construct the path containing all tools folders.
6 const toolsPath = path.join(process.cwd(), 'baseai', 'tools');
7
8 // Check if the baseai directory exists.
9 if (!fs.existsSync(toolsPath)) return [];
10
11 // Get all directories names in the tool path.
12 const toolsNames = await fs.promises.readdir(toolsPath);
13
14 // Make complete paths for each tool.
15 const toolsPaths = toolsNames.map(toolName => toolName.replace('.ts', ''));
16
17 // Return the tool names.
18 return toolsPaths;
19}

Callers 3

createPipeFunction · 0.90
createLocalToolFunction · 0.90
createToolFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected