{"record":{"id":"061ea49187a2f05d","repo":"paperclipai/paperclip","slug":"companyid-is-required-because-paperclip-company-id","errorCode":null,"errorMessage":"companyId is required because PAPERCLIP_COMPANY_ID is not set","messagePattern":"companyId is required because PAPERCLIP_COMPANY_ID is not set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/mcp-server/src/client.ts","lineNumber":65,"sourceCode":"    return text;\n  }\n}\n\nexport class PaperclipApiClient {\n  constructor(private readonly config: PaperclipMcpConfig) {}\n\n  get defaults() {\n    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}/`);","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/mcp-server/src/client.ts#L47-L83","documentation":"Error \"companyId is required because PAPERCLIP_COMPANY_ID is not set\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/mcp-server/src/client.ts:65 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set PAPERCLIP_COMPANY_ID or pass companyId 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"}