EU Parliament Monitor — API Documentation - v0.8.30
    Preparing search index...

    Strategy interface for article generation.

    Each concrete implementation handles one ArticleCategory:

    • module:Generators/Strategies/WeekAheadStrategy
    • module:Generators/Strategies/BreakingNewsStrategy
    • module:Generators/Strategies/CommitteeReportsStrategy
    • module:Generators/Strategies/PropositionsStrategy
    • module:Generators/Strategies/MotionsStrategy
    interface ArticleStrategy<TData extends ArticleData = ArticleData> {
        type: ArticleCategory;
        requiredMCPTools: readonly string[];
        shouldSkip?(data: ArticleData): boolean;
        fetchData(
            client: EuropeanParliamentMCPClient | null,
            date: string,
        ): Promise<TData>;
        buildContent(data: TData, lang: LanguageCode): string;
        getMetadata(data: TData, lang: LanguageCode): ArticleMetadata;
    }

    Type Parameters

    Hierarchy (View Summary)

    Implemented by

    Index

    Methods

    • Optional guard that lets a strategy opt out of generation when the fetched data contains only placeholder / fallback values (e.g. MCP unavailable). When true is returned the orchestrator skips writing all language variants and logs a notice rather than publishing empty placeholder articles.

      Strategies that do not implement this method are treated as always wanting to generate (i.e. the default is false).

      Parameters

      Returns boolean

      true when all fetched data is placeholder and generation should be skipped

    Properties

    The article category this strategy handles

    requiredMCPTools: readonly string[]

    Names of MCP tools this strategy calls