MCPcopy
hub / github.com/simstudioai/sim / sanitizeTools

Function sanitizeTools

apps/sim/lib/workflows/comparison/normalize.ts:193–203  ·  view source on GitHub ↗
(tools: unknown[] | undefined)

Source from the content-addressed store, hash-verified

191 * @returns Sanitized tools array
192 */
193export function sanitizeTools(tools: unknown[] | undefined): Record<string, unknown>[] {
194 if (!Array.isArray(tools)) return []
195
196 return tools.map((tool) => {
197 if (tool && typeof tool === 'object' && !Array.isArray(tool)) {
198 const { isExpanded, ...rest } = tool as ToolWithExpanded
199 return rest
200 }
201 return tool as Record<string, unknown>
202 })
203}
204
205/** Variable with optional UI-only fields */
206type VariableWithUiFields = Variable & { validationError?: string; workflowId?: string }

Callers 3

normalize.test.tsFile · 0.90
sanitizeInputsForLogMethod · 0.90
normalizeSubBlockValueFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected