alibaba/nacos · error · NacosApiException
PARAMETER_VALIDATE_ERROR
PARAMETER_VALIDATE_ERROR
Error message
Unsupported ARD artifact resourceType: " + resourceType
What it means
Thrown by ArdArtifactService.get() when the requested resourceType is not one of the three supported AI resource kinds. The service only knows how to build artifacts for SKILL, PROMPT, and MCP (checked against AiResourceConstants.RESOURCE_TYPE_SKILL/PROMPT/MCP). Any other value falls through to this PARAMETER_VALIDATE_ERROR with HTTP 400. It is a client-side contract violation, not a server fault.
Source
Thrown at ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/service/ard/ArdArtifactService.java:92
String version, String mcpName) throws NacosException {
if (StringUtils.isBlank(namespaceId) || StringUtils.isBlank(resourceType)
|| StringUtils.isBlank(resourceName) || StringUtils.isBlank(version)) {
throw new NacosApiException(NacosException.INVALID_PARAM,
ErrorCode.PARAMETER_MISSING,
"Required ARD artifact parameter not present");
}
if (AiResourceConstants.RESOURCE_TYPE_SKILL.equals(resourceType)) {
return skillArtifact(namespaceId, resourceName, version);
}
if (AiResourceConstants.RESOURCE_TYPE_PROMPT.equals(resourceType)) {
return promptArtifact(namespaceId, resourceType, resourceName, version);
}
if (AiResourceConstants.RESOURCE_TYPE_MCP.equals(resourceType)) {
McpServerDetailInfo detail = mcpServerOperationService.getMcpServerDetail(namespaceId,
resourceName, mcpName, version);
return new ArdArtifact(ArdProtocolConstants.MEDIA_TYPE_MCP, detail);
}
throw new NacosApiException(NacosException.INVALID_PARAM,
ErrorCode.PARAMETER_VALIDATE_ERROR,
"Unsupported ARD artifact resourceType: " + resourceType);
}
private ArdArtifact skillArtifact(String namespaceId, String resourceName, String version)
throws NacosException {
SkillQueryResult result =
skillClientOperationService.querySkill(namespaceId, resourceName, version, null, null);
try {
return new ArdArtifact(ArdProtocolConstants.MEDIA_TYPE_SKILL_PACKAGE,
SkillUtils.toZipBytes(result.getSkill()));
} catch (Exception e) {
throw new NacosApiException(NacosException.SERVER_ERROR,
ErrorCode.DATA_ACCESS_ERROR, e, "Failed to create ARD Skill artifact");
}
}
private ArdArtifact promptArtifact(String namespaceId, String resourceType,View on GitHub (pinned to 9b989acdf1)
Solutions
- Set resourceType to exactly one of "skill", "prompt", or "mcp".
- If you are building the URL from a catalog entry, map the entry kind to the supported resourceType token before calling get().
- If you genuinely need a new resource kind, extend ArdArtifactService.get() with a new branch and the corresponding AiResourceConstants constant.
- Add a client-side guard that rejects unsupported resourceType before the remote call.
Example fix
// before String type = "agent"; ardArtifactService.get(ns, type, name, version, mcpName); // after String type = "mcp"; // must be skill | prompt | mcp ardArtifactService.get(ns, type, name, version, mcpName);
Defensive patterns
Strategy: validation
Validate before calling
private static final Set<String> ARD_ARTIFACT_TYPES =
Set.of("skill", "prompt", "mcp");
public void assertSupportedArtifactType(String resourceType) {
if (!ARD_ARTIFACT_TYPES.contains(resourceType)) {
throw new IllegalArgumentException(
"resourceType must be one of " + ARD_ARTIFACT_TYPES + ", got: " + resourceType);
}
} Type guard
private static final Set<String> SUPPORTED_ARD_TYPES =
Set.of("skill", "prompt", "mcp");
boolean isSupportedArtifactType(String t) {
return t != null && SUPPORTED_ARD_TYPES.contains(t);
} Prevention
- Maintain a shared constant set of supported resourceType values and validate against it on the client.
- When building artifact URLs from catalog entries, map the entry kind to the canonical resourceType token.
- Write an integration test asserting each supported type resolves and unsupported types return 400.
When it happens
Trigger: Calling the ARD artifact endpoint (e.g. GET on a catalog entry artifact URL) with resourceType set to an unrecognized string such as "agent", "tool", "workflow", or a typo like "skil" or "promt". The value must exactly equal the constant strings "skill", "prompt", or "mcp" (case-sensitive equals).
Common situations: A client hard-codes a resourceType that was never supported; an integrator assumes a new ARD resource kind exists before the server implements it; a URL builder passes the catalog entry kind verbatim while the server expects the lower-level resourceType token; enum/casing mismatch between client and server.
Related errors
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/5f02589324e2a160.
Report an issue: GitHub.