nexu-io/open-design · warning · Error

${name} is required (string).

Error message

${name} is required (string).

What it means

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.

Source

Thrown at apps/daemon/src/mcp.ts:1968

  } finally {
    idleExit.dispose();
    closeTransportForIdle = null;
  }
}

function ok(payload: unknown): McpToolCallResult {
  const text =
    typeof payload === 'string' ? payload : JSON.stringify(payload, null, 2);
  return { content: [{ type: 'text', text }] };
}

function errorResult(message: string): McpToolCallResult {
  return { isError: true, content: [{ type: 'text', text: message }] };
}

function requireString(v: unknown, name: string): asserts v is string {
  if (typeof v !== 'string' || v.length === 0) {
    throw new Error(`${name} is required (string).`);
  }
}

const MCP_CREDENTIAL_FIELD_PATTERN =
  /^(?:api[_-]?key|authorization|access[_-]?token|refresh[_-]?token|secret|password)$/iu;

function containsMcpCredentialField(value: unknown, depth = 0): boolean {
  if (depth > 20) return true;
  if (!value || typeof value !== 'object') return false;
  if (Array.isArray(value)) {
    return value.some((entry) => containsMcpCredentialField(entry, depth + 1));
  }
  return Object.entries(value as JsonObject).some(([key, entry]) =>
    MCP_CREDENTIAL_FIELD_PATTERN.test(key)
    || containsMcpCredentialField(entry, depth + 1),
  );
}

View on GitHub (pinned to 5be4028344)

Solutions

  1. Pass a non-empty string for the named field.
  2. Generate a requestId (uuid) for attributed start_run calls.

Example fix

// before
start_run({ project: undefined, requestId: '' })

// after
start_run({ project: 'my-project', requestId: crypto.randomUUID() })
Defensive patterns

Strategy: validation

Validate before calling

if (typeof project !== 'string' || project.length === 0) throw new Error('project required');
if (pluginAttribution && (!requestId || typeof requestId !== 'string')) {
  requestId = crypto.randomUUID();
}

Type guard

function isNonEmptyString(v: unknown): v is string {
  return typeof v === 'string' && v.length > 0;
}

Prevention

When it happens

Trigger: Omitting a required identifier argument; passing undefined, null, or a number; passing an empty string for requestId or project when pluginAttribution is on.

Common situations: A plugin-attributed start_run without a requestId; an agent that did not thread the project id.

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/cd3b2497c88a060b. Report an issue: GitHub.