Skip to main content
Use checkToolCall(...) after the provider returns a tool call and before your application executes that call.
const decision = await client.checkToolCall({
  callId: "call_123",
  runId: "run_123",
  provider: {
    name: "custom-provider",
    operation: "messages.create",
    model: "model-name",
  },
  tool: {
    kind: "function",
    name: "send_email",
  },
  arguments: {
    value: {
      to: "customer@example.com",
      subject: "Password reset",
    },
  },
  modelResponseToolCalls: [
    {
      callId: "call_123",
      tool: {
        kind: "function",
        name: "send_email",
      },
    },
  ],
  context: {
    messages: [
      {
        role: "user",
        text: "Email the customer about password reset.",
      },
    ],
  },
});
Valid tool-call decisions are allow and block. If Averta blocks the tool call, do not execute the tool.