AIML Docs

SendToolCalls Element

Element for sending tool calls

SendToolCalls Element

Coming soon: This feature is not yet available. Please check back soon.

The <sendToolCalls> element injects tool calls into the response stream:

<sendToolCalls value={({state}) => ({
    name: "calculate",
    args: { value: state.count }
  })} />

Props

PropTypeDefault
value?
object
(the output of the previous element)

Examples

Basic Tool Call

<sendToolCalls value={() => ({
    name: "fetchData",
    args: {
      endpoint: "/api/data",
      method: "GET"
    }
  })} />

Dynamic Tool Call

<sendToolCalls value={({state}) => ({
    name: "processData",
    args: {
      data: state.inputData,
      options: state.processingOptions,
      format: state.outputFormat
    }
  })} />

Multiple Tool Calls

<sendToolCalls value={({state}) => [
    {
      name: "validateInput",
      args: { data: state.input }
    },
    {
      name: "transform",
      args: { 
        data: state.input,
        format: state.format 
      }
    },
    {
      name: "saveOutput",
      args: { result: state.transformed }
    }
  ]} />

Usage Notes

  • Sends tool call requests
  • Can include arguments
  • Supports dynamic values
  • Can send multiple calls

On this page