Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
providerYesProvider id or display name (case-insensitive). Examples: anthropic, openai, google, mistral, cohere

Implementation Reference

  • 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 ?? '?'}`,
            },
          ],
        };
      },
    );
  • 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[];
    }
  • 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 [];
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description carries the burden. It discloses the credit cost and the fact that it performs multiple lookups. However, it does not explicitly state whether the operation is read-only or what happens on error.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loading all key information (what is aggregated) and adding cost/value in the second. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex aggregation tool, the description covers all included data types (status, models, pricing, benchmarks, news, traffic) and mentions cost. Even without output schema, the user knows what to expect.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the description of the 'provider' parameter is clear with examples. The tool description adds no extra semantic nuance, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states what the tool does: it aggregates live status, models with pricing/tier/benchmarks, news, and agent traffic for a provider. This distinguishes it from sibling tools which focus on individual aspects.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use by highlighting the value of aggregation (saving 4 round-trips) and mentions the cost (1 credit). It implicitly suggests not using individual tools when a comprehensive overview is needed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RipperMercs/tensorfeed'

If you have feedback or need assistance with the MCP directory API, please join our Discord server