provider_deepdive
Aggregate live status, models with pricing, tiers, benchmarks, news mentions, and agent traffic for any AI provider in a single API call. Replaces 4 separate requests.
Instructions
Everything about an AI provider in one call: live status, all models with pricing + tier + benchmark scores joined in, recent news mentions, and agent traffic. Costs 1 credit. Aggregation IS the value; doing this from free endpoints would take 4 round-trips.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| provider | Yes | Provider id or display name (case-insensitive). Examples: anthropic, openai, google, mistral, cohere |
Implementation Reference
- mcp-server/src/index.ts:632-674 (registration)MCP server registration of the 'provider_deepdive' tool. Defines the Zod schema (single 'provider' string param) and handler that fetches from the premium API endpoint and formats the response as text content.
server.tool( 'provider_deepdive', 'Everything about an AI provider in one call: live status, all models with pricing + tier + benchmark scores joined in, recent news mentions, and agent traffic. Costs 1 credit. Aggregation IS the value; doing this from free endpoints would take 4 round-trips.', { provider: z.string().describe('Provider id or display name (case-insensitive). Examples: anthropic, openai, google, mistral, cohere'), }, async ({ provider }) => { const data = (await fetchJSON(`/premium/providers/${encodeURIComponent(provider)}`, { auth: true })) as { provider: { name: string; url: string | null }; status: { state: string; status_page_url: string | null; last_checked: string | null }; models: { name: string; tier: string | null; pricing: { input: number; output: number }; benchmark_scores: Record<string, number> }[]; recent_news: { title: string; url: string; published_at: string }[]; recent_news_count: number; agent_traffic_24h: number; billing?: { credits_remaining?: number }; }; const modelLines = data.models .map(m => { const benchKeys = Object.keys(m.benchmark_scores); const benches = benchKeys.length ? ` | ${benchKeys.map(k => `${k}=${m.benchmark_scores[k]}`).join(', ')}` : ''; return ` ${m.name} [${m.tier ?? '-'}] in $${m.pricing.input}/1M, out $${m.pricing.output}/1M${benches}`; }) .join('\n'); const newsLines = data.recent_news .slice(0, 5) .map(n => ` - ${n.title} (${n.published_at})\n ${n.url}`) .join('\n'); return { content: [ { type: 'text' as const, text: `${data.provider.name} (${data.provider.url ?? 'no url'})\n` + `Status: ${data.status.state}${data.status.status_page_url ? ` (${data.status.status_page_url})` : ''}, last checked ${data.status.last_checked ?? 'unknown'}\n` + `Agent traffic (24h): ${data.agent_traffic_24h}\n\n` + `Models (${data.models.length}):\n${modelLines}\n\n` + `Recent news (${data.recent_news_count} matched, top 5 shown):\n${newsLines || ' none'}\n\n` + `Credits remaining: ${data.billing?.credits_remaining ?? '?'}`, }, ], }; }, ); - worker/src/provider-deepdive.ts:174-315 (handler)Core server-side handler that aggregates provider data from multiple cached sources (pricing, benchmarks, status, news, agent activity) and returns the combined result with models sorted by tier, benchmark scores joined in, matched news articles, and agent traffic counts.
export async function computeProviderDeepDive( env: Env, providerKey: string, ): Promise<ProviderDeepDiveResult | ProviderDeepDiveError> { if (!providerKey || typeof providerKey !== 'string' || !providerKey.trim()) { return { ok: false, error: 'provider_required' }; } const k = providerKey.trim().toLowerCase(); const [pricingRaw, benchmarksRaw, servicesRaw, articlesRaw] = await Promise.all([ env.TENSORFEED_CACHE.get('models', 'json') as Promise<PricingPayload | null>, env.TENSORFEED_CACHE.get('benchmarks', 'json') as Promise<BenchmarksPayload | null>, env.TENSORFEED_STATUS.get('services', 'json') as Promise<ServiceStatus[] | null>, env.TENSORFEED_NEWS.get('articles', 'json') as Promise<Article[] | null>, ]); const activity = await getAgentActivity(env).catch(() => null); const pricing: PricingPayload = pricingRaw ?? { providers: [] }; // Match provider by id or name (case-insensitive). If multiple match, // prefer exact id match. const exactById = pricing.providers.find(p => p.id.toLowerCase() === k); const exactByName = pricing.providers.find(p => p.name.toLowerCase() === k); const fuzzyByName = pricing.providers.find( p => p.name.toLowerCase().includes(k) || k.includes(p.name.toLowerCase()), ); const provider = exactById ?? exactByName ?? fuzzyByName; if (!provider) { return { ok: false, error: 'provider_not_found', reason: `No provider matched "${providerKey}". Try one of the available providers.`, available_providers: pricing.providers.map(p => p.name), }; } // Status: match by provider name on the services payload const services: ServiceStatus[] = servicesRaw ?? []; const lower = provider.name.toLowerCase(); const service = services.find(s => { const sp = (s.provider || '').toLowerCase(); const sn = (s.name || '').toLowerCase(); return sp === lower || sn === lower || sp.includes(lower) || lower.includes(sp); }); // Benchmarks: index by lowercased model name const benchmarksByModel = new Map<string, BenchmarkModelEntry>(); for (const m of benchmarksRaw?.models ?? []) { benchmarksByModel.set(m.model.toLowerCase(), m); } // Models: sort by tier (flagship first), then by released desc const models: ProviderDeepDiveModelEntry[] = provider.models .slice() .sort((a, b) => { const t = tierOrder(a.tier) - tierOrder(b.tier); if (t !== 0) return t; const ra = (a.released ?? '').toString(); const rb = (b.released ?? '').toString(); return rb.localeCompare(ra); }) .map(m => { const bench = benchmarksByModel.get(m.name.toLowerCase()); return { id: m.id, name: m.name, tier: m.tier ?? null, pricing: { input: m.inputPrice, output: m.outputPrice, blended: round4((m.inputPrice + m.outputPrice) / 2), }, context_window: m.contextWindow ?? null, released: m.released ?? null, capabilities: m.capabilities ?? [], open_source: m.openSource === true, license: m.license ?? null, benchmark_scores: bench?.scores ?? {}, }; }); // News: filter articles whose source/sourceDomain/title mentions the provider const articles: Article[] = articlesRaw ?? []; const matchedArticles = articles.filter(a => { const src = (a.source || '').toLowerCase(); const dom = (a.sourceDomain || '').toLowerCase(); const title = (a.title || '').toLowerCase(); return src.includes(lower) || dom.includes(lower) || title.includes(lower); }); // Agent traffic: count hits matching this provider's known bot signatures const bots = botsForProvider(provider.name).map(b => b.toLowerCase()); let traffic = 0; if (bots.length > 0 && activity) { const recent = (activity as AgentActivityPayload).recent ?? []; for (const hit of recent) { const bot = (hit.bot || '').toLowerCase(); if (bots.some(b => bot.includes(b))) traffic += 1; } } const notes: string[] = []; if (!service) notes.push('No status entry matched this provider; live status reported as unknown.'); if (models.every(m => Object.keys(m.benchmark_scores).length === 0)) { notes.push('No benchmark coverage for this provider yet.'); } return { ok: true, provider: { id: provider.id, name: provider.name, url: provider.url ?? null, logo: provider.logo ?? null, }, status: { state: service?.status ?? 'unknown', last_checked: service?.lastChecked ?? null, status_page_url: service?.statusPageUrl ?? null, components: (service?.components ?? []).slice(0, 8), }, models, recent_news: matchedArticles.slice(0, 8).map(a => ({ title: a.title, url: a.url, source: a.source, published_at: a.publishedAt, snippet: a.snippet, })), recent_news_count: matchedArticles.length, agent_traffic_24h: traffic, data_freshness: { pricing: pricingRaw?.lastUpdated ?? null, benchmarks: benchmarksRaw?.lastUpdated ?? null, status: services[0]?.lastChecked ?? null, news: articles[0]?.publishedAt ?? null, activity: (activity as AgentActivityPayload | null)?.last_updated ?? null, }, notes, }; } - Type definitions for ProviderDeepDiveModelEntry (model with pricing, tier, benchmarks), ProviderDeepDiveResult (success response), and ProviderDeepDiveError (error response) on the worker side.
export interface ProviderDeepDiveModelEntry { id: string; name: string; tier: string | null; pricing: { input: number; output: number; blended: number }; context_window: number | null; released: string | null; capabilities: string[]; open_source: boolean; license: string | null; benchmark_scores: Record<string, number>; } export interface ProviderDeepDiveResult { ok: true; provider: { id: string; name: string; url: string | null; logo: string | null; }; status: { state: ServiceStatus['status'] | 'unknown'; last_checked: string | null; status_page_url: string | null; components: { name: string; status: string }[]; }; models: ProviderDeepDiveModelEntry[]; recent_news: { title: string; url: string; source: string; published_at: string; snippet: string }[]; recent_news_count: number; agent_traffic_24h: number; data_freshness: { pricing: string | null; benchmarks: string | null; status: string | null; news: string | null; activity: string | null; }; notes: string[]; } - sdk/javascript/src/index.ts:550-585 (schema)JavaScript SDK type definitions for the provider deep dive response, including ProviderDeepDiveModel and ProviderDeepDiveResponse with billing info.
export interface ProviderDeepDiveModel { id: string; name: string; tier: string | null; pricing: { input: number; output: number; blended: number }; context_window: number | null; released: string | null; capabilities: string[]; open_source: boolean; license: string | null; benchmark_scores: Record<string, number>; } export interface ProviderDeepDiveResponse { ok: boolean; provider: { id: string; name: string; url: string | null; logo: string | null }; status: { state: 'operational' | 'degraded' | 'down' | 'unknown'; last_checked: string | null; status_page_url: string | null; components: { name: string; status: string }[]; }; models: ProviderDeepDiveModel[]; recent_news: { title: string; url: string; source: string; published_at: string; snippet: string }[]; recent_news_count: number; agent_traffic_24h: number; data_freshness: { pricing: string | null; benchmarks: string | null; status: string | null; news: string | null; activity: string | null; }; notes: string[]; billing?: { credits_charged: number; credits_remaining?: number }; } - Helper utilities: PROVIDER_TO_BOT_PATTERNS mapping known AI bots to providers, botsForProvider() to look up bot signatures, tierOrder() for sorting models (flagship first), and round4() for pricing rounding.
const PROVIDER_TO_BOT_PATTERNS: Record<string, string[]> = { anthropic: ['ClaudeBot', 'anthropic-ai'], openai: ['GPTBot', 'ChatGPT-User', 'OAI-SearchBot'], perplexity: ['PerplexityBot'], google: ['Google-Extended', 'Googlebot'], microsoft: ['Bingbot'], apple: ['Applebot'], cohere: ['cohere-ai'], bytedance: ['Bytespider'], amazon: ['Amazonbot'], }; function botsForProvider(provider: string): string[] { const k = provider.toLowerCase(); for (const [key, bots] of Object.entries(PROVIDER_TO_BOT_PATTERNS)) { if (k.includes(key)) return bots; } return []; }