Skip to main content
Glama
noop-provider.ts1.65 kB
/** * No-Op AI Provider * * Placeholder provider used when no AI API keys are configured. * Allows the MCP server to start successfully even without AI capabilities, * enabling tools that don't require AI (e.g., prompts, project-setup) to function. */ import { AIProvider, AIResponse, AgenticResult, ToolLoopConfig } from '../ai-provider.interface'; export class NoOpAIProvider implements AIProvider { private static readonly ERROR_MESSAGE = 'AI provider is not available. No API keys configured. ' + 'Please set ANTHROPIC_API_KEY, OPENAI_API_KEY, or another supported provider key.'; /** * Creates a NoOp provider that doesn't require API keys */ constructor() { // No initialization needed } /** * Always returns false since no actual AI provider is configured */ isInitialized(): boolean { return false; } /** * Returns a placeholder model name */ getDefaultModel(): string { return 'none'; } /** * Returns the provider type */ getProviderType(): string { return 'noop'; } /** * Returns the model name */ getModelName(): string { return 'none'; } /** * Throws error explaining AI is not available */ async sendMessage( _message: string, _operation?: string, _evaluationContext?: { user_intent?: string; interaction_id?: string; } ): Promise<AIResponse> { throw new Error(NoOpAIProvider.ERROR_MESSAGE); } /** * Throws error explaining AI is not available */ async toolLoop(_config: ToolLoopConfig): Promise<AgenticResult> { throw new Error(NoOpAIProvider.ERROR_MESSAGE); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vfarcic/dot-ai'

If you have feedback or need assistance with the MCP directory API, please join our Discord server