Skip to navigation
AgentsAgentBase

set_unavailable_function_response

View as MarkdownOpen in Claude

Set what the model is told when it calls a tool it can’t use right now, such as one the current step’s function list doesn’t offer, or one the agent doesn’t have. Without it, the platform says nothing ran, which steps offer the tool, and which tools are available now.

The text can use these variables:

  • ${function} — the tool’s name.
  • ${tools} — the tools the request offered, comma-separated.
  • ${steps} — the current context’s steps whose functions include the tool; empty for a name the agent doesn’t have.

Sets the unavailable_function_response AI parameter.

Parameters

text
strRequired

The text the model gets.

Returns

AgentBase — Self for method chaining.

Raises

ValueError if text is empty or isn’t a string.

Example

from signalwire import AgentBase
agent = AgentBase(name="guide", route="/guide")
agent.prompt_add_section("Role", "You help callers find their way.")
agent.set_unavailable_function_response(
"${function} isn't available here. Tools you have: ${tools}."
)
agent.serve()