{"record":{"id":"03f6dfc8b0dfed14","repo":"paperclipai/paperclip","slug":"api-path-must-start-with-path","errorCode":null,"errorMessage":"API path must start with \"/\": ${path}","messagePattern":"API path must start with \"/\": (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/mcp-server/src/client.ts","lineNumber":80,"sourceCode":"  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) {\n      headers[\"X-Paperclip-Run-Id\"] = this.config.runId;\n    }\n\n    const response = await fetch(url, {\n      method,\n      headers,\n      body: options.body === undefined ? undefined : JSON.stringify(options.body),","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/mcp-server/src/client.ts#L62-L98","documentation":"Error \"API path must start with \"/\": ${path}\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/mcp-server/src/client.ts:80 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Prefix the API path with \"/\", e.g. \"/api/issues\" instead of \"api/issues\"."],"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-14T05:17:10.506Z"}