mastra-ai/mastra · error
Method not implemented.
Error message
Method not implemented.
What it means
listStaticTools is a base-class stub on MastraIntegration. The abstract base intentionally provides no default implementation: each concrete integration (OpenAPI toolset, etc.) must override it. Calling it on the base class or on an integration that has not implemented it throws 'Method not implemented.'
Source
Thrown at packages/core/src/integration/integration.ts:41
public listWorkflows({ serialized }: { serialized?: boolean }): Record<string, Workflow> {
if (serialized) {
return Object.entries(this.workflows).reduce((acc, [k, v]) => {
return {
...acc,
[k]: {
name: v.name,
},
};
}, {});
}
return this.workflows;
}
/**
* TOOLS
*/
listStaticTools(_params?: ToolsParams): Record<string, ToolAction<any, any, any>> {
throw new Error('Method not implemented.');
}
async listTools(_params?: ToolsParams): Promise<Record<string, ToolAction<any, any, any>>> {
throw new Error('Method not implemented.');
}
async getApiClient(): Promise<ApiClient> {
throw new Error('Method not implemented');
}
}
View on GitHub (pinned to 75dd419e61)
Solutions
- Implement listStaticTools in your integration subclass, returning the static tool map
- Check hasOwnProperty/listStaticTools availability (e.g. this.listStaticTools !== MastraIntegration.prototype.listStaticTools) before calling
- Use listTools() instead if dynamic tools are what you need and the integration supports it
- Wrap calls in try/catch when iterating heterogeneous integrations
Example fix
// before
class MyIntegration extends MastraIntegration {}
// after
class MyIntegration extends MastraIntegration {
listStaticTools(_params?: ToolsParams) {
return { myTool };
}
} Defensive patterns
Strategy: type-guard
Validate before calling
if (integration.listStaticTools === MastraIntegration.prototype.listStaticTools) {
throw new Error(`${integration.name} does not implement listStaticTools`);
} Type guard
function implementsListStaticTools(integration) {
return typeof integration.listStaticTools === 'function' &&
integration.listStaticTools !== MastraIntegration.prototype.listStaticTools;
} Try / catch
try {
const tools = integration.listStaticTools(params);
} catch (e) {
if (e.message === 'Method not implemented.') {
const tools = {}; // integration exposes no static tools
} else {
throw e;
}
} Prevention
- Override listStaticTools in every custom integration subclass
- Feature-detect the override before calling in generic loops
- Prefer listTools() when dynamic enumeration is acceptable
- Add a shared abstract-base lint/test asserting required overrides
When it happens
Trigger: Calling integration.listStaticTools() on an integration subclass that does not override listStaticTools — most commonly the base MastraIntegration class itself, or a custom integration that only implemented listTools/getApiClient.
Common situations: Building a custom integration and forgetting to override listStaticTools; generic tool-enumeration code iterating all integrations and calling listStaticTools unconditionally; calling the method on a base-typed reference.
Related errors
- Method not implemented
- MastraFactory: integration tool '${name}' from '${ownerId}'
- @mastra/livekit: the agent requested tool approval or suspen
- MastraFactory: duplicate integration id '${integration.id}'
- MastraFactory: integrations [${channelRegistrations.map(({ i
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/0a6a4f827f49496a.
Report an issue: GitHub.