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

Function formatParameterLabel

apps/sim/tools/params.ts:901–937  ·  view source on GitHub ↗
(paramId: string)

Source from the content-addressed store, hash-verified

899 * Formats parameter IDs into human-readable labels
900 */
901export function formatParameterLabel(paramId: string): string {
902 // Special cases
903 if (paramId === 'apiKey') return 'API Key'
904 if (paramId === 'apiVersion') return 'API Version'
905 if (paramId === 'accessToken') return 'Access Token'
906 if (paramId === 'refreshToken') return 'Refresh Token'
907 if (paramId === 'botToken') return 'Bot Token'
908
909 // Handle underscore and hyphen separated words
910 if (paramId.includes('_') || paramId.includes('-')) {
911 return paramId
912 .split(/[-_]/)
913 .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
914 .join(' ')
915 }
916
917 // Handle single character parameters
918 if (paramId.length === 1) return paramId.toUpperCase()
919
920 // Handle camelCase
921 if (/[A-Z]/.test(paramId)) {
922 const result = paramId.replace(/([A-Z])/g, ' $1')
923 return (
924 result.charAt(0).toUpperCase() +
925 result
926 .slice(1)
927 .replace(/ Api/g, ' API')
928 .replace(/ Id/g, ' ID')
929 .replace(/ Url/g, ' URL')
930 .replace(/ Uri/g, ' URI')
931 .replace(/ Ui/g, ' UI')
932 )
933 }
934
935 // Simple case - just capitalize first letter
936 return paramId.charAt(0).toUpperCase() + paramId.slice(1)
937}
938
939/**
940 * SubBlock IDs that control tool routing, not user-facing parameters.

Callers 10

params.test.tsFile · 0.90
resolveFieldLabelFunction · 0.90
createParamConfigFunction · 0.90
renderParameterInputFunction · 0.90
McpDynamicArgsFunction · 0.90
renderParameterInputFunction · 0.90
renderSubBlockFunction · 0.90
tool-input.tsxFile · 0.90
workflow-block.tsxFile · 0.90

Calls 3

joinMethod · 0.80
testMethod · 0.80
replaceMethod · 0.65

Tested by

no test coverage detected