{"record":{"id":"fd4b5edb2fbea33c","repo":"ruvnet/ruflo","slug":"no-llm-provider-available","errorCode":null,"errorMessage":"No LLM provider available","messagePattern":"No LLM provider available","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/mcp/src/sampling.ts","lineNumber":117,"sourceCode":"  }\n\n  /**\n   * Create a message (sampling/createMessage)\n   */\n  async createMessage(\n    request: CreateMessageRequest,\n    context?: SamplingContext\n  ): Promise<CreateMessageResult> {\n    const startTime = Date.now();\n    this.requestCount++;\n\n    // Validate request\n    this.validateRequest(request);\n\n    // Select provider\n    const provider = this.selectProvider(request.modelPreferences);\n    if (!provider) {\n      throw new Error('No LLM provider available');\n    }\n\n    // Apply defaults\n    const fullRequest = this.applyDefaults(request);\n\n    if (this.config.enableLogging) {\n      this.logger.debug('Sampling request', {\n        provider: provider.name,\n        messageCount: request.messages.length,\n        maxTokens: fullRequest.maxTokens,\n        sessionId: context?.sessionId,\n      });\n    }\n\n    this.emit('sampling:start', { provider: provider.name, context });\n\n    try {\n      // Call provider with timeout","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/mcp/src/sampling.ts#L99-L135","documentation":"SamplingManager.createMessage() asked selectProvider() for a provider matching the request's model preferences and got null — no LLM provider is registered (or none satisfies the preferences). Sampling cannot proceed without a backend; register a provider via registerLLMProvider before sampling.","triggerScenarios":"A sampling/createMessage request reaches the MCP server but no LLM provider has been configured or registered.","commonSituations":"Happens when the server is started without an API key for any provider, or when provider initialization failed silently at startup.","solutions":["Configure at least one LLM provider (e.g. set ANTHROPIC_API_KEY) before enabling sampling.","Check provider initialization logs at startup and fail fast if no provider registers.","Return a clear capability advertisement so clients know sampling is unavailable."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}