How can i restrict my ai agent to use only tool to give answer and give generic response if question is not available in tools document

Describe the problem/error/question

this is my workflow, and I want to restrict my agent to give answers if that was available in the tool else give generic answers

What is the error message (if any)?

I am getting a response from LLM that my file contains information about a specific company but when I ask the agent for another company, the agent is supposed to tell me that he cannot have information about that company and only give that information which is available on the document

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.76.1
  • Database (default: SQLite): no
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: mac

Can you please share the workflow by COPY and PASTE the workflow from the n8n to this forum? (Since you are only share it using screenshot).

As I can get from your workflow, you have not specified system prompt for the AI agent, Something like: “just give information about the companies on the document ONLY”. (as the place to do that shown below)

→ You can instruct the AI agent to do what, and how to do it by specific prompt in the system message. That way, the AI can autonomously know which and how to use the tools (in this case is Google Docs tool)