top_headlines

Pack: newsapi · Endpoint: https://gateway.pipeworx.io/newsapi/mcp

Fetch current top news headlines from NewsAPI, filterable by country (ISO 2-letter), category (business/entertainment/health/science/sports/technology), publisher sources, or keyword q. Returns article title, description, source, URL, and published date.

Parameters

NameTypeRequiredDescription
countrystringno
categorystringno
sourcesstringno
qstringno
pageSizenumberno
pagenumberno

Example call

Arguments

{
  "country": "us",
  "category": "technology",
  "pageSize": 10
}

curl

curl -X POST https://gateway.pipeworx.io/newsapi/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"top_headlines","arguments":{"country":"us","category":"technology","pageSize":10}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('top_headlines', {
  "country": "us",
  "category": "technology",
  "pageSize": 10
});

More examples

{
  "q": "bitcoin",
  "sources": "bbc-news,cnn",
  "page": 1
}

Response shape

FieldTypeDescription
statusstringAPI response status
totalResultsnumberTotal number of results available
articlesarrayArray of article objects
Full JSON Schema
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "API response status"
    },
    "totalResults": {
      "type": "number",
      "description": "Total number of results available"
    },
    "articles": {
      "type": "array",
      "description": "Array of article objects",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "object",
            "properties": {
              "id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Source ID"
              },
              "name": {
                "type": "string",
                "description": "Source name"
              }
            }
          },
          "author": {
            "type": [
              "string",
              "null"
            ],
            "description": "Article author"
          },
          "title": {
            "type": "string",
            "description": "Article title"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Article description"
          },
          "url": {
            "type": "string",
            "description": "Article URL"
          },
          "urlToImage": {
            "type": [
              "string",
              "null"
            ],
            "description": "Image URL for article"
          },
          "publishedAt": {
            "type": "string",
            "description": "Publication timestamp"
          },
          "content": {
            "type": [
              "string",
              "null"
            ],
            "description": "Article content"
          }
        }
      }
    }
  }
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "newsapi": {
      "url": "https://gateway.pipeworx.io/newsapi/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build July 6, 2026