Agent Client Protocol - v0.5.1
    Preparing search index...

    Interface SessionNotification

    Handles session update notifications from the agent.

    This is a notification endpoint (no response expected) that receives real-time updates about session progress, including message chunks, tool calls, and execution plans.

    Note: Clients SHOULD continue accepting tool call updates even after sending a session/cancel notification, as the agent may send final updates before responding with the cancelled stop reason.

    See protocol docs: Agent Reports Output

    interface SessionNotification {
        _meta?: { [k: string]: unknown };
        sessionId: string;
        update:
            | {
                _meta?: { [k: string]: unknown };
                content:
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        text: string;
                        type: "text";
                    }
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        data: string;
                        mimeType: string;
                        type: "image";
                        uri?: string | null;
                    }
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        data: string;
                        mimeType: string;
                        type: "audio";
                    }
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        description?: string | null;
                        mimeType?: string | null;
                        name: string;
                        size?: number | null;
                        title?: string | null;
                        type: "resource_link";
                        uri: string;
                    }
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        resource: EmbeddedResourceResource;
                        type: "resource";
                    };
                sessionUpdate: "user_message_chunk";
            }
            | {
                _meta?: { [k: string]: unknown };
                content:
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        text: string;
                        type: "text";
                    }
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        data: string;
                        mimeType: string;
                        type: "image";
                        uri?: string | null;
                    }
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        data: string;
                        mimeType: string;
                        type: "audio";
                    }
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        description?: string | null;
                        mimeType?: string | null;
                        name: string;
                        size?: number | null;
                        title?: string | null;
                        type: "resource_link";
                        uri: string;
                    }
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        resource: EmbeddedResourceResource;
                        type: "resource";
                    };
                sessionUpdate: "agent_message_chunk";
            }
            | {
                _meta?: { [k: string]: unknown };
                content:
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        text: string;
                        type: "text";
                    }
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        data: string;
                        mimeType: string;
                        type: "image";
                        uri?: string | null;
                    }
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        data: string;
                        mimeType: string;
                        type: "audio";
                    }
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        description?: string | null;
                        mimeType?: string | null;
                        name: string;
                        size?: number | null;
                        title?: string | null;
                        type: "resource_link";
                        uri: string;
                    }
                    | {
                        _meta?: { [k: string]: unknown };
                        annotations?: Annotations | null;
                        resource: EmbeddedResourceResource;
                        type: "resource";
                    };
                sessionUpdate: "agent_thought_chunk";
            }
            | {
                _meta?: { [k: string]: unknown };
                content?: ToolCallContent[];
                kind?:
                    | "read"
                    | "edit"
                    | "delete"
                    | "move"
                    | "search"
                    | "execute"
                    | "think"
                    | "fetch"
                    | "switch_mode"
                    | "other";
                locations?: ToolCallLocation[];
                rawInput?: { [k: string]: unknown };
                rawOutput?: { [k: string]: unknown };
                sessionUpdate: "tool_call";
                status?: "pending" | "in_progress" | "completed" | "failed";
                title: string;
                toolCallId: string;
            }
            | {
                _meta?: { [k: string]: unknown };
                content?: ToolCallContent[] | null;
                kind?: ToolKind | null;
                locations?: ToolCallLocation[] | null;
                rawInput?: { [k: string]: unknown };
                rawOutput?: { [k: string]: unknown };
                sessionUpdate: "tool_call_update";
                status?: ToolCallStatus | null;
                title?: string | null;
                toolCallId: string;
            }
            | {
                _meta?: { [k: string]: unknown };
                entries: PlanEntry[];
                sessionUpdate: "plan";
            }
            | {
                _meta?: { [k: string]: unknown };
                availableCommands: AvailableCommand[];
                sessionUpdate: "available_commands_update";
            }
            | {
                _meta?: { [k: string]: unknown };
                currentModeId: string;
                sessionUpdate: "current_mode_update";
            };
    }
    Index

    Properties

    _meta?: { [k: string]: unknown }

    Extension point for implementations

    sessionId: string

    The ID of the session this update pertains to.

    update:
        | {
            _meta?: { [k: string]: unknown };
            content:
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    text: string;
                    type: "text";
                }
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    data: string;
                    mimeType: string;
                    type: "image";
                    uri?: string | null;
                }
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    data: string;
                    mimeType: string;
                    type: "audio";
                }
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    description?: string | null;
                    mimeType?: string | null;
                    name: string;
                    size?: number | null;
                    title?: string | null;
                    type: "resource_link";
                    uri: string;
                }
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    resource: EmbeddedResourceResource;
                    type: "resource";
                };
            sessionUpdate: "user_message_chunk";
        }
        | {
            _meta?: { [k: string]: unknown };
            content:
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    text: string;
                    type: "text";
                }
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    data: string;
                    mimeType: string;
                    type: "image";
                    uri?: string | null;
                }
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    data: string;
                    mimeType: string;
                    type: "audio";
                }
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    description?: string | null;
                    mimeType?: string | null;
                    name: string;
                    size?: number | null;
                    title?: string | null;
                    type: "resource_link";
                    uri: string;
                }
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    resource: EmbeddedResourceResource;
                    type: "resource";
                };
            sessionUpdate: "agent_message_chunk";
        }
        | {
            _meta?: { [k: string]: unknown };
            content:
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    text: string;
                    type: "text";
                }
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    data: string;
                    mimeType: string;
                    type: "image";
                    uri?: string | null;
                }
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    data: string;
                    mimeType: string;
                    type: "audio";
                }
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    description?: string | null;
                    mimeType?: string | null;
                    name: string;
                    size?: number | null;
                    title?: string | null;
                    type: "resource_link";
                    uri: string;
                }
                | {
                    _meta?: { [k: string]: unknown };
                    annotations?: Annotations | null;
                    resource: EmbeddedResourceResource;
                    type: "resource";
                };
            sessionUpdate: "agent_thought_chunk";
        }
        | {
            _meta?: { [k: string]: unknown };
            content?: ToolCallContent[];
            kind?:
                | "read"
                | "edit"
                | "delete"
                | "move"
                | "search"
                | "execute"
                | "think"
                | "fetch"
                | "switch_mode"
                | "other";
            locations?: ToolCallLocation[];
            rawInput?: { [k: string]: unknown };
            rawOutput?: { [k: string]: unknown };
            sessionUpdate: "tool_call";
            status?: "pending" | "in_progress" | "completed" | "failed";
            title: string;
            toolCallId: string;
        }
        | {
            _meta?: { [k: string]: unknown };
            content?: ToolCallContent[] | null;
            kind?: ToolKind | null;
            locations?: ToolCallLocation[] | null;
            rawInput?: { [k: string]: unknown };
            rawOutput?: { [k: string]: unknown };
            sessionUpdate: "tool_call_update";
            status?: ToolCallStatus | null;
            title?: string | null;
            toolCallId: string;
        }
        | {
            _meta?: { [k: string]: unknown };
            entries: PlanEntry[];
            sessionUpdate: "plan";
        }
        | {
            _meta?: { [k: string]: unknown };
            availableCommands: AvailableCommand[];
            sessionUpdate: "available_commands_update";
        }
        | {
            _meta?: { [k: string]: unknown };
            currentModeId: string;
            sessionUpdate: "current_mode_update";
        }

    The actual update content.

    Type Declaration

    • {
          _meta?: { [k: string]: unknown };
          content:
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  text: string;
                  type: "text";
              }
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  data: string;
                  mimeType: string;
                  type: "image";
                  uri?: string | null;
              }
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  data: string;
                  mimeType: string;
                  type: "audio";
              }
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  description?: string | null;
                  mimeType?: string | null;
                  name: string;
                  size?: number | null;
                  title?: string | null;
                  type: "resource_link";
                  uri: string;
              }
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  resource: EmbeddedResourceResource;
                  type: "resource";
              };
          sessionUpdate: "user_message_chunk";
      }
      • Optional_meta?: { [k: string]: unknown }

        Extension point for implementations

      • content:
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                text: string;
                type: "text";
            }
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                data: string;
                mimeType: string;
                type: "image";
                uri?: string | null;
            }
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                data: string;
                mimeType: string;
                type: "audio";
            }
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                description?: string | null;
                mimeType?: string | null;
                name: string;
                size?: number | null;
                title?: string | null;
                type: "resource_link";
                uri: string;
            }
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                resource: EmbeddedResourceResource;
                type: "resource";
            }

        A single item of content

      • sessionUpdate: "user_message_chunk"
    • {
          _meta?: { [k: string]: unknown };
          content:
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  text: string;
                  type: "text";
              }
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  data: string;
                  mimeType: string;
                  type: "image";
                  uri?: string | null;
              }
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  data: string;
                  mimeType: string;
                  type: "audio";
              }
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  description?: string | null;
                  mimeType?: string | null;
                  name: string;
                  size?: number | null;
                  title?: string | null;
                  type: "resource_link";
                  uri: string;
              }
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  resource: EmbeddedResourceResource;
                  type: "resource";
              };
          sessionUpdate: "agent_message_chunk";
      }
      • Optional_meta?: { [k: string]: unknown }

        Extension point for implementations

      • content:
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                text: string;
                type: "text";
            }
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                data: string;
                mimeType: string;
                type: "image";
                uri?: string | null;
            }
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                data: string;
                mimeType: string;
                type: "audio";
            }
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                description?: string | null;
                mimeType?: string | null;
                name: string;
                size?: number | null;
                title?: string | null;
                type: "resource_link";
                uri: string;
            }
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                resource: EmbeddedResourceResource;
                type: "resource";
            }

        A single item of content

      • sessionUpdate: "agent_message_chunk"
    • {
          _meta?: { [k: string]: unknown };
          content:
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  text: string;
                  type: "text";
              }
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  data: string;
                  mimeType: string;
                  type: "image";
                  uri?: string | null;
              }
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  data: string;
                  mimeType: string;
                  type: "audio";
              }
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  description?: string | null;
                  mimeType?: string | null;
                  name: string;
                  size?: number | null;
                  title?: string | null;
                  type: "resource_link";
                  uri: string;
              }
              | {
                  _meta?: { [k: string]: unknown };
                  annotations?: Annotations | null;
                  resource: EmbeddedResourceResource;
                  type: "resource";
              };
          sessionUpdate: "agent_thought_chunk";
      }
      • Optional_meta?: { [k: string]: unknown }

        Extension point for implementations

      • content:
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                text: string;
                type: "text";
            }
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                data: string;
                mimeType: string;
                type: "image";
                uri?: string | null;
            }
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                data: string;
                mimeType: string;
                type: "audio";
            }
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                description?: string | null;
                mimeType?: string | null;
                name: string;
                size?: number | null;
                title?: string | null;
                type: "resource_link";
                uri: string;
            }
            | {
                _meta?: { [k: string]: unknown };
                annotations?: Annotations | null;
                resource: EmbeddedResourceResource;
                type: "resource";
            }

        A single item of content

      • sessionUpdate: "agent_thought_chunk"
    • {
          _meta?: { [k: string]: unknown };
          content?: ToolCallContent[];
          kind?:
              | "read"
              | "edit"
              | "delete"
              | "move"
              | "search"
              | "execute"
              | "think"
              | "fetch"
              | "switch_mode"
              | "other";
          locations?: ToolCallLocation[];
          rawInput?: { [k: string]: unknown };
          rawOutput?: { [k: string]: unknown };
          sessionUpdate: "tool_call";
          status?: "pending" | "in_progress" | "completed" | "failed";
          title: string;
          toolCallId: string;
      }
      • Optional_meta?: { [k: string]: unknown }

        Extension point for implementations

      • Optionalcontent?: ToolCallContent[]

        Content produced by the tool call.

      • Optionalkind?:
            | "read"
            | "edit"
            | "delete"
            | "move"
            | "search"
            | "execute"
            | "think"
            | "fetch"
            | "switch_mode"
            | "other"

        The category of tool being invoked. Helps clients choose appropriate icons and UI treatment.

      • Optionallocations?: ToolCallLocation[]

        File locations affected by this tool call. Enables "follow-along" features in clients.

      • OptionalrawInput?: { [k: string]: unknown }

        Raw input parameters sent to the tool.

      • OptionalrawOutput?: { [k: string]: unknown }

        Raw output returned by the tool.

      • sessionUpdate: "tool_call"
      • Optionalstatus?: "pending" | "in_progress" | "completed" | "failed"

        Current execution status of the tool call.

      • title: string

        Human-readable title describing what the tool is doing.

      • toolCallId: string

        Unique identifier for this tool call within the session.

    • {
          _meta?: { [k: string]: unknown };
          content?: ToolCallContent[] | null;
          kind?: ToolKind | null;
          locations?: ToolCallLocation[] | null;
          rawInput?: { [k: string]: unknown };
          rawOutput?: { [k: string]: unknown };
          sessionUpdate: "tool_call_update";
          status?: ToolCallStatus | null;
          title?: string | null;
          toolCallId: string;
      }
      • Optional_meta?: { [k: string]: unknown }

        Extension point for implementations

      • Optionalcontent?: ToolCallContent[] | null

        Replace the content collection.

      • Optionalkind?: ToolKind | null

        Update the tool kind.

      • Optionallocations?: ToolCallLocation[] | null

        Replace the locations collection.

      • OptionalrawInput?: { [k: string]: unknown }

        Update the raw input.

      • OptionalrawOutput?: { [k: string]: unknown }

        Update the raw output.

      • sessionUpdate: "tool_call_update"
      • Optionalstatus?: ToolCallStatus | null

        Update the execution status.

      • Optionaltitle?: string | null

        Update the human-readable title.

      • toolCallId: string

        The ID of the tool call being updated.

    • {
          _meta?: { [k: string]: unknown };
          entries: PlanEntry[];
          sessionUpdate: "plan";
      }
      • Optional_meta?: { [k: string]: unknown }

        Extension point for implementations

      • entries: PlanEntry[]

        The list of tasks to be accomplished.

        When updating a plan, the agent must send a complete list of all entries with their current status. The client replaces the entire plan with each update.

      • sessionUpdate: "plan"
    • {
          _meta?: { [k: string]: unknown };
          availableCommands: AvailableCommand[];
          sessionUpdate: "available_commands_update";
      }
      • Optional_meta?: { [k: string]: unknown }

        Extension point for implementations

      • availableCommands: AvailableCommand[]

        Commands the agent can execute

      • sessionUpdate: "available_commands_update"
    • {
          _meta?: { [k: string]: unknown };
          currentModeId: string;
          sessionUpdate: "current_mode_update";
      }
      • Optional_meta?: { [k: string]: unknown }

        Extension point for implementations

      • currentModeId: string

        The ID of the current mode

      • sessionUpdate: "current_mode_update"