You might get better results if you tweak your prompt to be a bit clearer.
Something like:
Generate a concise summary of the following question: [question]
Format the output as follows:
{ "ai-summary": "<output_here>" }
Are you consistently getting the output from the AI agent in the format you requested?
It would be easier to advise you if we could see exactly what you’re working with. Think you could share your workflow and the output you’re currently getting? As well as what results you’re seeing.
You can share a wf by following these steps
Select your nodes in the UI and press Ctrl+c or cmd+c, like shown here: Export and import workflows | n8n Docs.
Then select the </> option in the forum textbox and paste the wf in the middle of the backticks by pressing Ctrl+v or cmd+v
Thanks for the reply. I really just wanted to know the proper way to apply a key to the output of an AI Agent. It seems this is the answer.
Format the output as follows:
{ "ai-summary": "<output_here>" }
I wanted to confirm that in case the output of the AI Agent was assigned some key automagically. It might be worth mentioning this in the docs (unless I missed it). I would imagine anyone using AI Agent tools would need to know this.
Some feedback: rather than use the AI Agent, I ended up creating a manual loop and sending the output to a stand-alone node rather than to a tool within the AI Agent. I’m sure it’s me not you but I had a hard time debugging what the tool was doing inside the AI Agent.