diff --git a/src/index.ts b/src/index.ts index 5134c1e..77bef76 100644 --- a/src/index.ts +++ b/src/index.ts @@ -804,10 +804,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { try { const { name, arguments: args } = request.params; - const apiKey = process.env.CLOUD_SERVICE + const apiKey = process.env.CLOUD_SERVICE==='ture' ? (request.params._meta?.apiKey as string) : FIRECRAWL_API_KEY; - if (process.env.CLOUD_SERVICE && !apiKey) { + if (process.env.CLOUD_SERVICE==='ture' && !apiKey) { throw new Error('No API key provided'); }