get-chain-list
Retrieve comprehensive blockchain network information to identify available chains for MetaMask wallet interactions.
Instructions
Get a list of all chains information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/chainlist.ts:9-26 (handler)The execute handler fetches the chain list from chainlist.org/rpcs.json, parses it, and returns the JSON string in a structured content response.execute: async () => { const url = "https://chainlist.org/rpcs.json"; const response = await fetch(url); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); return { content: [ { type: "text", text: JSON.stringify(data), }, ], }; },
- src/tools/chainlist.ts:8-8 (schema)Zod schema defining empty input parameters for the tool.parameters: z.object({}),
- src/tools/chainlist.ts:4-28 (registration)Registers the 'get-chain-list' tool on the FastMCP server instance.export function registerChainlistTools(server: FastMCP): void { server.addTool({ name: "get-chain-list", description: "Get a list of all chains information.", parameters: z.object({}), execute: async () => { const url = "https://chainlist.org/rpcs.json"; const response = await fetch(url); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); return { content: [ { type: "text", text: JSON.stringify(data), }, ], }; }, }); };