top_headlines
Pack: gnews · Endpoint: https://gateway.pipeworx.io/gnews/mcp
Get top news headlines, optionally filtered by category (general, world, nation, business, technology, entertainment, sports, science, health). Returns title, description, source, and publication date.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
_apiKey | string | yes | GNews API key |
category | string | no | News category: general, world, nation, business, technology, entertainment, sports, science, health |
country | string | no | Country code (e.g., “us”, “gb”). Omit for global |
lang | string | no | Language code (e.g., “en”). Default: “en” |
max | number | no | Max articles to return (1-100, default 10) |
Example call
Arguments
{
"_apiKey": "your-gnews-api-key"
}
curl
curl -X POST https://gateway.pipeworx.io/gnews/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"top_headlines","arguments":{"_apiKey":"your-gnews-api-key"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('top_headlines', {
"_apiKey": "your-gnews-api-key"
});
More examples
{
"_apiKey": "your-gnews-api-key",
"category": "technology",
"country": "gb",
"max": 15
}
Response shape
Always returns: total_articles, returned, articles
| Field | Type | Description |
|---|---|---|
total_articles | number | Total number of top headline articles |
returned | number | Number of articles returned in this response |
articles | array | List of top news headlines |
Full JSON Schema
{
"type": "object",
"properties": {
"total_articles": {
"type": "number",
"description": "Total number of top headline articles"
},
"returned": {
"type": "number",
"description": "Number of articles returned in this response"
},
"articles": {
"type": "array",
"description": "List of top news headlines",
"items": {
"type": "object",
"properties": {
"title": {
"type": [
"string",
"null"
],
"description": "Article headline"
},
"description": {
"type": [
"string",
"null"
],
"description": "Brief summary of the article"
},
"content": {
"type": [
"string",
"null"
],
"description": "Full article content snippet"
},
"url": {
"type": [
"string",
"null"
],
"description": "Article URL"
},
"image": {
"type": [
"string",
"null"
],
"description": "Featured image URL"
},
"published_at": {
"type": [
"string",
"null"
],
"description": "Publication timestamp (ISO 8601)"
},
"source_name": {
"type": [
"string",
"null"
],
"description": "Name of the news source"
},
"source_url": {
"type": [
"string",
"null"
],
"description": "Homepage URL of the news source"
}
}
}
}
},
"required": [
"total_articles",
"returned",
"articles"
]
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"gnews": {
"url": "https://gateway.pipeworx.io/gnews/mcp"
}
}
}
See Getting Started for client-specific install steps.