MCPcopy Create free account
hub / github.com/bytebase/dbhub / customParamsToToolParams

Function customParamsToToolParams

src/utils/tool-metadata.ts:201–212  ·  view source on GitHub ↗

* Convert custom tool parameter configs to Tool parameter format * @param params - Parameter configurations from custom tool * @returns Array of tool parameters

(params: ParameterConfig[] | undefined)

Source from the content-addressed store, hash-verified

199 * @returns Array of tool parameters
200 */
201function 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

Callers 1

buildCustomToolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected