Skip to content

Commit 1039b99

Browse files
committed
fixed doc string and added comment on internal notification method
1 parent 2e86d32 commit 1039b99

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/mcp/shared/session.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,17 +323,20 @@ async def send_notification(
323323
notification: SendNotificationT,
324324
related_request_id: RequestId | None = None,
325325
) -> None:
326+
"""
327+
Emits a notification, which is a one-way message that does not expect
328+
a response.
329+
"""
326330
await self._send_notification_internal(notification, related_request_id)
327331

332+
# this method is required as SendNotificationT type checking prevents
333+
# internal use for sending cancelation - typechecking sorcery may be
334+
# required
328335
async def _send_notification_internal(
329336
self,
330337
notification: SendNotificationInternalT,
331338
related_request_id: RequestId | None = None,
332339
) -> None:
333-
"""
334-
Emits a notification, which is a one-way message that does not expect
335-
a response.
336-
"""
337340
# Some transport implementations may need to set the related_request_id
338341
# to attribute to the notifications to the request that triggered them.
339342
jsonrpc_notification = JSONRPCNotification(

0 commit comments

Comments
 (0)