is_service_down
Check whether an AI service like Claude, OpenAI, or Gemini is currently down. Input the service name to get real-time status and identify outages or issues.
Instructions
Check if a specific AI service is currently down or experiencing issues.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| service | Yes | Service name to check (e.g. "claude", "openai", "gemini", "mistral", "cohere", "hugging face", "replicate") |
Implementation Reference
- mcp-server/src/index.ts:120-152 (handler)The tool handler for 'is_service_down'. It fetches service status from the TensorFeed API, finds a matching service by name/provider, and returns its operational status.
server.tool( 'is_service_down', 'Check if a specific AI service is currently down or experiencing issues.', { service: z.string().describe('Service name to check (e.g. "claude", "openai", "gemini", "mistral", "cohere", "hugging face", "replicate")'), }, async ({ service }) => { const data = await fetchJSON('/status') as { services: { name: string; provider: string; status: string; components: { name: string; status: string }[] }[]; }; const match = data.services.find(s => s.name.toLowerCase().includes(service.toLowerCase()) || s.provider.toLowerCase().includes(service.toLowerCase()) ); if (!match) { return { content: [{ type: 'text' as const, text: `Service "${service}" not found. Available services: ${data.services.map(s => s.name).join(', ')}` }] }; } const statusEmoji = match.status === 'operational' ? 'OK' : match.status === 'degraded' ? 'DEGRADED' : 'DOWN'; const components = match.components.length > 0 ? '\nComponents:\n' + match.components.map(c => ` ${c.name}: ${c.status}`).join('\n') : ''; return { content: [{ type: 'text' as const, text: `${statusEmoji} ${match.name} (${match.provider}) is ${match.status}${components}` }] }; } ); - mcp-server/src/index.ts:123-125 (schema)The input schema for the 'is_service_down' tool, accepting a 'service' string parameter.
{ service: z.string().describe('Service name to check (e.g. "claude", "openai", "gemini", "mistral", "cohere", "hugging face", "replicate")'), }, - mcp-server/src/index.ts:120-152 (registration)Registration of the 'is_service_down' tool via the McpServer.tool() method.
server.tool( 'is_service_down', 'Check if a specific AI service is currently down or experiencing issues.', { service: z.string().describe('Service name to check (e.g. "claude", "openai", "gemini", "mistral", "cohere", "hugging face", "replicate")'), }, async ({ service }) => { const data = await fetchJSON('/status') as { services: { name: string; provider: string; status: string; components: { name: string; status: string }[] }[]; }; const match = data.services.find(s => s.name.toLowerCase().includes(service.toLowerCase()) || s.provider.toLowerCase().includes(service.toLowerCase()) ); if (!match) { return { content: [{ type: 'text' as const, text: `Service "${service}" not found. Available services: ${data.services.map(s => s.name).join(', ')}` }] }; } const statusEmoji = match.status === 'operational' ? 'OK' : match.status === 'degraded' ? 'DEGRADED' : 'DOWN'; const components = match.components.length > 0 ? '\nComponents:\n' + match.components.map(c => ` ${c.name}: ${c.status}`).join('\n') : ''; return { content: [{ type: 'text' as const, text: `${statusEmoji} ${match.name} (${match.provider}) is ${match.status}${components}` }] }; } ); - mcp-server/src/index.ts:19-59 (helper)The fetchJSON helper used by the tool to call the TensorFeed API endpoint.
async function fetchJSON(path: string, opts: FetchOptions = {}): Promise<unknown> { const headers: Record<string, string> = { 'User-Agent': `TensorFeed-MCP/${SDK_VERSION}`, }; if (opts.body !== undefined) headers['Content-Type'] = 'application/json'; if (opts.auth) { const token = process.env.TENSORFEED_TOKEN; if (!token) { throw new Error( 'TENSORFEED_TOKEN env var is not set. Premium MCP tools require a bearer token. ' + 'Buy credits at https://tensorfeed.ai/developers/agent-payments and pass the returned tf_live_... token via the TENSORFEED_TOKEN env var in your MCP client config.', ); } headers['Authorization'] = `Bearer ${token}`; } const res = await fetch(`${API_BASE}${path}`, { method: opts.method ?? 'GET', headers, ...(opts.body !== undefined ? { body: JSON.stringify(opts.body) } : {}), }); if (!res.ok) { let errPayload: unknown; try { errPayload = await res.json(); } catch { errPayload = await res.text().catch(() => ''); } if (res.status === 402) { throw new Error( `Payment required (402). Your token may be out of credits. Top up at https://tensorfeed.ai/developers/agent-payments. Detail: ${JSON.stringify(errPayload)}`, ); } if (res.status === 401) { throw new Error( `Token rejected (401). Check that TENSORFEED_TOKEN is set to a valid tf_live_... token. Detail: ${JSON.stringify(errPayload)}`, ); } throw new Error(`API error ${res.status}: ${JSON.stringify(errPayload)}`); } return res.json(); }