{"record":{"id":"33500c78c7a303d4","repo":"paperclipai/paperclip","slug":"missing-issue-id","errorCode":"missing_issue_id","errorMessage":"issueId is required when the session is not issue-scoped","messagePattern":"issueId is required when the session is not issue-scoped","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":400,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":2146,"sourceCode":"  async function searchableOnDemandTools(session: ToolGatewaySession): Promise<ToolGatewayDescriptor[]> {\n    const tools = (await connectedMcpToolsForCompany(session.companyId)).filter(isOnDemandRemoteTool);\n    const decisions = await Promise.all(tools.map(async (tool) => ({\n      tool,\n      decision: await policyService.decide(policyInputForTool({ session, tool })),\n    })));\n    return decisions\n      .filter(({ decision }) => decision.allowed || decision.decision === \"require_approval\")\n      .map(({ tool }) => tool);\n  }\n\n  async function executeVirtualSearchTools(session: ToolGatewaySession, parameters: unknown) {\n    const params = asRecord(parameters) ?? {};\n    const query = typeof params.query === \"string\" ? params.query.trim().toLowerCase() : \"\";\n    const limit = Math.max(1, Math.min(50, Number(params.limit ?? 10) || 10));\n    const tools = (await searchableOnDemandTools(session))\n      .filter((tool) => {\n        if (!query) return true;\n        return [\n          tool.name,\n          tool.displayName,\n          tool.description,\n          tool.applicationKey,\n          tool.upstreamToolName,\n        ].filter((value): value is string => typeof value === \"string\")\n          .some((value) => value.toLowerCase().includes(query));\n      })\n      .slice(0, limit)\n      .map((tool) => ({\n        name: tool.name,\n        displayName: tool.displayName ?? tool.name,\n        description: tool.description ?? null,\n        parametersSchema: tool.parametersSchema,\n        applicationId: tool.applicationId ?? null,\n        connectionId: tool.connectionId ?? null,\n        catalogEntryId: tool.catalogEntryId ?? null,\n        upstreamToolName: tool.upstreamToolName ?? tool.name,","sourceCodeStart":2128,"sourceCodeEnd":2164,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/tool-gateway.ts#L2128-L2164","documentation":"get_issue_context guard: the session is not issue-scoped (no session.issueId) and the caller did not pass an issueId parameter, so there is no way to know which issue's context to fetch. Provide an explicit issueId or open the session against a checked-out issue.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:2050 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide issueId explicitly when the session is not bound to an issue."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}