CoplayDev/unity-mcp · error · NotSupportedException

Unknown marketplace provider '{id}'.

Error message

Unknown marketplace provider '{id}'.

What it means

AssetGenProviders.Marketplace lowercases the provider id and switches over it, returning an adapter for known marketplace providers ('sketchfab' only). Any other id hits default and throws NotSupportedException.

Source

Thrown at MCPForUnity/Editor/Services/AssetGen/Providers/AssetGenProviders.cs:59

        public static IAudioProviderAdapter Audio(string id)
        {
            switch ((id ?? string.Empty).ToLowerInvariant())
            {
                case "fal":
                    return new FalAudioAdapter();
                default:
                    throw new NotSupportedException($"Unknown audio provider '{id}'.");
            }
        }

        public static IMarketplaceProviderAdapter Marketplace(string id)
        {
            switch ((id ?? string.Empty).ToLowerInvariant())
            {
                case "sketchfab":
                    return new SketchfabAdapter();
                default:
                    throw new NotSupportedException($"Unknown marketplace provider '{id}'.");
            }
        }

        public static IReadOnlyList<ProviderInfo> List()
        {
            return new List<ProviderInfo>
            {
                new ProviderInfo { Id = "tripo", Kind = "model", Configured = IsConfigured("tripo"), Capabilities = new[] { "text", "image" } },
                new ProviderInfo { Id = "meshy", Kind = "model", Configured = IsConfigured("meshy"), Capabilities = new[] { "text", "image" } },
                new ProviderInfo { Id = "sketchfab", Kind = "marketplace", Configured = IsConfigured("sketchfab"), Capabilities = new[] { "search", "import" } },
                new ProviderInfo { Id = "fal", Kind = "image", Configured = IsConfigured("fal"), Capabilities = new[] { "text", "image" } },
                new ProviderInfo { Id = "openrouter", Kind = "image", Configured = IsConfigured("openrouter"), Capabilities = new[] { "text", "image" } },
                // fal appears twice by design — once per kind (image + audio) — sharing the single "fal" key.
                new ProviderInfo { Id = "fal", Kind = "audio", Configured = IsConfigured("fal"), Capabilities = new[] { "text", "music", "sfx" } },
            };
        }

        private static bool IsConfigured(string id)

View on GitHub (pinned to c21bf496bc)

Solutions

  1. Use the supported marketplace provider id: 'sketchfab'.
  2. Enumerate providers via AssetGenProviders.List() and filter by Kind == 'marketplace' before selecting.
  3. Implement and register the adapter before referencing a new marketplace.
Defensive patterns

Strategy: validation

Validate before calling

var supported = AssetGenProviders.List().Where(p => p.Kind == "marketplace").Select(p => p.Id).ToHashSet();
if (!supported.Contains(id.ToLowerInvariant()))
    throw new ArgumentException($"Unknown marketplace provider '{id}'. Supported: {string.Join(", ", supported)}");
var adapter = AssetGenProviders.Marketplace(id);

Type guard

static readonly HashSet<string> KnownMarketplaceProviders = new HashSet<string> { "sketchfab" };
static bool IsKnownMarketplaceProvider(string id) => KnownMarketplaceProviders.Contains((id ?? "").ToLowerInvariant());

Try / catch

try { var adapter = AssetGenProviders.Marketplace(id); }
catch (NotSupportedException ex) when (ex.Message.Contains("Unknown marketplace provider"))
{
    var adapter = AssetGenProviders.Marketplace("sketchfab");
}

Prevention

When it happens

Trigger: Calling Marketplace() with an id other than 'sketchfab', e.g. 'cgtrader', 'turbo', or a typo.

Common situations: An AI/LLM hallucinating a marketplace name; assuming a marketplace integration exists when only Sketchfab is implemented; config referencing an unimplemented marketplace.

Related errors


AI-assisted analysis of CoplayDev/unity-mcp@c21bf496bc (2026-08-13). Data as JSON: /api/errors/90fd4e897fc4d9fe. Report an issue: GitHub.