{"record":{"id":"4684c34381224b37","repo":"mastra-ai/mastra","slug":"method-not-implemented-4684c3","errorCode":null,"errorMessage":"Method not implemented","messagePattern":"Method not implemented","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/integration/integration.ts","lineNumber":49,"sourceCode":"        };\n      }, {});\n    }\n    return this.workflows;\n  }\n\n  /**\n   * TOOLS\n   */\n  listStaticTools(_params?: ToolsParams): Record<string, ToolAction<any, any, any>> {\n    throw new Error('Method not implemented.');\n  }\n\n  async listTools(_params?: ToolsParams): Promise<Record<string, ToolAction<any, any, any>>> {\n    throw new Error('Method not implemented.');\n  }\n\n  async getApiClient(): Promise<ApiClient> {\n    throw new Error('Method not implemented');\n  }\n}\n","sourceCodeStart":31,"sourceCodeEnd":52,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/integration/integration.ts#L31-L52","documentation":"getApiClient on the base MastraIntegration class is a stub that throws 'Method not implemented' (note: without the trailing period of its siblings). Concrete integrations are expected to return their typed API client; the base class has none to give. It exists so the integration interface is uniform across integrations.","triggerScenarios":"Calling await integration.getApiClient() on the base MastraIntegration or a subclass that never overrode it — e.g. code that assumes every integration exposes an API client and requests it for direct HTTP calls.","commonSituations":"A custom integration that only implements tools but not the client; generic integration loops fetching clients for logging or health checks; calling getApiClient during development of a new integration.","solutions":["Override getApiClient() in your integration subclass to return the constructed API client","Feature-detect the override before calling, or maintain a registry of integrations known to expose clients","Construct the client yourself if you own the integration config (e.g. instantiate the generated OpenAPI client directly)","Wrap in try/catch where integrations are heterogeneous"],"exampleFix":"// before\nclass MyIntegration extends MastraIntegration {}\n// after\nclass MyIntegration extends MastraIntegration {\n  async getApiClient() {\n    return new MyApiClient(this.config);\n  }\n}","handlingStrategy":"type-guard","validationCode":"if (integration.getApiClient === MastraIntegration.prototype.getApiClient) {\n  throw new Error(`${integration.name} does not expose an API client`);\n}","typeGuard":"function exposesApiClient(integration) {\n  return typeof integration.getApiClient === 'function' &&\n    integration.getApiClient !== MastraIntegration.prototype.getApiClient;\n}","tryCatchPattern":"try {\n  const client = await integration.getApiClient();\n} catch (e) {\n  if (e.message.startsWith('Method not implemented')) {\n    // integration has no client — handle clientless path\n  } else {\n    throw e;\n  }\n}","preventionTips":["Override getApiClient in integrations that have a backing API","Keep a registry/flag of which integrations expose clients","Do not assume client availability in generic integration loops","Note the base stub's message lacks a trailing period — don't match it too strictly"],"tags":["abstract-method","integration","api-client","not-implemented"],"backgroundTag":"method-not-implemented","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}