Granting Tool Access
Agents and prompts start with NO TOOL ACCESS to perform any of the tasks within their instructions.
Giving tool access is done by the convention of explicitly writing tool names between backticks in agent or prompt instructions. For example:
Use the tool `internet_search` when the user asks for...It's sufficient to mention a tool in either the agent's instructions or a prompt for tool access to be granted by the system. Tool access is the combination of explicitly written tool names in backticks found in the agent's instructions and the instructions in the prompts, in other words.
The example agent and prompt below give access to the tools called
fetch_content and file_read because they explicitly mention those tool
names and have them between backticks.
You are an agent that will help with job search automations.
You will sometimes need to use the tool `fetch_content` to fetch content from
the Internet.
You will also need to sometimes use the tool `file_read` to read the content
you fetch and validate that it contains the expected information.Use the tool `file_read` to read the file `/job_analysis_guidelines.pdf`
ant then...Not Granting Access
Without the explicitly written tool names in backticks your automation could fail because the system would not give the proper tool access to perform the work.
Below is an example of bad agent and prompt instructions, because neither the agent instructions or the prompt instructions specify explicitly the names of the tools the automation needs:
You are an agent that will help with job search automations.Read the file `/job_analysis_guidelines.pdf` and then...Where to Grant Access: Prompt or Agent?
Is it better to mention tools in the agent instructions or the prompt instructions?If you find yourself repeating the exact same instructions in multiple prompts, of which tool to use and how to use it, it might be better to move that into the agent's instructions so that it is written just once.
However, there is a downside to moving the instructions to the agent. Often, different prompts will use the same tool but in different ways. Keeping the instructions of which tool to use and how to use it in the prompts can make it easier to understand the overall automation and reduce the chances that there are contradictory instructions in the automation.