Skip to main content
Glama

get_latest_news

Retrieve news and updates for any AI ecosystem. Items include content age and freshness indicators; verify critical decisions against source URLs.

Instructions

Get the latest news and updates for an AI ecosystem. Pro tier receives real-time results. Free tier receives items older than 24 hours. Each item includes content_age_hours and data_freshness — check these before acting on time-sensitive information. Strata provides intelligence, not ground truth. Always verify critical decisions against the source_urls returned with each item.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ecosystemYes
limitNo

Implementation Reference

  • The main handler function for 'get_latest_news'. Accepts ecosystem (required) and limit (optional, default 5, max 20). Queries the 'content_items' table filtered by ecosystem slug, category 'news', and non-quarantined. Free tier gets items older than 24h and non-pro-only. Returns items with freshness envelope (content_age_hours, last_verified_at, data_freshness).
    if (name === 'get_latest_news') {
      const ecosystem = args.ecosystem as string
      const rawLimit = typeof args.limit === 'number' ? args.limit : 5
      const limit = Math.min(Math.max(1, rawLimit), 20)
    
      const access = await checkEcosystemAccess(supabase, ecosystem, profile.tier)
      if (!access.ok) {
        await logApiRequest(supabase, { apiKey: profile.api_key, tool: 'news', ecosystem, statusCode: access.response.status })
        return err('Error: Ecosystem not available on free tier. Upgrade at usestrata.dev/dashboard/billing', access.response.status)
      }
    
      let query = supabase
        .from('content_items')
        .select('id, title, body, source_url, published_at, last_verified_at, confidence, source_count')
        .eq('ecosystem_slug', access.slug)
        .eq('category', 'news')
        .eq('is_quarantined', false)
        .order('published_at', { ascending: false })
        .limit(limit)
    
      if (profile.tier === 'free') {
        const cutoff = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString()
        query = query.lt('published_at', cutoff).eq('is_pro_only', false)
      }
    
      const { data, error } = await query
      if (error) {
        await logApiRequest(supabase, { apiKey: profile.api_key, tool: 'news', ecosystem, statusCode: 500 })
        return err('Error: Database error', 500)
      }
    
      type Row = { id: string; title: string; body: string; source_url: string | null; published_at: string; last_verified_at: string | null; confidence: string | null; source_count: number | null }
      const rows = (data ?? []) as Row[]
      const items = rows.map((row) => ({
        id: row.id,
        title: row.title,
        body: row.body,
        source_urls: row.source_url ? [row.source_url] : [],
        confidence: row.confidence ?? 'medium',
        source_count: row.source_count ?? 1,
        published_at: row.published_at,
        ...freshnessEnvelope(row.published_at, row.last_verified_at),
      }))
    
      await logApiRequest(supabase, { apiKey: profile.api_key, tool: 'news', ecosystem, statusCode: 200 })
      return ok({ ecosystem, tier: profile.tier, items }, rows.map(r => r.id))
    }
  • Input schema definition for 'get_latest_news' in the TOOL_DEFINITIONS array. Declares the tool name, description explaining tier behavior (Pro real-time, Free delayed 24h), and inputSchema with required 'ecosystem' (string) and optional 'limit' (number, min 5 max 20).
    {
      name: 'get_latest_news',
      description:
        'Get the latest news and updates for an AI ecosystem. Pro tier receives real-time results. Free tier receives items older than 24 hours. ' +
        'Each item includes content_age_hours and data_freshness — check these before acting on time-sensitive information. ' +
        EPISTEMIC_NOTICE,
      inputSchema: {
        type: 'object',
        properties: {
          ecosystem: { type: 'string', description: 'AI ecosystem slug' },
          limit: {
            type: 'number',
            description: 'Number of results to return. Default 5, max 20',
          },
        },
        required: ['ecosystem'],
      },
  • app/mcp/route.ts:35-42 (registration)
    Registration of 'get_latest_news' on the MCP server in the HTTP (POST) route handler. Uses McpServer.registerTool with Zod schema for ecosystem (required string) and limit (optional number), delegating to handleToolCall.
    server.registerTool(
      'get_latest_news',
      {
        description: TOOL_DEFINITIONS[1].description,
        inputSchema: { ecosystem: z.string(), limit: z.number().optional() },
      },
      (args) => handleToolCall('get_latest_news', args as Record<string, unknown>, req),
    )
  • Registration of 'get_latest_news' on the MCP server in the STDIO script (for local CLI usage). Same pattern: registerTool with Zod schema, delegates to handleToolCall with a mock Request.
    server.registerTool(
      'get_latest_news',
      {
        description: TOOL_DEFINITIONS[1].description,
        inputSchema: { ecosystem: z.string(), limit: z.number().optional() },
      },
      (args) => handleToolCall('get_latest_news', args as Record<string, unknown>, mockReq),
    )
  • The freshnessEnvelope helper used by the get_latest_news handler to compute content_age_hours, last_verified_at, and data_freshness bucket (live/recent/stale/very_stale) for each news item.
    export function freshnessEnvelope(
      publishedAt: string,
      lastVerifiedAt: string | null,
    ): FreshnessEnvelope {
      const ageMs = Date.now() - new Date(publishedAt).getTime()
      const ageHours = Math.round(ageMs / 3.6e6)
      const bucket: FreshnessBucket =
        ageHours < 12 ? 'live'
        : ageHours < 48 ? 'recent'
        : ageHours < 168 ? 'stale'
        : 'very_stale'
      return {
        content_age_hours: ageHours,
        last_verified_at: lastVerifiedAt ?? publishedAt,
        data_freshness: bucket,
      }
    }
Behavior5/5

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

Discloses tier-dependent latency, item fields (content_age_hours, data_freshness), and the nature of data as intelligence rather than ground truth. This is comprehensive for a read-only tool with no annotations.

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?

Three well-structured sentences, front-loaded with purpose, followed by important behavioral details. No redundant information.

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?

Covers purpose, tier behavior, item fields, and verification guidance. Lacks explicit mention of the limit parameter and response structure, but the tool is simple and the description is sufficient for basic use.

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

Parameters2/5

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

Schema has two parameters (ecosystem, limit) with 0% description coverage. Description implies ecosystem through the tool's purpose but does not mention the limit parameter at all, leaving its role undocumented.

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?

Description clearly states 'Get the latest news and updates for an AI ecosystem', specifying a concrete action and resource. It differentiates from siblings which focus on servers, practices, integrations, and ecosystem listing/search.

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?

Provides tier-based latency guidance (Pro tier real-time, Free tier 24h delay) and advises checking content_age_hours for time-sensitive information. Also includes a caution about verifying critical decisions via source_urls. Does not explicitly compare to alternative tools, but context is clear.

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/PThrower/Strata'

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