Skip to main content
Glama

get_sources

Retrieve news sources by specifying category and country parameters, enabling targeted access to relevant content within the Multi-MCPs server.

Instructions

List news sources

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNo
countryNo

Implementation Reference

  • Handler function for the 'get_sources' MCP tool. Extracts category and country from input args, checks for API key configuration, and calls the client's sources method to fetch available news sources.
    async get_sources(args: Record<string, unknown>) { if (!cfg.newsApiKey) throw new Error("NEWS_API_KEY is not configured"); const category = args.category ? String(args.category) : undefined; const country = args.country ? String(args.country) : undefined; return client.sources(category, country); },
  • Registration entry for the 'get_sources' tool in the News API toolset, defining its name, description, and input schema (optional category and country parameters).
    { name: "get_sources", description: "List news sources", inputSchema: { type: "object", properties: { category: { type: "string" }, country: { type: "string" }, }, }, },
  • Supporting method in NewsApiClient class that makes the API request to retrieve news sources filtered by optional category and country.
    sources(category?: string, country?: string) { return this.request("/v2/top-headlines/sources", { headers: { Authorization: `Bearer ${this.apiKey}` }, query: { category, country }, }); }

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/TaylorChen/muti-mcps'

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