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

Function validateStringParam

apps/sim/lib/mcp/utils.ts:104–115  ·  view source on GitHub ↗
(
  value: unknown,
  paramName: string
)

Source from the content-addressed store, hash-verified

102 * Consolidates parameter validation logic found across routes
103 */
104export function validateStringParam(
105 value: unknown,
106 paramName: string
107): { isValid: true } | { isValid: false; error: string } {
108 if (!value || typeof value !== 'string') {
109 return {
110 isValid: false,
111 error: `${paramName} is required and must be a string`,
112 }
113 }
114 return { isValid: true }
115}
116
117/**
118 * Validate required fields in request body

Callers 1

utils.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected