Skip to main content

getScorers()

The getScorers() method returns all scorers that have been registered with the Mastra instance. Scorers are used for evaluating AI outputs and can override default scorers during agent generation or workflow execution.

Usage Example​

import { mastra } from "./mastra";

// Get all registered scorers
const allScorers = mastra.getScorers();

// Access a specific scorer
const myScorer = allScorers.relevancyScorer;

Parameters​

This method takes no parameters.

Returns​

scorers:

Record<string, MastraScorer> | undefined
An object containing all registered scorers, where keys are scorer names and values are MastraScorer instances. Returns undefined if no scorers are registered.

On this page