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

Function sanitizeToolCalls

apps/sim/app/api/providers/route.ts:332–347  ·  view source on GitHub ↗

* Helper function to sanitize tool calls to remove Unicode characters

(toolCalls: any)

Source from the content-addressed store, hash-verified

330 * Helper function to sanitize tool calls to remove Unicode characters
331 */
332function sanitizeToolCalls(toolCalls: any) {
333 // If it's an object with a list property, sanitize the list
334 if (toolCalls && typeof toolCalls === 'object' && Array.isArray(toolCalls.list)) {
335 return {
336 ...toolCalls,
337 list: toolCalls.list.map(sanitizeToolCall),
338 }
339 }
340
341 // If it's an array, sanitize each item
342 if (Array.isArray(toolCalls)) {
343 return toolCalls.map(sanitizeToolCall)
344 }
345
346 return toolCalls
347}
348
349/**
350 * Sanitize a single tool call to remove Unicode characters

Callers 1

route.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected