{"record":{"id":"ab4fcb853eb3f630","repo":"sgl-project/sglang","slug":"kimi-k3-additional-parameter-schema-accepts-no-val","errorCode":null,"errorMessage":"Kimi K3 additional parameter schema accepts no values","messagePattern":"Kimi K3 additional parameter schema accepts no values","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/function_call/kimik3_structural_tag.py","lineNumber":370,"sourceCode":"    root_schema: Dict[str, Any],\n    loose_strings: bool = False,\n) -> Format:\n    variants = [\n        SequenceFormat(\n            elements=[\n                RegexFormat(pattern=r'[^\"& \\t\\r\\n\\f\\v=<>]+'),\n                ConstStringFormat(\n                    value=(f'\" type=\"{_JSON_TO_XTML_TYPE[json_type]}\"<|sep|>')\n                ),\n                value_format,\n            ]\n        )\n        for json_type, value_format in _argument_value_variants(\n            schema, root_schema, loose_strings=loose_strings\n        )\n    ]\n    if not variants:\n        raise ValueError(\"Kimi K3 additional parameter schema accepts no values\")\n    content = variants[0] if len(variants) == 1 else OrFormat(elements=variants)\n    return TagFormat(\n        begin='<|open|>argument key=\"',\n        content=content,\n        end=ARGUMENT_CLOSE,\n    )\n\n\ndef _strict_arguments_format(parameters: Dict[str, Any]) -> Format:\n    properties = parameters.get(\"properties\", {})\n    if not isinstance(properties, dict):\n        raise ValueError(\"Kimi K3 tool parameters 'properties' must be an object\")\n    required = parameters.get(\"required\", [])\n    if not isinstance(required, list) or not all(\n        isinstance(item, str) for item in required\n    ):\n        raise ValueError(\"Kimi K3 tool parameters 'required' must be a string list\")\n","sourceCodeStart":352,"sourceCodeEnd":388,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/function_call/kimik3_structural_tag.py#L352-L388","documentation":"While building the Kimi K3 structural-tag grammar, _dynamic_argument_format found that the given JSON schema (a value schema inside properties or additionalProperties) matches none of the supported JSON type variants, so no valid value format exists. This means the tool schema contains only unsupported constructs (e.g. only unsupported keywords or a type the converter cannot map).","triggerScenarios":"Passing a tool whose additionalProperties schema or property schema accepts no values under _argument_value_variants — e.g. a schema with no recognizable type and no supported combinators, or an unsatisfiable schema like {\"not\": {}}.","commonSituations":"Hand-written or LLM-generated tool JSON schemas with exotic/unsupported keywords; schemas generated by another framework that emit empty schema objects {} for additionalProperties in strict mode.","solutions":["Inspect the failing tool's parameter schema and simplify it to standard JSON Schema types (string/number/boolean/object/array/null or type arrays)","Replace unsatisfiable constructs (pure not/allOf-only schemas) with explicit types","If additionalProperties should allow anything, use additionalProperties: true or omit it"],"exampleFix":"// before\n{\"additionalProperties\": {\"not\": {\"type\": \"string\"}}}\n// after\n{\"additionalProperties\": True}","handlingStrategy":"validation","validationCode":"def schema_has_supported_type(s):\n    if s is True or s is False:\n        return s is True\n    if not isinstance(s, dict):\n        return False\n    if \"type\" in s:\n        t = s[\"type\"]\n        allowed = {\"string\",\"number\",\"integer\",\"boolean\",\"object\",\"array\",\"null\"}\n        return (t in allowed) if isinstance(t, str) else bool(set(t) & allowed)\n    return any(schema_has_supported_type(s.get(k, {})) for k in (\"anyOf\",\"oneOf\",\"items\",\"additionalProperties\"))","typeGuard":"def is_supported_value_schema(s) -> bool:\n    return schema_has_supported_type(s)","tryCatchPattern":"try:\n    tag = build_tag(tools)\nexcept ValueError as e:\n    if \"accepts no values\" in str(e):\n        simplify_tool_schemas(tools)  # then rebuild\n    else:\n        raise","preventionTips":["Keep tool value schemas to plain typed JSON Schema","Avoid not/unsatisfiable constructs","Validate schemas client-side before the request"],"tags":["kimi-k3","json-schema","tool-calling","validation"],"backgroundTag":"json-schema-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}