{"record":{"id":"ae825609f4d82036","repo":"paperclipai/paperclip","slug":"invalid-port-raw","errorCode":null,"errorMessage":"Invalid port: ${raw}","messagePattern":"Invalid port: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/google-sheets-mcp-server/src/config.ts","lineNumber":68,"sourceCode":"    };\n    if (arg === \"--service-account-json\") input.serviceAccountJson = readValue();\n    if (arg === \"--service-account-json-path\") input.serviceAccountJsonPath = readValue();\n    if (arg === \"--allowed-spreadsheet-ids\") input.allowedSpreadsheetIds = readValue();\n  }\n  return input;\n}\n\nfunction parseAllowedSpreadsheetIds(raw: string | string[] | null | undefined): string[] {\n  const values = Array.isArray(raw) ? raw : String(raw ?? \"\").split(/[\\n,]/g);\n  const ids = values.map((value) => value.trim()).filter(Boolean);\n  return Array.from(new Set(ids));\n}\n\nfunction parsePort(raw: string | number | null | undefined): number {\n  if (raw === null || raw === undefined || raw === \"\") return 8849;\n  const port = typeof raw === \"number\" ? raw : Number.parseInt(raw, 10);\n  if (!Number.isInteger(port) || port < 0 || port > 65535) {\n    throw new Error(`Invalid port: ${raw}`);\n  }\n  return port;\n}\n\nfunction normalizeBindHost(raw: string | null | undefined): string {\n  return raw?.trim() || \"127.0.0.1\";\n}\n\nfunction isLoopbackBindHost(host: string): boolean {\n  const normalized = host.trim().toLowerCase().replace(/^\\[(.*)\\]$/, \"$1\");\n  if (normalized === \"localhost\" || normalized === \"::1\") return true;\n  if (isIP(normalized) === 4) {\n    return normalized.split(\".\")[0] === \"127\";\n  }\n  return false;\n}\n\nfunction readServiceAccountJson(input: GoogleSheetsMcpConfigInput): { raw: string; source: string } {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/google-sheets-mcp-server/src/config.ts#L50-L86","documentation":"Error \"Invalid port: ${raw}\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/google-sheets-mcp-server/src/config.ts:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a valid integer TCP port (1-65535) for the port argument/env var."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}