(toolName: string)
| 154 | |
| 155 | // Function to extract the tool object as an example, including the function signatures |
| 156 | function extractToolExample(toolName: string) { |
| 157 | const tool = tools[toolName]; |
| 158 | if (tool) { |
| 159 | const functionSignature = getFunctionSignature(tool.function); |
| 160 | const stateSignature = getFunctionSignature(tool.state); |
| 161 | const toolExample = { |
| 162 | ...tool, |
| 163 | function: functionSignature, |
| 164 | state: stateSignature, |
| 165 | }; |
| 166 | return JSON.stringify(toolExample, null, 2); // Pretty print the JSON string |
| 167 | } else { |
| 168 | return `Tool ${toolName} not found.`; |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | tools.getToolExample = { |
| 173 | state: () => 'available', |
no test coverage detected