{"record":{"id":"168a51e7253e4def","repo":"eyaltoledano/claude-task-master","slug":"invalid-args","errorCode":"INVALID_ARGS","errorMessage":"Cannot use multiple custom provider flags simultaneously. Choose only one: openrouter, ollama, bedrock, azure, vertex, or openai-compatible.","messagePattern":"Cannot use multiple custom provider flags simultaneously\\. Choose only one: openrouter, ollama, bedrock, azure, vertex, or openai-compatible\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/models.js","lineNumber":82,"sourceCode":"\t// Create a logger wrapper that the core functions can use\n\tconst mcpLog = createLogWrapper(log);\n\n\tlog.info(`Executing models_direct with args: ${JSON.stringify(args)}`);\n\tlog.info(`Using project root: ${projectRoot}`);\n\n\t// Validate flags: only one custom provider flag can be used simultaneously\n\tconst customProviderFlags = CUSTOM_PROVIDERS_ARRAY.filter(\n\t\t(provider) => args[provider]\n\t);\n\n\tif (customProviderFlags.length > 1) {\n\t\tlog.error(\n\t\t\t'Error: Cannot use multiple custom provider flags simultaneously.'\n\t\t);\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: {\n\t\t\t\tcode: 'INVALID_ARGS',\n\t\t\t\tmessage:\n\t\t\t\t\t'Cannot use multiple custom provider flags simultaneously. Choose only one: openrouter, ollama, bedrock, azure, vertex, or openai-compatible.'\n\t\t\t}\n\t\t};\n\t}\n\n\ttry {\n\t\tenableSilentMode();\n\n\t\ttry {\n\t\t\t// Check for the listAvailableModels flag\n\t\t\tif (args.listAvailableModels === true) {\n\t\t\t\treturn await getAvailableModelsList({\n\t\t\t\t\tsession,\n\t\t\t\t\tmcpLog,\n\t\t\t\t\tprojectRoot\n\t\t\t\t});\n\t\t\t}","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/models.js#L64-L100","documentation":"The models tool accepts at most one custom provider flag (openrouter, ollama, bedrock, azure, vertex, or openai-compatible). When two or more are supplied simultaneously, modelsDirect returns INVALID_ARGS, since only a single provider context can be queried per call.","triggerScenarios":"Calling the models tool with e.g. both openrouter:true and ollama:true (any combination of two or more provider flags).","commonSituations":"LLM-generated tool calls combining flags from a list of options; UI toggles that don't enforce single-select; copying a previous call and adding a second provider flag; misunderstanding flags as additive filters.","solutions":["Send exactly one provider flag per call; issue separate calls for additional providers","Call models with no flags to list all default models, then filter client-side","Fix prompting/tool-schema guidance so the model selects only one flag"],"exampleFix":"// before\nawait mcp.call('models', { openrouter: true, ollama: true });\n// after\nawait mcp.call('models', { openrouter: true });\nawait mcp.call('models', { ollama: true }); // separate call","handlingStrategy":"validation","validationCode":"const PROVIDER_FLAGS = ['openrouter','ollama','bedrock','azure','vertex','openai-compatible'];\nfunction assertSingleProvider(args) {\n  const selected = PROVIDER_FLAGS.filter((f) => args[f] === true);\n  if (selected.length > 1) {\n    throw new Error(`Only one provider flag allowed; got: ${selected.join(', ')}`);\n  }\n  return args;\n}","typeGuard":"function hasSingleProviderFlag(args) {\n  const flags = ['openrouter','ollama','bedrock','azure','vertex','openai-compatible'];\n  return flags.filter((f) => args?.[f] === true).length <= 1;\n}","tryCatchPattern":"const res = await callTool('models', args);\nif (!res.success && res.error?.code === 'INVALID_ARGS') {\n  console.error('Provider flag conflict:', res.error.message);\n  // retry with exactly one flag\n}\n// or: catch (e) { if (e.message.includes('provider flags')) { ... } }","preventionTips":["Model provider choice as a single enum, not independent booleans","When LLMs compose tool calls, instruct single-select for provider flags","Issue one call per provider instead of combining flags","Validate flag counts client-side before dispatching the models call"],"tags":["mcp","invalid-arguments","models"],"backgroundTag":"conflicting-arguments","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}