/** * @license * Copyright 2025 Vybestack LLC * SPDX-License-Identifier: Apache-2.0 */ /** * Coerce tool parameters to match expected schema types. * * This function handles common LLM mistakes: * - String numbers → actual numbers (e.g., "50" → 50) * - String booleans → actual booleans (e.g., "true" → true) * - Single values → arrays when schema expects array * - JSON strings → objects when schema expects object * * @param params - The raw parameters from the LLM * @param schema - The JSON schema for the tool parameters * @returns Coerced parameters matching expected types * * @example * ```typescript * const schema = { * type: 'object', * properties: { * offset: { type: 'number' }, * limit: { type: 'number' }, * }, * }; * const params = { offset: '50', limit: '100' }; * const result = coerceParametersToSchema(params, schema); * // result: { offset: 50, limit: 100 } * ``` */ export declare function coerceParametersToSchema(params: unknown, schema: unknown): unknown;