MCP PHP SDK

CancelledNotification extends Notification

This notification can be sent by either side to indicate that it is cancelling a previously-issued request.

The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.

This notification indicates that the result will be unused, so any associated processing SHOULD cease.

A client MUST NOT attempt to cancel its initialize request.

Tags
author

Kyrian Obikwelu koshnawaza@gmail.com

Table of Contents

Properties

$reason  : string|null
$requestId  : string|int
$meta  : array<string, mixed>|null

Methods

__construct()  : mixed
fromArray()  : self
getMethod()  : string
jsonSerialize()  : NotificationData
fromParams()  : Notification
getParams()  : array<string, mixed>|null

Properties

Methods

__construct()

public __construct(string|int $requestId[, string|null $reason = null ]) : mixed
Parameters
$requestId : string|int

The ID of the request that is being cancelled. This MUST correspond to the ID of a request previously issued in the same direction.

$reason : string|null = null

An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.

fromArray()

public static fromArray(NotificationData $data) : self
Parameters
$data : NotificationData
Return values
self

jsonSerialize()

public jsonSerialize() : NotificationData
Return values
NotificationData

getParams()

protected getParams() : array<string, mixed>|null
Return values
array<string, mixed>|null

        
On this page

Search results