Skip to main content

Adding Tools to Agents

An agent without functions can only reason and write. With functions, it can search the web, call APIs, run code and act in other systems.

Assign functions​

  1. Go to Build → Agents and select the agent.
  2. On the Configure tab, under Assigned Functions, click Assign Functions.
  3. In Assign Functions to Agent, search under Select Functions, pick one or more, and click Assign.

Assigned functions appear as chips. The change takes effect straight away, and the agent's next chat or run includes them. You don't need to click Update.

  • Click a chip to open the function.
  • Click a chip's delete icon to unassign it.

You can also assign functions while creating an agent. They're added when you click Create Agent.

note

You don't need to assign the memory tools or the large-result readers. FYAI adds them automatically. See Built-in Tools.

Choose the right functions​

Agent roleUseful functions
Web researcherWeb search, fetch web page
Code reviewerRepository read access, code execution
Data analystDatabase query, a data source
WriterOften none: writing is the job
Service deskKnowledge base search, ticket creation, email
Orchestratorinvoke_sub_agent, plus grants on the Sub-agents tab
tip

Fewer is better. An agent with a handful of relevant functions is faster, cheaper and more reliable than one with dozens. Give each agent only what its role needs.

How the agent decides to call a function​

The model reads each function's name, description and parameter descriptions to decide when to call it and what to pass. So:

  1. Use clear names: search_web rather than fn_001.
  2. Describe when to use it, not just what it does.
  3. Describe each parameter's format: dates, IDs, units.
  4. Add guidance to the agent's system message about when to prefer a tool over its own knowledge.

If an agent doesn't call a function when it should, the description is usually the problem. See Creating Custom Functions.

Things that affect tool calls​

  • Approval. Some tool calls pause for a person to approve them. Whether a call needs approval depends on approval pins (team, agent, function) and your risk appetite. See Agents.
  • Execution environment. Tools run in the agent's Execution Environment, or the project default if none is set. See Execution Environments.
  • Which credentials are used. A tool uses the integration named in its code. To make one agent use a different account, add a Tool Identity override on the agent's Identity tab.
  • Large results. Results bigger than the inline limit are saved, and the agent reads them in pieces. See Built-in Tools.
  • Disabled functions. A function switched off with its own killswitch is left out of the agent's tools.

Check it works​

  1. Click Open in Chat on the agent.
  2. Ask for something that needs the function.
  3. Check the tool call in the chat. Did the agent call the right function, with sensible arguments, and use the result?
  4. Look at the agent's Topology tab to see everything the agent's tools can reach.
  5. To make the check repeatable, add a test case on the Tests tab and list the function under Expected tool calls (optional). See Testing Agents and Teams.