chaingpt_get_ai_crypto_news
Fetch AI-related cryptocurrency and Web3 news articles from multiple trusted sources, with options to filter by category, token, or search query.
Instructions
Get the latest AI-related crypto and web3 articles.
Web3-native AI assistant built specifically for the crypto world.
it source, filter, deduplicate, and summarize up-to-date crypto news from many outlets in real time
it continuously scans trusted crypto news sites (e.g. CoinDesk, CoinTelegraph, Decrypt) and even social platforms like Twitter for breaking updates.
You can call this tool without any parameters to get the latest news. It returns 10 news articles by default.
Capabilities:
- Source, filter, deduplicate, and summarize up-to-date crypto news from many outlets in real time
- Continuously scans trusted crypto news sites (e.g. CoinDesk, CoinTelegraph, Decrypt) and even social platforms like Twitter for breaking updates.
- Summarize news in a concise manner, providing the most important details and context.
- Provides a link to the original article for more detailed information.
⚠️ COST WARNING: This tool makes an API call to ChainGPT which may incur costs. The key is charged 1 credit per 10 records returned
This tool allows you to interact with ChainGPT's AI News Generator.
Args:
categoryId(number[], optional): The category ID of the news to fetch. Blockchain Gaming = [2], DAO = [3], DApps = [4], DeFi = [5], Lending = [6], Metaverse = [7], NFT = [8], Stablecoins = [9], Cryptocurrency = [64], Decentralized = [65], Smart Contracts = [66], Distributed Ledger = [67], Cryptography = [68], Digital Assets = [69], Tokenization = [70], Consensus Mechanisms = [71], ICO (Initial Coin Offering) = [72], Crypto Wallets = [73], Web3.0 = [74], Interoperability = [75], Mining = [76], Cross-Chain Transactions = [77], Exchange = [78].
subCategoryId(number[], optional): The sub-category ID of the news to fetch. Bitcoin = [11], BNB Chain = [12], Celo = [13], Cosmos = [14], Ethereum = [15], Filecoin = [16], Flow = [17], Harmony = [41], Polygon = [20], XRP Ledger = [21], Solana = [22], TRON = [23], Cardano = [34], Monero = [19], Cronos = [36], Ontology = [44], WAX = [26], Optimism = [45], Other (Miscellaneous) = [46], PlatON = [47], Steem = [56], Rangers = [49], SX Network = [57], Ronin = [50], Telos = [58], Shiden = [51], Telos EVM = [59], SKALE = [52], Theta = [61], Stacks = [54], ThunderCore = [62], Stargaze = [55].
tokenId(number[], optional): The token ID of the news to fetch. BTC = [79], MATIC = [91], ETH = [80], DOT = [92], USDT = [81], LTC = [93], BNB = [82], WBTC = [94], XRP = [83], BCH = [95], USDC = [84], LINK = [96], SOL = [85], SHIB = [97], ADA = [86], LEO = [98], DOGE = [87], TUSD = [99], TRX = [88], AVAX = [100], TON = [89], XLM = [101], DAI = [90], XMR = [102], UNI = [105], OKB = [103], ETC = [106], ATOM = [104], BUSD = [107], HBAR = [108].
searchQuery(string, optional): The search query to fetch the news.
limit(number, optional): The number of news to fetch. Default is 10. You can increase this to retrieve more articles in one call (e.g. limit: 20 for 20 articles). Note that higher limits will consume additional credits (see Rate Limits & Credits). If you only want a small number of the latest articles, you can set a smaller limit as well.
offset(number, optional): The offset of the news to fetch. Default is 0. This is used for pagination. For example, to get the second page of results when using a limit of 10, you would set offset: 10 (skip the first 10 articles, return the next set). Similarly, offset: 20 would fetch the third page (items 21–30), and so on.
fetchAfter(Datetime, optional): The date after which to fetch the news. Provide a JavaScript Date object or a date string (which will be interpreted in UTC by the API). For example, fetchAfter: new Date('2024-01-01') will fetch news items published from January 1, 2024 onward. This is useful for getting news within a certain time range (e.g., only recent news).
sortBy(string, optional): The field by which to sort the news. Currently, the only supported sort key is 'createdAt', which corresponds to the article's publication time. By default, results are sorted by newest (most recent) first. If not provided, the SDK will sort by createdAt descending. (At this time, no other sort fields are supported.)
Returns:
The response from ChainGPT AI to the provided question or message.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| categoryId | No | The category ID of the news to fetch. | |
| subCategoryId | No | The sub-category ID of the news to fetch. | |
| tokenId | No | The token ID of the news to fetch. | |
| searchQuery | No | The search query to fetch the news. | |
| sortBy | No | The field to sort the news by. Default and currently only supported field is 'createdAt'. | |
| limit | No | The number of news to fetch. Default is 10. You can increase this to retrieve more articles in one call (e.g. limit: 20 for 20 articles). Note that higher limits will consume additional credits. MIN: 10 | |
| offset | No | The offset of the news to fetch. Default is 0. This is used for pagination. For example, to get the second page of results when using a limit of 10, you would set offset: 10 (skip the first 10 articles, return the next set). Similarly, offset: 20 would fetch the third page (items 21–30), and so on. | |
| fetchAfter | No | The date after which to fetch the news. Provide a JavaScript Date object or a date string (which will be interpreted in UTC by the API). For example, fetchAfter: new Date('2024-01-01') will fetch news items published from January 1, 2024 onward. This is useful for getting news within a certain time range (e.g., only recent news). |
Implementation Reference
- src/tools/news.ts:46-82 (handler)The core handler function that fetches AI crypto news using the AINews SDK, formats the articles into a string, logs the data, and returns structured content. Handles AINewsError specifically and generic errors.async (params) => { try { const response = await aiNews.getNews(params); const formattedResponse = formatArticlesToString(response.data); console.error(response.data); return { content: [ { type: "text", text: formattedResponse, }, ], }; } catch (error) { if (error instanceof Errors.AINewsError) { return { content: [ { type: "text", text: error.message, }, ], isError: true, }; } else { return { content: [ { type: "text", text: "get_ai_crypto_news_Unknown_Error", }, ], isError: true, }; } } }
- src/types/schema.ts:16-25 (schema)Zod schema defining optional input parameters for filtering and paginating the news query: categoryId, subCategoryId, tokenId, searchQuery, sortBy, limit, offset, fetchAfter.export const aiNewsSchema = { categoryId: z.array(z.number()).optional().describe("The category ID of the news to fetch. "), subCategoryId: z.array(z.number()).optional().describe("The sub-category ID of the news to fetch."), tokenId: z.array(z.number()).optional().describe("The token ID of the news to fetch."), searchQuery: z.string().optional().describe("The search query to fetch the news."), sortBy: z.string().optional().describe("The field to sort the news by. Default and currently only supported field is 'createdAt'."), limit: z.number().optional().describe("The number of news to fetch. Default is 10. You can increase this to retrieve more articles in one call (e.g. limit: 20 for 20 articles). Note that higher limits will consume additional credits. MIN: 10"), offset: z.number().optional().describe("The offset of the news to fetch. Default is 0. This is used for pagination. For example, to get the second page of results when using a limit of 10, you would set offset: 10 (skip the first 10 articles, return the next set). Similarly, offset: 20 would fetch the third page (items 21–30), and so on."), fetchAfter: z.date().optional().describe("The date after which to fetch the news. Provide a JavaScript Date object or a date string (which will be interpreted in UTC by the API). For example, fetchAfter: new Date('2024-01-01') will fetch news items published from January 1, 2024 onward. This is useful for getting news within a certain time range (e.g., only recent news)."), }
- src/tools/news.ts:12-84 (registration)Function that registers the 'chaingpt_get_ai_crypto_news' tool on the MCP server, providing name, detailed description, input schema, and handler function. Called from tools/index.ts.export const registerNewsTools = () => { server.tool( "chaingpt_get_ai_crypto_news", ` Get the latest AI-related crypto and web3 articles. Web3-native AI assistant built specifically for the crypto world. it source, filter, deduplicate, and summarize up-to-date crypto news from many outlets in real time it continuously scans trusted crypto news sites (e.g. CoinDesk, CoinTelegraph, Decrypt) and even social platforms like Twitter for breaking updates. You can call this tool without any parameters to get the latest news. It returns 10 news articles by default. Capabilities: - Source, filter, deduplicate, and summarize up-to-date crypto news from many outlets in real time - Continuously scans trusted crypto news sites (e.g. CoinDesk, CoinTelegraph, Decrypt) and even social platforms like Twitter for breaking updates. - Summarize news in a concise manner, providing the most important details and context. - Provides a link to the original article for more detailed information. ⚠️ COST WARNING: This tool makes an API call to ChainGPT which may incur costs. The key is charged 1 credit per 10 records returned This tool allows you to interact with ChainGPT's AI News Generator. Args: categoryId(number[], optional): The category ID of the news to fetch. Blockchain Gaming = [2], DAO = [3], DApps = [4], DeFi = [5], Lending = [6], Metaverse = [7], NFT = [8], Stablecoins = [9], Cryptocurrency = [64], Decentralized = [65], Smart Contracts = [66], Distributed Ledger = [67], Cryptography = [68], Digital Assets = [69], Tokenization = [70], Consensus Mechanisms = [71], ICO (Initial Coin Offering) = [72], Crypto Wallets = [73], Web3.0 = [74], Interoperability = [75], Mining = [76], Cross-Chain Transactions = [77], Exchange = [78]. subCategoryId(number[], optional): The sub-category ID of the news to fetch. Bitcoin = [11], BNB Chain = [12], Celo = [13], Cosmos = [14], Ethereum = [15], Filecoin = [16], Flow = [17], Harmony = [41], Polygon = [20], XRP Ledger = [21], Solana = [22], TRON = [23], Cardano = [34], Monero = [19], Cronos = [36], Ontology = [44], WAX = [26], Optimism = [45], Other (Miscellaneous) = [46], PlatON = [47], Steem = [56], Rangers = [49], SX Network = [57], Ronin = [50], Telos = [58], Shiden = [51], Telos EVM = [59], SKALE = [52], Theta = [61], Stacks = [54], ThunderCore = [62], Stargaze = [55]. tokenId(number[], optional): The token ID of the news to fetch. BTC = [79], MATIC = [91], ETH = [80], DOT = [92], USDT = [81], LTC = [93], BNB = [82], WBTC = [94], XRP = [83], BCH = [95], USDC = [84], LINK = [96], SOL = [85], SHIB = [97], ADA = [86], LEO = [98], DOGE = [87], TUSD = [99], TRX = [88], AVAX = [100], TON = [89], XLM = [101], DAI = [90], XMR = [102], UNI = [105], OKB = [103], ETC = [106], ATOM = [104], BUSD = [107], HBAR = [108]. searchQuery(string, optional): The search query to fetch the news. limit(number, optional): The number of news to fetch. Default is 10. You can increase this to retrieve more articles in one call (e.g. limit: 20 for 20 articles). Note that higher limits will consume additional credits (see Rate Limits & Credits). If you only want a small number of the latest articles, you can set a smaller limit as well. offset(number, optional): The offset of the news to fetch. Default is 0. This is used for pagination. For example, to get the second page of results when using a limit of 10, you would set offset: 10 (skip the first 10 articles, return the next set). Similarly, offset: 20 would fetch the third page (items 21–30), and so on. fetchAfter(Datetime, optional): The date after which to fetch the news. Provide a JavaScript Date object or a date string (which will be interpreted in UTC by the API). For example, fetchAfter: new Date('2024-01-01') will fetch news items published from January 1, 2024 onward. This is useful for getting news within a certain time range (e.g., only recent news). sortBy(string, optional): The field by which to sort the news. Currently, the only supported sort key is 'createdAt', which corresponds to the article's publication time. By default, results are sorted by newest (most recent) first. If not provided, the SDK will sort by createdAt descending. (At this time, no other sort fields are supported.) Returns: The response from ChainGPT AI to the provided question or message. `, aiNewsSchema, async (params) => { try { const response = await aiNews.getNews(params); const formattedResponse = formatArticlesToString(response.data); console.error(response.data); return { content: [ { type: "text", text: formattedResponse, }, ], }; } catch (error) { if (error instanceof Errors.AINewsError) { return { content: [ { type: "text", text: error.message, }, ], isError: true, }; } else { return { content: [ { type: "text", text: "get_ai_crypto_news_Unknown_Error", }, ], isError: true, }; } } } ); };
- src/utils/helper.ts:59-110 (helper)Utility function called by the handler to format the array of news articles into a human-readable string with titles, dates, categories, descriptions, and optional details.export function formatArticlesToString(articles: Article[], detailed = true) { if (!Array.isArray(articles) || articles.length === 0) { return "No articles found."; } let result = ""; articles.forEach((article, index) => { // Add a separator between articles except for the first one if (index > 0) { result += "\n\n" + "=".repeat(80) + "\n\n"; } // Add title result += `${index + 1}. ${article.title}\n`; // Add publication date const pubDate = new Date(article.pubDate); result += `Published: ${pubDate.toLocaleString()}\n`; // Add category and tokens info const categoryName = article.category ? article.category.name : "Uncategorized"; const tokenName = article.token ? article.token.name : "No specific token"; result += `Category: ${categoryName} | Token: ${tokenName}\n`; // Add blockchain info (from subCategory) const blockchainName = article.subCategory ? article.subCategory.name : "No specific blockchain"; result += `Blockchain: ${blockchainName}\n\n`; // Add description result += `${article.description}\n`; // Add additional details if detailed mode is enabled if (detailed) { result += `\nAuthor: ${article.author}\n`; result += `Image URL: ${article.imageUrl}\n`; if (article.isFeatured) { result += "Featured Article\n"; } if (article.isTopStory) { result += "Top Story\n"; } result += `Created: ${new Date(article.createdAt).toLocaleString()}\n`; result += `Last Updated: ${new Date(article.updatedAt).toLocaleString()}\n`; } }); return result; }
- src/index.ts:16-16 (registration)Top-level call to registerTools() after server initialization, which chains to registerNewsTools() and ultimately registers the tool.registerTools();