MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / getToolsPipeData

Function getToolsPipeData

packages/baseai/src/add/index.ts:204–216  ·  view source on GitHub ↗

* Transforms an array of `PipeTool` objects into an array of objects containing * tool call strings, import paths, and tool file names. * * @param tools - An array of `PipeTool` objects to be transformed. * @returns An array of objects, each containing: * - `toolCall`: A string representing the

(tools: PipeTool[])

Source from the content-addressed store, hash-verified

202 * - `toolFileName`: A string representing the file name of the tool.
203 */
204function getToolsPipeData(tools: PipeTool[]) {
205 return tools.map(tool => {
206 const toolFileName = slugify(tool.function.name);
207 const toolName = `${camelCase(tool.function.name)}Tool`;
208 const importPath = `import ${toolName} from '../tools/${toolFileName}';`;
209
210 return {
211 toolCall: `${toolName}()`,
212 importPath,
213 toolFileName
214 };
215 });
216}
217
218/**
219 * Asynchronously creates a local pipe configuration file.

Callers 1

createLocalPipeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected