Skip to main content
Glama

chaingpt_get_ai_crypto_news

Fetch real-time AI and crypto news from trusted sources, filtered and summarized for clarity. Access articles by category, token, or search query to stay updated on Web3 developments.

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
NameRequiredDescriptionDefault
categoryIdNoThe category ID of the news to fetch.
fetchAfterNoThe 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).
limitNoThe 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
offsetNoThe 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.
searchQueryNoThe search query to fetch the news.
sortByNoThe field to sort the news by. Default and currently only supported field is 'createdAt'.
subCategoryIdNoThe sub-category ID of the news to fetch.
tokenIdNoThe token ID of the news to fetch.

Implementation Reference

  • The main handler function that executes the tool: fetches AI crypto news via aiNews.getNews(params), formats the articles into a string using formatArticlesToString, logs the data, returns formatted text content, and handles specific AINewsError or 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, }; } } }
  • Zod schema defining the input parameters for the chaingpt_get_ai_crypto_news tool, including optional fields like categoryId, subCategoryId, tokenId, searchQuery, sortBy, limit, offset, and 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)."), }
  • Registration of the tool 'chaingpt_get_ai_crypto_news' via server.tool, providing name, multi-line description, aiNewsSchema, and the handler function.
    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, }; } } } ); };
  • Helper function to format the array of news articles into a formatted string with details like title, date, category, description, etc.
    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/tools/index.ts:1-7 (registration)
    Top-level tool registration function that calls registerNewsTools() to register the news tools including chaingpt_get_ai_crypto_news.
    import {registerChatTools} from "./chat.js"; import {registerNewsTools} from "./news.js"; export const registerTools = () => { registerChatTools(); registerNewsTools(); }

Other Tools

Related Tools

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/kohasummons/chaingpt-mcp'

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