* Build the tool description including available external functions
(tools: Array<CodeModeTool>)
| 267 | * Build the tool description including available external functions |
| 268 | */ |
| 269 | function buildToolDescription(tools: Array<CodeModeTool>): string { |
| 270 | const eager = tools.filter((t) => !t.lazy) |
| 271 | const hasLazy = tools.some((t) => t.lazy) |
| 272 | const externalFunctions = eager.map((t) => `external_${t.name}`).join(', ') |
| 273 | |
| 274 | const discoverable = hasLazy |
| 275 | ? ` Additional functions can be discovered via the discover_tools tool.` |
| 276 | : '' |
| 277 | |
| 278 | return ( |
| 279 | `Execute TypeScript code in a secure sandbox environment. ` + |
| 280 | `The code can use these external API functions: ${externalFunctions}.${discoverable} ` + |
| 281 | `All external_* calls are async and must be awaited. ` + |
| 282 | `Return a value to pass results back. Use console.log() for debugging.` |
| 283 | ) |
| 284 | } |
no outgoing calls
no test coverage detected