Home / Fixes

CoinGecko MCP execute: "The code is missing a top-level run function"

Error: The code is missing a top-level `run` function

What causes it

The execute tool runs your code inside a fixed template and needs an async function named run that takes the client.

How to fix it

  1. Wrap your code: async function run(client) { return await client.simple.price.get({ ids: "bitcoin", vs_currencies: "usd" }); }
  2. That call returned the live bitcoin price in about 1 s in our test.

Where we hit it

Related fixes

All MCP fixes | Setup guides | Hit a different error? Request a test