{"record":{"id":"0bf4f604101bc639","repo":"angular/angular-cli","slug":"no-project-name-provided-and-no-default-project-fo","errorCode":null,"errorMessage":"No project name provided and no default project found in workspace path ${workspacePath}. Please provide a project name or set a default project in angular.json. You can use 'list_projects' to find available projects.","messagePattern":"No project name provided and no default project found in workspace path (.+?)\\. Please provide a project name or set a default project in angular\\.json\\. You can use 'list_projects' to find available projects\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/angular/cli/src/commands/mcp/workspace-utils.ts","lineNumber":221,"sourceCode":"    } catch (e) {\n      throw new Error(`Failed to load workspace configuration at ${configPath}.`, { cause: e });\n    }\n  }\n\n  let projectName = projectNameInput;\n  if (projectName) {\n    if (!workspace.projects.has(projectName)) {\n      throw new Error(\n        `Project '${projectName}' not found in workspace path ${workspacePath}. ` +\n          \"You can use 'list_projects' to find available projects.\",\n      );\n    }\n  } else {\n    projectName = getDefaultProjectName(workspace);\n  }\n\n  if (!projectName) {\n    throw new Error(\n      `No project name provided and no default project found in workspace path ${workspacePath}. ` +\n        'Please provide a project name or set a default project in angular.json. ' +\n        \"You can use 'list_projects' to find available projects.\",\n    );\n  }\n\n  return { workspace, workspacePath, projectName };\n}\n","sourceCodeStart":203,"sourceCodeEnd":230,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/mcp/workspace-utils.ts#L203-L230","documentation":"Thrown by resolveWorkspaceAndProject when no projectName was provided AND getDefaultProjectName(workspace) returned nothing, so no project can be inferred. The Angular CLI refuses to guess; the user must pass a project name or configure a default project in angular.json.","triggerScenarios":"Calling an MCP tool with { workspacePath } (no projectName) on a workspace that has no default project: either 'defaultProject' is absent from angular.json (removed in modern Angular workspaces), no CLI builder project exists, or multiple projects with none marked default.","commonSituations":"New Angular 15+ workspaces where 'defaultProject' was dropped; multi-project monorepos; minimal libraries-only workspaces; automated scripts that omit projectName assuming a default exists.","solutions":["Pass an explicit projectName argument to the tool.","Add \"defaultProject\": \"<name>\" to angular.json, or set \"default\": true on a project.","Run list_projects to see which projects are available, then choose one."],"exampleFix":"// before\n{ \"workspacePath\": \"/repo\" }\n// after\n{ \"workspacePath\": \"/repo\", \"projectName\": \"admin-app\" }\n// or in angular.json: \"defaultProject\": \"admin-app\"","handlingStrategy":"validation","validationCode":"const pkg = require('./angular.json');\nif (!projectName && !pkg.defaultProject) {\n  throw new Error('projectName required: workspace has no defaultProject');\n}","typeGuard":"function hasProjectArg(args: { projectName?: string }): args is { projectName: string } {\n  return typeof args.projectName === 'string' && args.projectName.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Set \"defaultProject\" in angular.json for single-app workspaces.","Never omit projectName in multi-project repos.","Add a CI check that angular.json declares a default or scripts always pass a project."],"tags":["angular","cli","mcp","missing-argument","configuration"],"backgroundTag":"missing-required-argument","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}