{"record":{"id":"d078f032069781a6","repo":"ComposioHQ/composio","slug":"error-message","errorCode":null,"errorMessage":"{error.message}","messagePattern":"\\{error\\.message\\}","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/composio/utils/schema_converter.py","lineNumber":252,"sourceCode":"    if _is_unsatisfiable_schema(schema):\n        return True\n    if isinstance(schema, list):\n        return any(_contains_unsatisfiable_schema(item) for item in schema)\n    if isinstance(schema, dict):\n        return any(_contains_unsatisfiable_schema(value) for value in schema.values())\n    return False\n\n\nclass _DynamicKeyValidator(t.NamedTuple):\n    \"\"\"Exact JSON Schema validation with optional default materialization.\"\"\"\n\n    validator: Validator\n    materializer: t.Optional[TypeAdapter]\n\n    def validate(self, value: t.Any) -> None:\n        error = next(self.validator.iter_errors(value), None)\n        if error is not None:\n            raise ValueError(error.message)\n\n    def materialize(self, value: t.Any) -> t.Any:\n        if self.materializer is None:\n            return value\n        try:\n            return _materialized_value_to_python(\n                self.materializer.validate_python(_materialized_value_to_python(value))\n            )\n        except (TypeError, ValueError):\n            # JSON Schema alone decides acceptance. Pydantic is only retained\n            # for the existing default-materialization behavior, and an\n            # incomplete Pydantic representation must not reject valid input.\n            logger.debug(\"Could not materialize dynamic-key defaults; preserving input\")\n            return value\n\n\ndef _materialized_value_to_python(value: t.Any) -> t.Any:\n    \"\"\"Convert a previous materializer result back into validation input.\"\"\"","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/python/composio/utils/schema_converter.py#L234-L270","documentation":"Raised by the object-policy validator in schema_converter.py when a value fails jsonschema validation against the tool's input schema. The message is the underlying jsonschema error's message (e.g. \"'x' is a required property\", \"32 is not of type 'string'\"), re-raised as ValueError from validate().","triggerScenarios":"Calling validate(value) directly, or letting _validate_object_policy run during model validation, with arguments that violate the schema: missing required properties, wrong types, failing enum/pattern constraints, additional properties when additionalProperties is false.","commonSituations":"LLM-produced tool arguments that omit required fields or hallucinate extra keys; passing Python-native values (ints where schema expects strings); strict schemas with rejects_unmatched enabled; mismatches between the schema version the client cached and the backend's current schema.","solutions":["Match your arguments exactly to the tool's current input schema (re-fetch it and check `required` and property types)","Coerce types before validating: ensure strings stay strings, enums use exact allowed values","If extra keys are rejected, strip unrecognized keys from arguments before calling the tool","Pin/refresh the generated client so the local schema matches the backend's"],"exampleFix":"# before\nresult = tool.run({\"query\": 32})\n# after\nresult = tool.run({\"query\": \"32\"})","handlingStrategy":"try-catch","validationCode":"from jsonschema import Draft202012Validator\nv = Draft202012Validator(schema)\nerrors = list(v.iter_errors(args))\nif errors:\n    raise ValueError(errors[0].message)","typeGuard":null,"tryCatchPattern":"try:\n    policy.validate(args)\nexcept ValueError as e:\n    log.warning(\"tool args failed schema: %s\", e)\n    args = repair_args(args, schema)","preventionTips":["Validate arguments with jsonschema before invoking the tool","Keep a local copy of each tool's current schema and diff on refresh","Coerce native Python types to schema-declared types before sending"],"tags":["json-schema","validation","tool-arguments"],"backgroundTag":"schema-validation-failed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}