{"record":{"id":"d41d415239ce4f53","repo":"angular/angular-cli","slug":"project-projectname-not-found-in-workspace-pa","errorCode":null,"errorMessage":"Project '${projectName}' not found in workspace path ${workspacePath}. You can use 'list_projects' to find available projects.","messagePattern":"Project '(.+?)' not found in workspace path (.+?)\\. 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":211,"sourceCode":"      throw new Error(\n        `The current directory resolves to a workspace outside the allowed MCP roots: ${found}. ` +\n          \"You can use 'list_projects' to find available workspaces.\",\n      );\n    }\n\n    workspacePath = found;\n    const configPath = join(workspacePath, 'angular.json');\n    try {\n      workspace = await AngularWorkspace.load(configPath);\n    } 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}","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/mcp/workspace-utils.ts#L193-L229","documentation":"The Angular CLI MCP server throws this in resolveWorkspaceAndProject when a projectName argument is supplied but no project with that exact name exists in the workspace loaded from workspacePath (checked via workspace.projects.has). It is a guard against acting on a non-existent project, and it points users to the list_projects tool to discover valid names.","triggerScenarios":"Calling any MCP tool with { workspacePath, projectName } where projectName is not a key in the workspace's angular.json 'projects' map (typo, renamed project, stale config).","commonSituations":"Typos in project names; project was renamed or removed from angular.json; pointing workspacePath at the wrong repository; IDE autocomplete of stale names; multi-project repos where names differ from directory names.","solutions":["Call list_projects (or inspect angular.json 'projects' section) to get exact project names.","Correct the projectName argument to match exactly (case-sensitive).","Verify workspacePath points at the directory containing the intended angular.json."],"exampleFix":"// before\nfind_project({ workspacePath: '/repo', projectName: 'my-app' })\n// after\nfind_project({ workspacePath: '/repo', projectName: 'my-app-client' }) // exact name from angular.json","handlingStrategy":"validation","validationCode":"import { getWorkspace } from './utilities/workspace';\nconst workspace = await getWorkspace('angular.json');\nif (!workspace.projects.has(projectName)) {\n  throw new Error(`Unknown project '${projectName}'. Available: ${[...workspace.projects.keys()].join(', ')}`);\n}","typeGuard":"function isKnownProject(workspace: { projects: { has(n: string): boolean } }, name: string): boolean {\n  return workspace.projects.has(name);\n}","tryCatchPattern":null,"preventionTips":["Always resolve project names via list_projects before calling MCP tools.","Copy project names from angular.json verbatim; avoid retyping them.","After renaming a project, update all scripts referencing the old name."],"tags":["angular","cli","mcp","invalid-argument"],"backgroundTag":"project-not-found","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}