MCPcopy Index your code
hub / github.com/TanStack/ai / toolsToBindings

Function toolsToBindings

packages/ai-code-mode/src/bindings/tool-to-binding.ts:15–27  ·  view source on GitHub ↗
(
  tools: Array<CodeModeTool>,
  prefix: string = '',
)

Source from the content-addressed store, hash-verified

13 * @param prefix - Optional prefix to add to binding names (e.g., 'external_')
14 */
15export function toolsToBindings(
16 tools: Array<CodeModeTool>,
17 prefix: string = '',
18): Record<string, ToolBinding> {
19 const bindings: Record<string, ToolBinding> = {}
20
21 for (const tool of tools) {
22 const bindingName = `${prefix}${tool.name}`
23 bindings[bindingName] = toolToBinding(tool, prefix)
24 }
25
26 return bindings
27}
28
29/**
30 * Convert a single TanStack AI tool to a ToolBinding

Callers 6

createCodeModeToolFunction · 0.90
codeModeWithSkillsFunction · 0.90
skillsToToolsFunction · 0.90

Calls 1

toolToBindingFunction · 0.85

Tested by

no test coverage detected