Hi, I am trying to connect Github Tool to AI Agent. The Github Tool by itself works if I manually enter path for example “/doc”. However when I set up the path to take the input from AI agent like {{ $fromAI(‘path’, ‘The file path in the GitHub repository, e.g. /docs’, ‘string’) }} the execution ends in error “Problem in node 'PartialExecutionToolExecutor Error executing tool: Receiced tool input did not match expected schema Required → at Path”. However if I check the tool input the AI agent sends the correct format, the tool path is green and showing the correct path. If I try manually executing just the tool and leave the path as {{ $fromAI(‘path’, ‘The file path in the GitHub repository, e.g. /docs’, ‘string’) }} I am prompted to enter the path. I enter /docs and get the same error. If I remove {{ $fromAI(‘path’, ‘The file path in the GitHub repository, e.g. /docs’, ‘string’) }} and enter directly /docs it executes correctly. I was advised by the n8n AI agent to use subworkflows and call them as tools but I faced the same issue. Any idea how to fix this? I am sharing just the nodes I am now testing in isolation with agent system prompt removed
What is the error message (if any)?
Problem in node 'PartialExecutionToolExecutor Error executing tool: Receiced tool input did not match expected schema Required → at Path
Hi @mkaras, welcome!
This can be because, as I can see, both the tools use the same $fromAI path, so consider renaming each key to a different name, like list_path list tool and get_path in the file tool, like:
// List Repo Contents
{{ $fromAI('list_path', 'The folder path to list in the GitHub repository, e.g. /docs', 'string') }}
// Get File
{{ $fromAI('get_path', 'The file path to fetch from the GitHub repository, e.g. /docs/readme.md', 'string') }}
As the $fromAI key must be unique in all the tools connected, it can create conflicts as it might get passed down to all of them.
Hi @Anshul_Namdev unfortunately that is not the cause. I tested that option too, tried with connecting one tool only as well. The AI agent send the right path in the right format to the tool, the tool interprets it correctly but it returns the error every time. If I check the execution I can see that the input for the tool is correct.
@mkaras, a few things to check does this work with other tools? Try changing the AI model to the most frontier models available and to use $fromAI correctly. Read this:
Also let me know if the issue persists, as I also use the github node and similar flows work perfectly fine.
Hi @Anshul_Namdev I tried changing the model but there is no change. The input to the GitHub tool is still correct. Spefifically:
[
{
“path”: “/docs/tableau”
}
]
If I try testing the tool node itself with the $fromAI expression I am prompted to enter the path. I enter /docs/tableau and get the error.
If I remove the $fromAI expression and switch to Fixed and use /docs/tableau for path it works absolutely fine.
So, the AI outputs the right path, the Github tool works but once I use the $fromAI expression I get the error.
I don’t think it’s the same case. The Ai agent does not duplicate anything. If I use the exactly same output as a test for a Github list node in manual trigger and set the path to {{ $json.path }} it works fine.
The $fromAI reads the output from AI correctly, I attach the screenshot but it just does not execute the tool.
I tried using HTTP node to stitch together the URL using https://api.github.com/repos/eg-internal/tpsp-wfp/contents{{ $fromAI(‘path’, ``, ‘string’) }}
The issue is the same. The resulting URL is correct but the tool does not execute
ahh I finally figured out the issue. I was trying to run the tests locally from the workflow without publishing it. Once I published it and triggered it using the Slack trigger (which is my intended use case) the AI agent calls the tools correctly. I still have a lot of work to make everything work well but at least I know how to test this properly. Apologies for taking your time I’m still quite new to this. Appreciate your support!