{"record":{"id":"22fcbea1aa99de7a","repo":"ComposioHQ/composio","slug":"missing-required-flag-name","errorCode":null,"errorMessage":"Missing required flag: ${name}","messagePattern":"Missing required flag: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ts/packages/cli/src/services/run-subagent-output-mcp.ts","lineNumber":19,"sourceCode":"import process from 'node:process';\nimport { jsonSchemaToZod } from '@composio/json-schema-to-zod';\nimport { FileSystem } from '@effect/platform';\nimport { BunFileSystem } from '@effect/platform-bun';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { Effect } from 'effect';\nimport {\n  ACP_STRUCTURED_OUTPUT_TOOL_NAME,\n  buildStructuredOutputToolSchema,\n  decodeStructuredSchemaJson,\n} from 'src/services/run-subagent-shared';\nimport { TerminalUI, TerminalUILive } from 'src/services/terminal-ui';\n\nconst readFlag = (name: string): string => {\n  const index = process.argv.indexOf(name);\n  const value = index >= 0 ? process.argv[index + 1] : undefined;\n  if (!value) {\n    throw new Error(`Missing required flag: ${name}`);\n  }\n  return value;\n};\n\nconst main = async (): Promise<void> => {\n  const fs = Effect.runSync(FileSystem.FileSystem.pipe(Effect.provide(BunFileSystem.layer)));\n  const schemaFilePath = readFlag('--schema-file');\n  const resultFilePath = readFlag('--result-file');\n  const schemaText = await Effect.runPromise(fs.readFileString(schemaFilePath));\n  const structuredSchema = decodeStructuredSchemaJson(schemaText);\n  const toolInputSchema = jsonSchemaToZod(buildStructuredOutputToolSchema(structuredSchema));\n\n  const server = new McpServer({\n    name: 'composio-subagent-output',\n    version: '1.0.0',\n  });\n\n  server.registerTool(","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/cli/src/services/run-subagent-output-mcp.ts#L1-L37","documentation":"The run-subagent-output-mcp helper script reads two flags from process.argv via readFlag, which throws when the flag is absent or has no following value. The flags used are the schema file path and result file path required to serve structured output over MCP.","triggerScenarios":"Launching the run-subagent-output-mcp entrypoint without the expected --<flag> <value> pairs on the command line, or with a flag at the end of argv followed by nothing.","commonSituations":"Invoking the internal helper script manually instead of through the parent CLI, a wrapper/quoting bug dropping arguments, or a CLI version change renaming the flags.","solutions":["Invoke the script through the parent composio CLI rather than directly, so flags are passed for you","If invoking directly, supply both required flags with values: node run-subagent-output-mcp.js <schema-flag> <path> <result-flag> <path>","Upgrade the CLI so caller and helper flag names match"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const need = (flag: string) => { const i = process.argv.indexOf(flag); const v = process.argv[i+1]; if (i < 0 || !v) throw new Error(`Missing required flag: ${flag}`); return v; };","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't invoke internal helper scripts directly; use the parent CLI","Arg-check at process start and print usage instead of throwing mid-run"],"tags":["cli","flags","argv","subagent"],"backgroundTag":"missing-command-line-argument","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}