eyaltoledano/claude-task-master · error · TaskMasterError

NOT_FOUND

NOT_FOUND

Error message

`Brief "${nameOrId}" not found in organization`

What it means

validateBriefFound is an assertion helper in BriefService: given an undefined brief it throws TaskMasterError with code NOT_FOUND stating the brief name/ID could not be found in the organization. It also narrows the type via `asserts brief is Brief` so callers can use the brief afterwards.

Source

Thrown at packages/tm-core/src/modules/briefs/services/brief-service.ts:219

				null
			: null;

		return {
			tags: sortedTags,
			currentTag,
			totalTags: sortedTags.length
		};
	}

	/**
	 * Validate that a brief was found, throw error if not
	 */
	validateBriefFound(
		brief: Brief | undefined,
		nameOrId: string
	): asserts brief is Brief {
		if (!brief) {
			throw new TaskMasterError(
				`Brief "${nameOrId}" not found in organization`,
				ERROR_CODES.NOT_FOUND
			);
		}
	}
}

View on GitHub (pinned to c0c98d367c)

Solutions

  1. List briefs in the current org (`tm briefs list` or equivalent) and use an exact name/ID
  2. Verify the organization context matches the org the brief belongs to (`tm context org`)
  3. If the brief was renamed/deleted, update the referencing command/script or recreate the brief
  4. If passed as a URL, re-check the URL resolves to a brief in this org

Example fix

// before
const brief = await tmCore.briefs.resolveBrief('My-Brief'); // typo, NOT_FOUND
// after
const briefs = await tmCore.briefs.listBriefs();
const match = briefs.find(b => b.name.toLowerCase() === 'my-brief');
if (!match) throw new Error('Brief does not exist in this org');
const brief = await tmCore.briefs.resolveBrief(match.id);
Defensive patterns

Strategy: validation

Validate before calling

const briefs = await tmCore.briefs.listBriefs();
const found = briefs.find(b => b.id === idOrName || b.name === idOrName);
if (!found) throw new Error(`Brief "${idOrName}" not in org ${ctx.orgId} — check spelling/context`);

Type guard

function isBrief(b: Brief | undefined): b is Brief {
  return !!b && typeof b.id === 'string' && b.id.length > 0;
}

Try / catch

try {
  brief = await tmCore.briefs.resolveBrief(nameOrId);
} catch (e) {
  if (e instanceof TaskMasterError && e.code === 'NOT_FOUND') {
    const suggestions = await tmCore.briefs.listBriefs(); // show closest matches
  } else { throw e; }
}

Prevention

When it happens

Trigger: Calling resolveBrief with a brief name or ID that does not exist in the selected organization, causing validateBriefFound to receive undefined from the lookup.

Common situations: Typo in brief name; brief belongs to a different organization than the one in context; brief was deleted or renamed; using an ID from another environment (staging vs production).

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/0368e782586ed02f. Report an issue: GitHub.