UNPKG

guardian-mcp-server

Version:
336 lines 11.5 kB
import { z } from 'zod'; export interface GuardianArticle { id: string; type: string; sectionId: string; sectionName: string; webPublicationDate: string; webTitle: string; webUrl: string; apiUrl: string; fields?: { headline?: string; standfirst?: string; body?: string; byline?: string; thumbnail?: string; publication?: string; firstPublicationDate?: string; wordcount?: string; }; tags?: GuardianTag[]; } export interface GuardianTag { id: string; type: string; webTitle: string; webUrl: string; apiUrl: string; } export interface GuardianSection { id: string; webTitle: string; webUrl: string; apiUrl: string; } export interface GuardianResponse<T> { status: string; userTier: string; total: number; startIndex: number; pageSize: number; currentPage: number; pages: number; orderBy: string; results: T[]; } export interface GuardianContentResponse { status: string; userTier: string; total: number; content: GuardianArticle; } export interface GuardianApiResponse<T> { response: T; } export declare const SearchParamsSchema: z.ZodObject<{ query: z.ZodOptional<z.ZodString>; section: z.ZodOptional<z.ZodString>; tag: z.ZodOptional<z.ZodString>; from_date: z.ZodOptional<z.ZodString>; to_date: z.ZodOptional<z.ZodString>; order_by: z.ZodOptional<z.ZodEnum<["newest", "oldest", "relevance"]>>; page_size: z.ZodOptional<z.ZodNumber>; page: z.ZodOptional<z.ZodNumber>; show_fields: z.ZodOptional<z.ZodString>; production_office: z.ZodOptional<z.ZodEnum<["uk", "us", "au"]>>; detail_level: z.ZodOptional<z.ZodEnum<["minimal", "standard", "full"]>>; }, "strip", z.ZodTypeAny, { query?: string | undefined; section?: string | undefined; tag?: string | undefined; from_date?: string | undefined; to_date?: string | undefined; order_by?: "newest" | "oldest" | "relevance" | undefined; page_size?: number | undefined; page?: number | undefined; show_fields?: string | undefined; production_office?: "uk" | "us" | "au" | undefined; detail_level?: "minimal" | "standard" | "full" | undefined; }, { query?: string | undefined; section?: string | undefined; tag?: string | undefined; from_date?: string | undefined; to_date?: string | undefined; order_by?: "newest" | "oldest" | "relevance" | undefined; page_size?: number | undefined; page?: number | undefined; show_fields?: string | undefined; production_office?: "uk" | "us" | "au" | undefined; detail_level?: "minimal" | "standard" | "full" | undefined; }>; export declare const GetArticleParamsSchema: z.ZodObject<{ article_id: z.ZodString; show_fields: z.ZodOptional<z.ZodString>; truncate: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { article_id: string; show_fields?: string | undefined; truncate?: boolean | undefined; }, { article_id: string; show_fields?: string | undefined; truncate?: boolean | undefined; }>; export declare const LongReadParamsSchema: z.ZodObject<{ query: z.ZodOptional<z.ZodString>; from_date: z.ZodOptional<z.ZodString>; to_date: z.ZodOptional<z.ZodString>; page_size: z.ZodOptional<z.ZodNumber>; page: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { query?: string | undefined; from_date?: string | undefined; to_date?: string | undefined; page_size?: number | undefined; page?: number | undefined; }, { query?: string | undefined; from_date?: string | undefined; to_date?: string | undefined; page_size?: number | undefined; page?: number | undefined; }>; export declare const LookbackParamsSchema: z.ZodObject<{ date: z.ZodString; end_date: z.ZodOptional<z.ZodString>; section: z.ZodOptional<z.ZodString>; page_size: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { date: string; section?: string | undefined; page_size?: number | undefined; end_date?: string | undefined; }, { date: string; section?: string | undefined; page_size?: number | undefined; end_date?: string | undefined; }>; export declare const BrowseSectionParamsSchema: z.ZodObject<{ section: z.ZodString; days_back: z.ZodOptional<z.ZodNumber>; page_size: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { section: string; page_size?: number | undefined; days_back?: number | undefined; }, { section: string; page_size?: number | undefined; days_back?: number | undefined; }>; export declare const SearchTagsParamsSchema: z.ZodObject<{ query: z.ZodString; page_size: z.ZodOptional<z.ZodNumber>; page: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { query: string; page_size?: number | undefined; page?: number | undefined; }, { query: string; page_size?: number | undefined; page?: number | undefined; }>; export declare const SearchByLengthParamsSchema: z.ZodObject<{ query: z.ZodOptional<z.ZodString>; min_words: z.ZodOptional<z.ZodNumber>; max_words: z.ZodOptional<z.ZodNumber>; section: z.ZodOptional<z.ZodString>; from_date: z.ZodOptional<z.ZodString>; to_date: z.ZodOptional<z.ZodString>; order_by: z.ZodOptional<z.ZodEnum<["newest", "oldest", "relevance"]>>; page_size: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { query?: string | undefined; section?: string | undefined; from_date?: string | undefined; to_date?: string | undefined; order_by?: "newest" | "oldest" | "relevance" | undefined; page_size?: number | undefined; min_words?: number | undefined; max_words?: number | undefined; }, { query?: string | undefined; section?: string | undefined; from_date?: string | undefined; to_date?: string | undefined; order_by?: "newest" | "oldest" | "relevance" | undefined; page_size?: number | undefined; min_words?: number | undefined; max_words?: number | undefined; }>; export declare const SearchByAuthorParamsSchema: z.ZodObject<{ author: z.ZodString; query: z.ZodOptional<z.ZodString>; section: z.ZodOptional<z.ZodString>; from_date: z.ZodOptional<z.ZodString>; to_date: z.ZodOptional<z.ZodString>; order_by: z.ZodOptional<z.ZodEnum<["newest", "oldest", "relevance"]>>; page_size: z.ZodOptional<z.ZodNumber>; page: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { author: string; query?: string | undefined; section?: string | undefined; from_date?: string | undefined; to_date?: string | undefined; order_by?: "newest" | "oldest" | "relevance" | undefined; page_size?: number | undefined; page?: number | undefined; }, { author: string; query?: string | undefined; section?: string | undefined; from_date?: string | undefined; to_date?: string | undefined; order_by?: "newest" | "oldest" | "relevance" | undefined; page_size?: number | undefined; page?: number | undefined; }>; export declare const FindRelatedParamsSchema: z.ZodObject<{ article_id: z.ZodString; similarity_threshold: z.ZodOptional<z.ZodNumber>; exclude_same_section: z.ZodOptional<z.ZodBoolean>; max_days_old: z.ZodOptional<z.ZodNumber>; page_size: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { article_id: string; page_size?: number | undefined; similarity_threshold?: number | undefined; exclude_same_section?: boolean | undefined; max_days_old?: number | undefined; }, { article_id: string; page_size?: number | undefined; similarity_threshold?: number | undefined; exclude_same_section?: boolean | undefined; max_days_old?: number | undefined; }>; export type SearchParams = z.infer<typeof SearchParamsSchema>; export type GetArticleParams = z.infer<typeof GetArticleParamsSchema>; export type LongReadParams = z.infer<typeof LongReadParamsSchema>; export type LookbackParams = z.infer<typeof LookbackParamsSchema>; export type BrowseSectionParams = z.infer<typeof BrowseSectionParamsSchema>; export type SearchTagsParams = z.infer<typeof SearchTagsParamsSchema>; export type SearchByLengthParams = z.infer<typeof SearchByLengthParamsSchema>; export type SearchByAuthorParams = z.infer<typeof SearchByAuthorParamsSchema>; export type FindRelatedParams = z.infer<typeof FindRelatedParamsSchema>; export declare const ContentTimelineParamsSchema: z.ZodObject<{ query: z.ZodString; from_date: z.ZodString; to_date: z.ZodString; interval: z.ZodOptional<z.ZodEnum<["day", "week", "month", "quarter"]>>; section: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { query: string; from_date: string; to_date: string; section?: string | undefined; interval?: "day" | "week" | "month" | "quarter" | undefined; }, { query: string; from_date: string; to_date: string; section?: string | undefined; interval?: "day" | "week" | "month" | "quarter" | undefined; }>; export declare const AuthorProfileParamsSchema: z.ZodObject<{ author: z.ZodString; analysis_period: z.ZodOptional<z.ZodString>; from_date: z.ZodOptional<z.ZodString>; to_date: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { author: string; from_date?: string | undefined; to_date?: string | undefined; analysis_period?: string | undefined; }, { author: string; from_date?: string | undefined; to_date?: string | undefined; analysis_period?: string | undefined; }>; export declare const TopicTrendsParamsSchema: z.ZodObject<{ topics: z.ZodArray<z.ZodString, "many">; from_date: z.ZodString; to_date: z.ZodString; interval: z.ZodOptional<z.ZodEnum<["month", "quarter", "year"]>>; }, "strip", z.ZodTypeAny, { from_date: string; to_date: string; topics: string[]; interval?: "month" | "quarter" | "year" | undefined; }, { from_date: string; to_date: string; topics: string[]; interval?: "month" | "quarter" | "year" | undefined; }>; export declare const TopStoriesByDateParamsSchema: z.ZodObject<{ date: z.ZodString; story_count: z.ZodOptional<z.ZodNumber>; section: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { date: string; section?: string | undefined; story_count?: number | undefined; }, { date: string; section?: string | undefined; story_count?: number | undefined; }>; export declare const RecommendLongreadsParamsSchema: z.ZodObject<{ count: z.ZodOptional<z.ZodNumber>; context: z.ZodOptional<z.ZodString>; from_date: z.ZodOptional<z.ZodString>; topic_preference: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { from_date?: string | undefined; count?: number | undefined; context?: string | undefined; topic_preference?: string | undefined; }, { from_date?: string | undefined; count?: number | undefined; context?: string | undefined; topic_preference?: string | undefined; }>; export type ContentTimelineParams = z.infer<typeof ContentTimelineParamsSchema>; export type AuthorProfileParams = z.infer<typeof AuthorProfileParamsSchema>; export type TopicTrendsParams = z.infer<typeof TopicTrendsParamsSchema>; export type TopStoriesByDateParams = z.infer<typeof TopStoriesByDateParamsSchema>; export type RecommendLongreadsParams = z.infer<typeof RecommendLongreadsParamsSchema>; //# sourceMappingURL=guardian.d.ts.map