Skip to navigation

steps_offering

View as MarkdownOpen in Claude

List the steps whose function list offers a tool, including the function lists of their gather questions.

A step without set_functions() isn’t counted: it keeps whatever was active before it, so what it offers depends on the step the call came from. When the model calls a tool the current step doesn’t offer, the platform’s reply names the same steps.

Parameters

function
strRequired

The tool’s name.

Returns

list[tuple[str, str]] — (context, step) pairs in order. Empty when no step lists the tool, which also triggers the tool_offered_by_no_step warning when every step lists its functions.

Example

from signalwire import AgentBase, FunctionResult
agent = AgentBase(name="orders", route="/orders")
agent.prompt_add_section("Role", "You take orders.")
agent.define_tool("place_order", "Place the order", {"type": "object", "properties": {}},
lambda args, raw_data: FunctionResult("Order placed."))
builder = agent.define_contexts()
ctx = builder.add_context("default")
ctx.add_step("confirm").set_text("Confirm the order.").set_functions(["place_order"])
print(builder.steps_offering("place_order")) # [('default', 'confirm')]