setFunctions
Set which non-internal functions are callable while this step is active. Restricting functions per step prevents the AI from calling irrelevant tools and keeps the per-step active set small — LLM tool selection accuracy degrades noticeably past ~7–8 simultaneously-active tools per call.
Step toolsets inherit from the previous step. If you do not call
setFunctions() on a step, it inherits whichever function set was active on
the previous step (or the previous context’s last step). The server-side
runtime only resets the active set when a step explicitly declares its
functions field. This is the most common source of bugs in multi-step
agents — forgetting setFunctions() on a later step lets the previous
step’s tools leak through. Best practice: call setFunctions() explicitly
on every step that should have a different toolset than the previous one.
Internal functions (startup_hook, hangup_hook, gather_submit, etc.)
are always protected and cannot be deactivated by this whitelist. The
native navigation tools next_step and change_context are injected
automatically when setValidSteps() / setValidContexts() is set; they
are not affected by this list and do not need to appear in it.
Parameters
functions
One of:
string[]— whitelist of function names allowed in this step. Functions not in the list become inactive.[]— explicit disable-all (no user functions callable)."none"— synonym for[], same effect.
Returns
Step — Self for method chaining.