{"record":{"id":"fff97fbd3a49117f","repo":"sgl-project/sglang","slug":"kimi-k3-required-parameter-key-r-accepts-no-valu","errorCode":null,"errorMessage":"Kimi K3 required parameter {key!r} accepts no values","messagePattern":"Kimi K3 required parameter (.+?) accepts no values","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/function_call/kimik3_structural_tag.py","lineNumber":403,"sourceCode":"        isinstance(item, str) for item in required\n    ):\n        raise ValueError(\"Kimi K3 tool parameters 'required' must be a string list\")\n\n    required_set = set(required)\n    missing = required_set.difference(properties)\n    if missing:\n        raise ValueError(\n            f\"Kimi K3 required parameters are missing schemas: {sorted(missing)!r}\"\n        )\n\n    elements: List[Format] = []\n    for key, schema in properties.items():\n        if not isinstance(key, str) or not isinstance(schema, (bool, dict)):\n            raise ValueError(\"Kimi K3 tool property schemas must be JSON schemas\")\n        argument = _known_argument_format(key, schema, parameters)\n        if argument is None:\n            if key in required_set:\n                raise ValueError(\n                    f\"Kimi K3 required parameter {key!r} accepts no values\"\n                )\n            continue\n        elements.append(\n            argument if key in required_set else OptionalFormat(content=argument)\n        )\n\n    additional = parameters.get(\"additionalProperties\", True)\n    if additional is True:\n        elements.append(StarFormat(content=_dynamic_argument_format(True, parameters)))\n    elif isinstance(additional, dict):\n        elements.append(\n            StarFormat(content=_dynamic_argument_format(additional, parameters))\n        )\n    elif additional is not False:\n        raise ValueError(\n            \"Kimi K3 tool parameters 'additionalProperties' must be a schema\"\n        )","sourceCodeStart":385,"sourceCodeEnd":421,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/function_call/kimik3_structural_tag.py#L385-L421","documentation":"A property listed in required has a schema, but _known_argument_format cannot derive any value format for it (e.g. an empty schema {} or an unsupported construct). Since optional properties can simply be skipped, only required ones that accept no values are fatal for the grammar.","triggerScenarios":"\"required\": [\"x\"] with \"x\": {} or a schema that yields zero variants in _argument_value_variants (same root cause as the additionalProperties variant of this error, but on a mandatory property).","commonSituations":"Placeholder/empty schemas for mandatory fields; schemas relying only on unsupported JSON Schema keywords; strict-mode schemas that omit type.","solutions":["Give the required property a concrete supported type schema, e.g. {\"type\": \"string\"}","If the property is genuinely free-form, decide whether it must be required; either type it or move it out of required","Test each required property schema in isolation against the supported type set"],"exampleFix":"// before\n\"properties\": {\"x\": {}}, \"required\": [\"x\"]\n// after\n\"properties\": {\"x\": {\"type\": \"string\"}}, \"required\": [\"x\"]","handlingStrategy":"validation","validationCode":"for k in params.get(\"required\", []):\n    assert _argument_value_variants(params[\"properties\"][k], params), f\"{k} accepts no values\"","typeGuard":"def required_params_typeable(params: dict) -> bool:\n    return all(\n        isinstance(params[\"properties\"].get(k), (bool, dict)) and params[\"properties\"].get(k) not in ({}, False)\n        for k in params.get(\"required\", [])\n    )","tryCatchPattern":"try:\n    build_tag(tools)\nexcept ValueError as e:\n    if \"accepts no values\" in str(e):\n        add_concrete_types(tools)\n    else:\n        raise","preventionTips":["Give every required property an explicit type","Avoid empty {} schemas for mandatory fields"],"tags":["kimi-k3","json-schema","required-fields","validation"],"backgroundTag":"json-schema-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}