* Convert custom tool parameter configs to Tool parameter format * @param params - Parameter configurations from custom tool * @returns Array of tool parameters
(params: ParameterConfig[] | undefined)
| 199 | * @returns Array of tool parameters |
| 200 | */ |
| 201 | function customParamsToToolParams(params: ParameterConfig[] | undefined): ToolParameter[] { |
| 202 | if (!params || params.length === 0) { |
| 203 | return []; |
| 204 | } |
| 205 | |
| 206 | return params.map((param) => ({ |
| 207 | name: param.name, |
| 208 | type: param.type, |
| 209 | required: param.required !== false && param.default === undefined, |
| 210 | description: param.description, |
| 211 | })); |
| 212 | } |
| 213 | |
| 214 | /** |
| 215 | * Build execute_sql tool metadata for API response |