(
toolId: string,
context: GetToolAsyncContext = {}
)
| 118 | |
| 119 | // Get a tool by its ID asynchronously (supports server-side) |
| 120 | export async function getToolAsync( |
| 121 | toolId: string, |
| 122 | context: GetToolAsyncContext = {} |
| 123 | ): Promise<ToolConfig | undefined> { |
| 124 | const builtInTool = tools[resolveToolId(toolId)] |
| 125 | if (builtInTool) return builtInTool |
| 126 | |
| 127 | if (isCustomTool(toolId)) { |
| 128 | return fetchCustomToolFromDB(toolId, context) |
| 129 | } |
| 130 | |
| 131 | return undefined |
| 132 | } |
| 133 | |
| 134 | async function fetchCustomToolFromDB( |
| 135 | customToolId: string, |
no test coverage detected