{"record":{"id":"ad7329d65eb1cfc6","repo":"paperclipai/paperclip","slug":"agentid-is-required-because-paperclip-agent-id-is","errorCode":null,"errorMessage":"agentId is required because PAPERCLIP_AGENT_ID is not set","messagePattern":"agentId is required because PAPERCLIP_AGENT_ID is not set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/mcp-server/src/client.ts","lineNumber":73,"sourceCode":"    return {\n      companyId: this.config.companyId,\n      agentId: this.config.agentId,\n      runId: this.config.runId,\n    };\n  }\n\n  resolveCompanyId(companyId?: string | null): string {\n    const resolved = companyId?.trim() || this.config.companyId;\n    if (!resolved) {\n      throw new Error(\"companyId is required because PAPERCLIP_COMPANY_ID is not set\");\n    }\n    return resolved;\n  }\n\n  resolveAgentId(agentId?: string | null): string {\n    const resolved = agentId?.trim() || this.config.agentId;\n    if (!resolved) {\n      throw new Error(\"agentId is required because PAPERCLIP_AGENT_ID is not set\");\n    }\n    return resolved;\n  }\n\n  async requestJson<T>(method: string, path: string, options: JsonRequestOptions = {}): Promise<T> {\n    if (!path.startsWith(\"/\")) {\n      throw new Error(`API path must start with \"/\": ${path}`);\n    }\n\n    const url = new URL(path.slice(1), `${this.config.apiUrl}/`);\n    const headers: Record<string, string> = {\n      Authorization: `Bearer ${this.config.apiKey}`,\n      Accept: \"application/json\",\n    };\n    if (options.body !== undefined) {\n      headers[\"Content-Type\"] = \"application/json\";\n    }\n    if ((options.includeRunId ?? isWriteMethod(method)) && this.config.runId) {","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/mcp-server/src/client.ts#L55-L91","documentation":"Error \"agentId is required because PAPERCLIP_AGENT_ID is not set\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/mcp-server/src/client.ts:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set PAPERCLIP_AGENT_ID or pass agentId explicitly to the tool call."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}