eyaltoledano/claude-task-master · warning

MISSING_PARAMETER

MISSING_PARAMETER

Error message

The query parameter is required and must be a non-empty string

What it means

researchDirect performs an AI-powered research query and requires a `query` string. If query is missing, not a string, or empty/whitespace-only, the function disables silent mode and returns MISSING_PARAMETER before any network or provider call is made.

Source

Thrown at mcp-server/src/core/direct-functions/research.js:62

		tag
	} = args;
	const { session } = context; // Destructure session from context

	// Enable silent mode to prevent console logs from interfering with JSON response
	enableSilentMode();

	// Create logger wrapper using the utility
	const mcpLog = createLogWrapper(log);

	try {
		// Check required parameters
		if (!query || typeof query !== 'string' || query.trim().length === 0) {
			log.error('Missing or invalid required parameter: query');
			disableSilentMode();
			return {
				success: false,
				error: {
					code: 'MISSING_PARAMETER',
					message:
						'The query parameter is required and must be a non-empty string'
				}
			};
		}

		// Parse comma-separated task IDs if provided
		const parsedTaskIds = taskIds
			? taskIds
					.split(',')
					.map((id) => id.trim())
					.filter((id) => id.length > 0)
			: [];

		// Parse comma-separated file paths if provided
		const parsedFilePaths = filePaths
			? filePaths
					.split(',')

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Pass a non-empty question string, e.g. query: 'How does the auth middleware handle expired tokens?'
  2. Trim the input and check length > 0 in the client before calling
  3. Verify the question text is in the `query` field, not nested inside another options object
  4. If building queries dynamically, add a fallback prompt or re-prompt the user when the variable is empty

Example fix

// before
await client.callTool('research', { detailLevel: 'medium' });

// after
await client.callTool('research', { query: 'Explain the retry logic in the API client', detailLevel: 'medium', projectRoot: '/project' });
Defensive patterns

Strategy: validation

Validate before calling

if (typeof query !== 'string' || query.trim().length === 0) {
  throw new Error('research requires a non-empty query string');
}

Type guard

function isNonEmptyQuery(args) {
  return typeof args === 'object' && args !== null &&
    typeof args.query === 'string' && args.query.trim().length > 0;
}

Try / catch

try {
  const res = await client.callTool('research', { query, detailLevel, projectRoot });
  if (res.error?.code === 'MISSING_PARAMETER') {
    console.error('research needs the actual question text in `query`');
  }
} catch (e) {
  console.error('research failed:', e.message);
}

Prevention

When it happens

Trigger: Calling the research MCP tool with no query, query: '', query: ' ', or a non-string (e.g. an object of options instead of the question text); option fields accidentally placed at top level while query itself was omitted.

Common situations: Agents that send only filters (filePaths, detailLevel) but forget the actual question; form UIs submitting before the textarea is filled; query built from a variable that resolved to empty; JSON serialization dropping the field.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


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