Skip to main content

Type Alias: AgentEvent

Type Alias: AgentEvent

type AgentEvent = 
  | {
  content: string;
  type: "message_delta";
}
  | {
  content: string;
  type: "message";
}
  | {
  args: unknown;
  callId: string;
  name: string;
  type: "tool_call";
}
  | {
  callId: string;
  error?: string;
  result: unknown;
  type: "tool_result";
}
  | {
  content: string;
  type: "thinking";
}
  | {
  error?: string;
  status: "running" | "waiting" | "complete" | "error";
  type: "status";
}
  | {
  data: Record<string, unknown>;
  type: "metadata";
}
  | {
  annotations?: ToolAnnotations;
  approvalId: string;
  args: unknown;
  streamId: string;
  toolName: string;
  type: "approval_pending";
};

Type Declaration

{
  content: string;
  type: "message_delta";
}

content

content: string;

type

type: "message_delta";
{
  content: string;
  type: "message";
}

content

content: string;

type

type: "message";
{
  args: unknown;
  callId: string;
  name: string;
  type: "tool_call";
}

args

args: unknown;

callId

callId: string;

name

name: string;

type

type: "tool_call";
{
  callId: string;
  error?: string;
  result: unknown;
  type: "tool_result";
}

callId

callId: string;

error?

optional error: string;

result

result: unknown;

type

type: "tool_result";
{
  content: string;
  type: "thinking";
}

content

content: string;

type

type: "thinking";
{
  error?: string;
  status: "running" | "waiting" | "complete" | "error";
  type: "status";
}

error?

optional error: string;

status

status: "running" | "waiting" | "complete" | "error";

type

type: "status";
{
  data: Record<string, unknown>;
  type: "metadata";
}

data

data: Record<string, unknown>;

type

type: "metadata";
{
  annotations?: ToolAnnotations;
  approvalId: string;
  args: unknown;
  streamId: string;
  toolName: string;
  type: "approval_pending";
}

annotations?

optional annotations: ToolAnnotations;

approvalId

approvalId: string;

args

args: unknown;

streamId

streamId: string;

toolName

toolName: string;

type

type: "approval_pending";

Emitted by the agents plugin (not adapters) when a mutating tool call is awaiting human approval — fires for tools annotated with effect: "write" | "update" | "destructive" (preferred) or the legacy destructive: true boolean. Clients should render an approval prompt and POST to /chat/approve with the matching approvalId and a decision of approve or deny.

Databricks Developer Hub

Ready to ship your next agentic app in minutes?

Read docs