The News API · Capability

The News API — Top Stories

The News API — Top Stories. 1 operations. Lead operation: Get Top Stories. Self-contained Naftiko capability covering one The News Api business surface.

Run with Naftiko The News ApiTop Stories

What You Can Do

GET
Gettopstories — Get Top Stories
/v1/news/top

MCP Tools

get-top-stories

Get Top Stories

read-only idempotent

Capability Spec

the-news-top-stories.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: The News API — Top Stories
  description: 'The News API — Top Stories. 1 operations. Lead operation: Get Top Stories. Self-contained Naftiko capability
    covering one The News Api business surface.'
  tags:
  - The News Api
  - Top Stories
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    THE_NEWS_API_API_KEY: THE_NEWS_API_API_KEY
capability:
  consumes:
  - type: http
    namespace: the-news-top-stories
    baseUri: https://api.thenewsapi.com/v1
    description: The News API — Top Stories business capability. Self-contained, no shared references.
    resources:
    - name: news-top
      path: /news/top
      operations:
      - name: gettopstories
        method: GET
        description: Get Top Stories
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: api_token
          in: query
          type: string
          description: Your API authentication token.
          required: true
        - name: search
          in: query
          type: string
          description: 'Search query with boolean operators: + (AND), | (OR), - (negation), " (phrase), * (prefix), () (precedence).'
        - name: search_fields
          in: query
          type: string
          description: 'Comma-separated fields to search: title, description, keywords, main_text. Default: title,main_text.'
        - name: locale
          in: query
          type: string
          description: Comma-separated country codes to filter by.
        - name: categories
          in: query
          type: string
          description: 'Comma-separated categories: general, science, sports, business, health, entertainment, tech, politics,
            food, travel.'
        - name: exclude_categories
          in: query
          type: string
          description: Comma-separated categories to exclude.
        - name: domains
          in: query
          type: string
          description: Comma-separated domains to include.
        - name: exclude_domains
          in: query
          type: string
          description: Comma-separated domains to exclude.
        - name: source_ids
          in: query
          type: string
          description: Comma-separated source IDs to include.
        - name: exclude_source_ids
          in: query
          type: string
          description: Comma-separated source IDs to exclude.
        - name: language
          in: query
          type: string
          description: Comma-separated language codes to filter by.
        - name: published_before
          in: query
          type: string
          description: Filter to articles published before this datetime (Y-m-d\TH:i:s).
        - name: published_after
          in: query
          type: string
          description: Filter to articles published after this datetime.
        - name: published_on
          in: query
          type: string
          description: Filter to articles published on this exact date (Y-m-d).
        - name: sort
          in: query
          type: string
          description: Sort by published_at (default) or relevance_score.
        - name: limit
          in: query
          type: integer
          description: Number of results per page (plan-dependent maximum).
        - name: page
          in: query
          type: integer
          description: Page number for pagination (default 1, max result set 20,000).
    authentication:
      type: apikey
      key: api_token
      value: '{{env.THE_NEWS_API_API_KEY}}'
      placement: query
  exposes:
  - type: rest
    namespace: the-news-top-stories-rest
    port: 8080
    description: REST adapter for The News API — Top Stories. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/news/top
      name: news-top
      description: REST surface for news-top.
      operations:
      - method: GET
        name: gettopstories
        description: Get Top Stories
        call: the-news-top-stories.gettopstories
        with:
          api_token: rest.api_token
          search: rest.search
          search_fields: rest.search_fields
          locale: rest.locale
          categories: rest.categories
          exclude_categories: rest.exclude_categories
          domains: rest.domains
          exclude_domains: rest.exclude_domains
          source_ids: rest.source_ids
          exclude_source_ids: rest.exclude_source_ids
          language: rest.language
          published_before: rest.published_before
          published_after: rest.published_after
          published_on: rest.published_on
          sort: rest.sort
          limit: rest.limit
          page: rest.page
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: the-news-top-stories-mcp
    port: 9090
    transport: http
    description: MCP adapter for The News API — Top Stories. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: get-top-stories
      description: Get Top Stories
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: the-news-top-stories.gettopstories
      with:
        api_token: tools.api_token
        search: tools.search
        search_fields: tools.search_fields
        locale: tools.locale
        categories: tools.categories
        exclude_categories: tools.exclude_categories
        domains: tools.domains
        exclude_domains: tools.exclude_domains
        source_ids: tools.source_ids
        exclude_source_ids: tools.exclude_source_ids
        language: tools.language
        published_before: tools.published_before
        published_after: tools.published_after
        published_on: tools.published_on
        sort: tools.sort
        limit: tools.limit
        page: tools.page
      outputParameters:
      - type: object
        mapping: $.