AAI SDK
    Preparing search index...

    Function toolError

    • Format an error for a tool result: returns the JSON string '{"error":"<message>"}'. Return this from a tool's execute (instead of throwing) when the failure is something the LLM should see and recover from — e.g. "no results found, try a broader query".

      Parameters

      • message: string

      Returns string