thedotmack/claude-mem · error

observation_generation_status: "jobId" is required

Error message

observation_generation_status: "jobId" is required

What it means

The observation_generation_status handler extracts jobId from args.jobId or the snake_case alias args.job_id, trims it, and throws this error when both are absent or blank. A job ID is required to poll generation status via ctx.client.getJobStatus(jobId).

Solutions

  1. Pass the jobId string returned by the generation-start call: { jobId: '<job-id>' }
  2. If your code uses snake_case, job_id is also accepted: { job_id: '<job-id>' }
  3. Capture and persist the jobId from the start-generation response so it survives across turns
  4. Check for typos like jobID or id — only jobId and job_id are read

Example fix

// before
await callTool('observation_generation_status', {});
// after
await callTool('observation_generation_status', { jobId: 'gen_01h9xk2m' });
Defensive patterns

Strategy: validation

Validate before calling

function canPollStatus(args) {
  const id = (args?.jobId ?? args?.job_id ?? '').trim();
  return id.length > 0;
}
if (!canPollStatus(args)) throw new Error('jobId must be captured from the generation-start response first');

Type guard

function hasJobId(args: unknown): args is { jobId: string } & Record<string, unknown> {
  const v = (args as any)?.jobId ?? (args as any)?.job_id;
  return typeof v === 'string' && v.trim().length > 0;
}

Try / catch

try {
  return await callTool('observation_generation_status', { jobId });
} catch (e) {
  if (e instanceof Error && e.message.includes('"jobId" is required')) {
    console.error('No jobId available — start a generation job first and store its id');
    return { status: 'no-job' };
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling observation_generation_status with neither jobId nor job_id, or with a whitespace-only value; passing a non-string (e.g. number) whose trim yields garbage handled upstream; responding to a generation workflow without capturing the job ID returned earlier.

Common situations: Losing the jobId returned by an earlier observation-generation start call; callers using camelCase jobID or id instead of the two supported names; agents polling status before starting a job; template args where the placeholder was never filled.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d8bc9755e7 (2026-09-17). Data as JSON: /api/errors/055609fc8b318771. Report an issue: GitHub.

Appendix: source

Thrown at src/servers/mcp-server.ts:407

    };
  }

  return callWorker('/api/context/inject', {
    query: {
      projects: projects.join(','),
      ...(args.platformSource !== undefined ? { platformSource: normalizeMcpPlatformSource(args.platformSource) } : {}),
      ...(args.full !== undefined ? { full: args.full } : {}),
      ...(args.colors !== undefined ? { colors: args.colors } : {}),
    },
    text: true,
  });
}

const handleObservationGenerationStatus = wrapHandler('observation_generation_status', async (args: ObservationGenerationStatusArgs) => {
  const ctx = requireServerForObservationTool('observation_generation_status');
  const jobId = (args?.jobId ?? args?.job_id ?? '').trim();
  if (!jobId) {
    throw new Error('observation_generation_status: "jobId" is required');
  }
  const response = await ctx.client.getJobStatus(jobId);
  return formatJsonResult(response);
});

async function ensureWorkerConnection(): Promise<boolean> {
  if (await verifyWorkerConnection()) {
    return true;
  }

  logger.warn('SYSTEM', 'Worker not available, attempting auto-start for MCP client');

  errorIfWorkerScriptMissing();

  try {
    const port = getWorkerPort();
    const result = await ensureWorkerStarted(port, WORKER_SCRIPT_PATH);
    if (result === 'dead') {

View on GitHub (pinned to d8bc9755e7)