{"record":{"id":"ef6d924ba70a18dd","repo":"ComposioHQ/composio","slug":"invalid-params-passed-for-get-instance-params","errorCode":null,"errorMessage":"Invalid params passed for Get Instance Params","messagePattern":"Invalid params passed for Get Instance Params","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/models/MCP.ts","lineNumber":444,"sourceCode":"   * @param mcpConfigId {string} config id of the MCPConfig for which you want to create a server for\n   * @param options {object} additional options\n   * @param options.isChatAuth {boolean} Authenticate the users via chat when they use the MCP Server\n   */\n  async generate(\n    userId: string,\n    mcpConfigId: string,\n    options?: MCPGetInstanceParams,\n    requestOptions?: ComposioRequestOptions\n  ): Promise<MCPServerInstance> {\n    const server = await withCancellation(\n      () => this.client.mcp.retrieve(mcpConfigId, requestOptions),\n      requestOptions?.signal\n    );\n    const params = MCPGetInstanceParamsSchema.safeParse(\n      options ?? { manuallyManageConnections: false }\n    );\n    if (params.error) {\n      throw new ValidationError('Invalid params passed for Get Instance Params', {\n        cause: params.error,\n      });\n    }\n\n    const urlBody = {\n      mcp_server_id: mcpConfigId,\n      user_ids: [userId],\n      managed_auth_by_composio: options?.manuallyManageConnections ? false : true,\n    };\n    const urlResponse = await withCancellation(\n      () => this.client.mcp.generate.url(urlBody, requestOptions),\n      requestOptions?.signal\n    );\n\n    const userIdsURL = urlResponse.user_ids_url[0];\n    const serverInstance = MCPServerInstanceSchema.safeParse({\n      id: server.id,\n      name: server.name,","sourceCodeStart":426,"sourceCodeEnd":462,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/models/MCP.ts#L426-L462","documentation":"The options argument to the MCP instance generate endpoint failed validation against MCPGetInstanceParamsSchema. Even when omitted, options defaults to { manuallyManageConnections: false } and is validated, so an explicitly invalid object fails immediately.","triggerScenarios":"Calling the generate/instance method (e.g. mcp.server.instance(...) or text/result helpers) with an options object containing unknown keys or wrong types, such as manuallyManageConnections: 'yes'.","commonSituations":"Passing connection flags as strings from env/config files; adding options fields that only exist in newer/older SDK versions; spreading unrelated settings into options.","solutions":["Check error.cause for the exact key that failed","Pass only supported keys (e.g. manuallyManageConnections: boolean) or omit options entirely","Ensure booleans are actual booleans, not 'true'/'false' strings"],"exampleFix":"// before\nconst inst = await mcp.server.instance(id, { manuallyManageConnections: 'true' });\n// after\nconst inst = await mcp.server.instance(id, { manuallyManageConnections: true });","handlingStrategy":"validation","validationCode":"const opts = { manuallyManageConnections: Boolean(raw.manuallyManageConnections ?? false) };\nawait mcp.server.instance(id, opts); // or omit options","typeGuard":"const isInstanceParams = (o: unknown): boolean =>\n  MCPGetInstanceParamsSchema.safeParse(o).success;","tryCatchPattern":"try { await mcp.server.instance(id, opts); } catch (e) { if (e instanceof ValidationError && /Get Instance Params/.test(e.message)) { return mcp.server.instance(id); } throw e; }","preventionTips":["Omit options unless you need connection control","Coerce booleans from env/config sources","Pass only documented keys"],"tags":["mcp","zod","validation","typescript"],"backgroundTag":"schema-validation-failed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}