diff --git a/apps/sim/tools/index.ts b/apps/sim/tools/index.ts index 585082e59..5d91854c7 100644 --- a/apps/sim/tools/index.ts +++ b/apps/sim/tools/index.ts @@ -43,58 +43,6 @@ function normalizeToolId(toolId: string): string { */ const MAX_REQUEST_BODY_SIZE_BYTES = 10 * 1024 * 1024 // 10MB -/** - * Parameter aliases that LLMs commonly use as synonyms. - * Maps alternative parameter names to their canonical names. - * Key: toolId, Value: map of alias -> canonical parameter name - */ -const PARAMETER_ALIASES: Record> = { - table_update_row: { - values: 'data', - row: 'data', - fields: 'data', - update: 'data', - updates: 'data', - changes: 'data', - newData: 'data', - rowData: 'data', - }, - table_insert_row: { - values: 'data', - row: 'data', - fields: 'data', - rowData: 'data', - }, - table_upsert_row: { - values: 'data', - row: 'data', - fields: 'data', - rowData: 'data', - }, -} - -/** - * Applies parameter aliases to normalize LLM-provided parameters. - * If the LLM uses an alias (e.g., "values" instead of "data"), - * this function maps it to the canonical parameter name. - */ -function applyParameterAliases(toolId: string, params: Record): Record { - const aliases = PARAMETER_ALIASES[toolId] - if (!aliases) return params - - const normalizedParams = { ...params } - - for (const [alias, canonical] of Object.entries(aliases)) { - // If the alias is present and the canonical name is not, copy the value - if (alias in normalizedParams && !(canonical in normalizedParams)) { - normalizedParams[canonical] = normalizedParams[alias] - delete normalizedParams[alias] - } - } - - return normalizedParams -} - /** * User-friendly error message for body size limit exceeded */ @@ -287,8 +235,7 @@ export async function executeTool( } // Ensure context is preserved if it exists - // Apply parameter aliases to handle common LLM synonym usage (e.g., "values" -> "data") - const contextParams = applyParameterAliases(normalizedToolId, { ...params }) + const contextParams = { ...params } // Validate the tool and its parameters validateRequiredParametersAfterMerge(toolId, tool, contextParams) diff --git a/apps/sim/tools/table/insert-row.ts b/apps/sim/tools/table/insert-row.ts index a1a05b665..d60e73518 100644 --- a/apps/sim/tools/table/insert-row.ts +++ b/apps/sim/tools/table/insert-row.ts @@ -4,7 +4,8 @@ import type { TableRowInsertParams, TableRowResponse } from './types' export const tableInsertRowTool: ToolConfig = { id: 'table_insert_row', name: 'Insert Row', - description: 'Insert a new row into a table', + description: + 'Insert a new row into a table. IMPORTANT: You must use the "data" parameter (not "values", "row", "fields", or other variations) to specify the row contents.', version: '1.0.0', params: { diff --git a/apps/sim/tools/table/update-row.ts b/apps/sim/tools/table/update-row.ts index 2e585401d..25fe92a6f 100644 --- a/apps/sim/tools/table/update-row.ts +++ b/apps/sim/tools/table/update-row.ts @@ -5,7 +5,7 @@ export const tableUpdateRowTool: ToolConfig