Need help with AI Agent code tool

I currently change my AI work to n8n but a little bit confuse with AI Agent node. In past i used to call curl to use function calling of AI ( GPT or Claude), I tried to convert matching sample with AI Agent node and Azure Open AI model but meet some problem. Can someone help me out pls?
Received tool input did not match expected schema

Hi @Thanh_Le1 Welcome to n8n :n8n: community :tada:


It depends on what your inputs look like and how they match your schema.

Your prompt expects testElement:

and the checklist_create input schema is:

{
    "type": "object",
    "properties": {
        "cases": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "type": {
                        "type": "string",
                        "description": "Test case type (UI/UX, Functional, Accessibility, etc.)",
                        "enum": [
                            "UI/UX",
                            "Validation",
                            "Function",
                            "Logic",
                            "Performance",
                            "Compatibility",
                            "Usability"
                        ]
                    },
                    "priority": {
                        "type": "string",
                        "description": "Priority level (High, Normal, Low)",
                        "enum": [
                            "High",
                            "Normal",
                            "Low"
                        ]
                    },
                    "description": {
                        "type": "string",
                        "description": "Detailed description of what to test"
                    },
                    "expected": {
                        "type": "string",
                        "description": "Expected outcome of the test"
                    }
                },
                "required": ["type", "priority", "description", "expected"]

So If something doesn’t match, you will get the error:
Received tool input did not match expected schema

So, double-check your input carefully.

So did I misunderstanding this code tool ? I think it like function calling like this
https://platform.openai.com/docs/guides/function-calling?api-mode=responses

Here is my other node, and it work correctly