CoplayDev/unity-mcp · error · Exception
Sketchfab download returned no gltf url for '{uid}': {trunca
Error message
Sketchfab download returned no gltf url for '{uid}': {truncated_response} What it means
Thrown by SketchfabAdapter.ResolveDownloadUrlAsync after a successful HTTP+JSON parse when the body has no gltf.url. The download endpoint is expected to return {gltf:{url:...}}; absence usually means the model is not downloadable under the current token's permissions, or the API shape changed. The uid and truncated response are included, scrubbed of the key.
Source
Thrown at MCPForUnity/Editor/Services/AssetGen/Providers/SketchfabAdapter.cs:61
spec.Headers["Authorization"] = "Token " + apiKey;
HttpResult res = await http.SendAsync(spec, ct);
return RawOk(res, apiKey, "preview");
}
public async Task<string> ResolveDownloadUrlAsync(string uid, string apiKey, IHttpTransport http, CancellationToken ct)
{
if (string.IsNullOrEmpty(uid)) throw new ArgumentNullException(nameof(uid));
if (http == null) throw new ArgumentNullException(nameof(http));
var spec = new HttpRequestSpec { Method = "GET", Url = ModelsEndpoint + "/" + uid + "/download" };
spec.Headers["Authorization"] = "Token " + apiKey;
HttpResult res = await http.SendAsync(spec, ct);
JObject json = ParseOk(res, apiKey, "download");
string url = json["gltf"]?["url"]?.ToString();
if (string.IsNullOrEmpty(url))
{
throw new Exception(SecretRedactor.Scrub(
$"Sketchfab download returned no gltf url for '{uid}': {ProviderHttp.Truncate(res?.Text)}", apiKey));
}
return url;
}
private static string RawOk(HttpResult res, string apiKey, string phase)
{
string text = ProviderHttp.BodyText(res);
bool ok = res?.Ok == true;
if (!ok)
throw new Exception(SecretRedactor.Scrub($"Sketchfab {phase} failed (status={res?.Status}): {ProviderHttp.Truncate(text)}", apiKey));
return text ?? string.Empty;
}
private static JObject ParseOk(HttpResult res, string apiKey, string phase)
{
string text = ProviderHttp.BodyText(res);View on GitHub (pinned to c21bf496bc)
Solutions
- Re-search with downloadable=true (SketchfabAdapter.SearchAsync) and resolve the uid from a fresh result.
- Verify the Sketchfab API token has download permissions for the model's license tier.
- Inspect the truncated response to confirm whether Sketchfab returned a permission/license error inline.
- If the uid is correct but the API changed, update the gltf.url extraction path in ResolveDownloadUrlAsync.
Defensive patterns
Strategy: validation
Validate before calling
// Only resolve downloads for uids known to be downloadable. string results = await sketchfab.SearchAsync(query, categories, downloadable: true, count, cursor, key, http, ct); // pick a uid from results before calling ResolveDownloadUrlAsync.
Try / catch
try { return await sketchfab.ResolveDownloadUrlAsync(uid, key, http, ct); }
catch (Exception ex) when (ex.Message.Contains("no gltf url"))
{ /* re-search downloadable=true for a fresh uid, or verify token download rights */ } Prevention
- Always search with downloadable=true and use a uid from those results.
- Confirm the Sketchfab token has download permissions for the target license tier.
- Re-resolve uids fresh rather than caching them long-term.
When it happens
Trigger: ResolveDownloadUrlAsync called with a uid that is not downloadable; the Sketchfab account/token lacks download rights for that model's license; uid is stale/removed; API response format changed.
Common situations: User picked a uid from a search that wasn't filtered to downloadable=true; a model's license changed to non-downloadable; an unauthenticated/limited token; copy-paste of an old uid.
Related errors
- Sketchfab {phase} failed (status={res?.Status}): {detail}
- Sketchfab {phase} failed (status={res?.Status}): {truncated_
- uid required
- Unknown marketplace provider '{id}'.
- image_path must point to a file under the project's Assets f
AI-assisted analysis of CoplayDev/unity-mcp@c21bf496bc (2026-08-13).
Data as JSON: /api/errors/0a4a33dc988a7141.
Report an issue: GitHub.