MCPcopy Index your code
hub / github.com/simstudioai/sim / normalizeToolId

Function normalizeToolId

apps/sim/tools/normalize.ts:9–40  ·  view source on GitHub ↗
(toolId: string)

Source from the content-addressed store, hash-verified

7 * Pure string utility — no server dependencies, safe to import in client components.
8 */
9export function normalizeToolId(toolId: string): string {
10 if (toolId.startsWith('workflow_executor_') && toolId.length > 'workflow_executor_'.length) {
11 return 'workflow_executor'
12 }
13
14 const knowledgeOps = ['knowledge_search', 'knowledge_upload_chunk', 'knowledge_create_document']
15 for (const op of knowledgeOps) {
16 if (toolId.startsWith(`${op}_`) && toolId.length > op.length + 1) {
17 return op
18 }
19 }
20
21 const tableOps = [
22 'table_query_rows',
23 'table_insert_row',
24 'table_batch_insert_rows',
25 'table_update_row',
26 'table_update_rows_by_filter',
27 'table_delete_rows_by_filter',
28 'table_upsert_row',
29 'table_get_row',
30 'table_delete_row',
31 'table_get_schema',
32 ]
33 for (const op of tableOps) {
34 if (toolId.startsWith(`${op}_`) && toolId.length > op.length + 1) {
35 return op
36 }
37 }
38
39 return toolId
40}

Callers 3

executeToolFunction · 0.90
getBlockIconAndColorFunction · 0.90
getDisplayNameFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected