{"record":{"id":"cd3b2497c88a060b","repo":"nexu-io/open-design","slug":"name-is-required-string","errorCode":null,"errorMessage":"${name} is required (string).","messagePattern":"(.+?) is required \\(string\\)\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"apps/daemon/src/mcp.ts","lineNumber":1968,"sourceCode":"  } finally {\n    idleExit.dispose();\n    closeTransportForIdle = null;\n  }\n}\n\nfunction ok(payload: unknown): McpToolCallResult {\n  const text =\n    typeof payload === 'string' ? payload : JSON.stringify(payload, null, 2);\n  return { content: [{ type: 'text', text }] };\n}\n\nfunction errorResult(message: string): McpToolCallResult {\n  return { isError: true, content: [{ type: 'text', text: message }] };\n}\n\nfunction requireString(v: unknown, name: string): asserts v is string {\n  if (typeof v !== 'string' || v.length === 0) {\n    throw new Error(`${name} is required (string).`);\n  }\n}\n\nconst MCP_CREDENTIAL_FIELD_PATTERN =\n  /^(?:api[_-]?key|authorization|access[_-]?token|refresh[_-]?token|secret|password)$/iu;\n\nfunction containsMcpCredentialField(value: unknown, depth = 0): boolean {\n  if (depth > 20) return true;\n  if (!value || typeof value !== 'object') return false;\n  if (Array.isArray(value)) {\n    return value.some((entry) => containsMcpCredentialField(entry, depth + 1));\n  }\n  return Object.entries(value as JsonObject).some(([key, entry]) =>\n    MCP_CREDENTIAL_FIELD_PATTERN.test(key)\n    || containsMcpCredentialField(entry, depth + 1),\n  );\n}\n","sourceCodeStart":1950,"sourceCodeEnd":1986,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/mcp.ts#L1950-L1986","documentation":"requireString is the MCP tool-call guard that asserts a named argument is a non-empty string (used for requestId, project, and similar required identifiers before dispatch). It throws when the value is missing, not a string, or empty.","triggerScenarios":"Omitting a required identifier argument; passing undefined, null, or a number; passing an empty string for requestId or project when pluginAttribution is on.","commonSituations":"A plugin-attributed start_run without a requestId; an agent that did not thread the project id.","solutions":["Pass a non-empty string for the named field.","Generate a requestId (uuid) for attributed start_run calls."],"exampleFix":"// before\nstart_run({ project: undefined, requestId: '' })\n\n// after\nstart_run({ project: 'my-project', requestId: crypto.randomUUID() })","handlingStrategy":"validation","validationCode":"if (typeof project !== 'string' || project.length === 0) throw new Error('project required');\nif (pluginAttribution && (!requestId || typeof requestId !== 'string')) {\n  requestId = crypto.randomUUID();\n}","typeGuard":"function isNonEmptyString(v: unknown): v is string {\n  return typeof v === 'string' && v.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Always supply a requestId for attributed start_run calls.","Validate required ids client-side before dispatch.","Generate fresh uuids rather than reusing or leaving them empty."],"tags":["mcp","validation"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}