alibaba/nacos · error · NacosApiException

10000

10000

Error message

Required parameter 'importType' is not present

What it means

Thrown by McpImportForm.validate() when importType is empty. This form (extends McpForm) backs the legacy MCP external-import flow. importType selects the data source format. Maps to code 10000 (PARAMETER_MISSING), HTTP 400. NOTE: ExternalDataTypeEnum and this import flow are @Deprecated since 3.x, planned removal in 3.4.0 — prefer the managed AI resource import at /v3/admin/ai/import.

Source

Thrown at ai/src/main/java/com/alibaba/nacos/ai/form/mcp/admin/McpImportForm.java:75

     */
    private String cursor;
    
    /**
     * Optional page size for URL-based import (items per page).
     */
    private Integer limit;
    
    /**
     * Optional fuzzy search keyword for registry import listing.
     * Only used when importType is 'url'.
     */
    private String search;
    
    @Override
    public void validate() throws NacosApiException {
        fillDefaultValue();
        if (StringUtils.isEmpty(importType)) {
            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
                "Required parameter 'importType' is not present");
        }
        if (StringUtils.isEmpty(data)) {
            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
                "Required parameter 'data' is not present");
        }
        if (ExternalDataTypeEnum.parseType(importType) == null) {
            throw new NacosApiException(NacosException.INVALID_PARAM,
                ErrorCode.PARAMETER_VALIDATE_ERROR,
                "importType must be one of: json, url, file");
        }
    }
    
    public String getImportType() {
        return importType;
    }
    
    public void setImportType(String importType) {

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Set importType to one of: json, url, file.
  2. Consider migrating to the non-deprecated /v3/admin/ai/import managed-resource import API.
  3. Ensure both importType and data are sent together (both are required).

Example fix

// before
importType omitted
// after
importType=json
Defensive patterns

Strategy: validation

Validate before calling

if (importType == null || importType.isEmpty()) {
    throw new IllegalArgumentException("importType required");
}

Type guard

static boolean isKnownImportType(String t) {
    return "json".equals(t) || "url".equals(t) || "file".equals(t);
}

Try / catch

catch (NacosApiException e) {
    if (e.getErrCode() == 10000 && e.getMessage().contains("importType")) { /* set type */ }
}

Prevention

When it happens

Trigger: Calling the MCP import endpoint with the `data` payload but no importType, e.g. POST with data=<json> and importType omitted.

Common situations: Migrating from the new AI resource import API to the legacy MCP import and forgetting importType; partial payload generated by a script.

Related errors


AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14). Data as JSON: /api/errors/d584e7541d8ec074. Report an issue: GitHub.