listSupportedFeedsByChain
Retrieve a comma-separated list of supported Chainlink price feeds for a specific blockchain network, enabling integration with AI agents and autonomous systems.
Instructions
Returns a comma-separated list of price feed names for a specified blockchain network
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:200-224 (handler)Handler function that takes a chain parameter, validates it, retrieves the list of feed names from feedsData for that chain, joins them into a comma-separated string, and returns it as text content in the MCP response format. Handles errors by returning an error message.async ({ chain }) => { try { // Validate inputs const chainKey = chain.toLowerCase(); listSupportedFeedsByChainSchema.parse({ chain }); // Get feed names as comma-separated string const feedNames = feedsData[chainKey].feeds.map((feed) => feed.name).join(','); return { content: [{ type: 'text', text: feedNames }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error.message}` }], isError: true }; } }
- index.js:189-193 (schema)Zod schema for the tool input, requiring a 'chain' string parameter validated against keys in feedsData (supported chains).const listSupportedFeedsByChainSchema = z.object({ chain: z.string().refine((val) => feedsData[val.toLowerCase()], { message: 'Unsupported chain' }).describe('The blockchain network, e.g., ethereum or base') });
- index.js:196-225 (registration)MCP server.tool registration for 'listSupportedFeedsByChain', including name, description, schema reference, and inline handler function.server.tool( 'listSupportedFeedsByChain', 'Returns a comma-separated list of price feed names for a specified blockchain network', listSupportedFeedsByChainSchema, async ({ chain }) => { try { // Validate inputs const chainKey = chain.toLowerCase(); listSupportedFeedsByChainSchema.parse({ chain }); // Get feed names as comma-separated string const feedNames = feedsData[chainKey].feeds.map((feed) => feed.name).join(','); return { content: [{ type: 'text', text: feedNames }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error.message}` }], isError: true }; } } );