iflytek/astron-agent · error · BusinessException

8310

8310

Error message

toolbox.param.type.not.match

What it means

Thrown by ToolBoxService when a parameter's declared "type" is neither one of the recognized simple types nor one of the recognized complex types. The dispatcher (processSimpleTypeParam / processComplexTypeParam) has no handler for it, so the parameter schema is rejected as having an invalid type name.

Solutions

  1. Correct the "type" value to a supported simple type (STRING, NUMBER, INTEGER, BOOLEAN) or a supported complex type (e.g. OBJECT, ARRAY) exactly as the API expects.
  2. Check isSimpleType/isComplexType in ToolBoxService for the exact accepted type strings and case sensitivity.
  3. If the type came from an export of a newer platform version, upgrade or remap it to a supported type.
  4. Add client-side validation against the allowed type list before submitting the schema.

Example fix

// before
{"paramName": "timeout", "type": "num"}
// after
{"paramName": "timeout", "type": "NUMBER"}
Defensive patterns

Strategy: validation

Validate before calling

Set<String> allowed = Set.of("STRING", "NUMBER", "INTEGER", "BOOLEAN", "OBJECT", "ARRAY");
for (JSONObject p : paramArray) {
    String t = p.getString("type");
    if (t != null && !allowed.contains(t)) {
        throw new IllegalArgumentException("Unsupported param type: " + t);
    }
}

Type guard

boolean isKnownType(String t) {
    return t != null && Set.of("STRING", "NUMBER", "INTEGER", "BOOLEAN", "OBJECT", "ARRAY").contains(t);
}

Try / catch

try {
    toolBoxService.saveToolSchema(paramArray);
} catch (BusinessException e) {
    if ("TOOLBOX_PARAM_TYPE_NOT_MATCH".equals(String.valueOf(e.getCode()))) {
        // map the unknown type to the nearest supported one and resubmit
    }
}

Prevention

When it happens

Trigger: Saving/processing a tool parameter whose "type" string is not in the service's recognized set — e.g. a typo ("nunmber", "str"), a wrong-cased value ("Number"), or a type introduced by a newer API version not supported by this service build.

Common situations: Manual JSON schema editing; tools exported from a different version/platform with extended type names; locale or case mistakes when typing the type.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/9f3410026c7ee671. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/tool/ToolBoxService.java:1564

    /**
     * Process single parameter
     */
    private void processParam(JSONObject jsonObject, JSONObject targetObject, Integer previewType, boolean input) {
        // Validate parameter basic information
        validateParamBasicInfo(jsonObject, previewType);

        String type = jsonObject.getString("type");
        String params = jsonObject.getString("title");
        String title = jsonObject.getString("paramName");
        String description = jsonObject.getString("description");

        if (isSimpleType(type)) {
            processSimpleTypeParam(jsonObject, targetObject, params, title, description, type, input);
        } else if (isComplexType(type)) {
            processComplexTypeParam(jsonObject, targetObject, previewType, params, title, description, type, input);
        } else {
            throw new BusinessException(ResponseEnum.TOOLBOX_PARAM_TYPE_NOT_MATCH);
        }
    }

    /**
     * Validate parameter basic information
     */
    private void validateParamBasicInfo(JSONObject jsonObject, Integer previewType) {
        String type = jsonObject.getString("type");
        if (StringUtils.isEmpty(type)) {
            throw new BusinessException(ResponseEnum.TOOLBOX_PARAM_CANNOT_EMPTY);
        }

        String params = jsonObject.getString("title");
        if (previewType == 0 && StringUtils.isEmpty(params)) {
            throw new BusinessException(ResponseEnum.TOOLBOX_PARAM_CANNOT_EMPTY);
        }

        String title = jsonObject.getString("paramName");

View on GitHub (pinned to 5e758547a8)