MCPcopy
hub / github.com/modelcontextprotocol/python-sdk / warning

Method warning

src/mcp/server/mcpserver/context.py:301–303  ·  view source on GitHub ↗

Send a warning log message.

(self, data: Any, *, logger_name: str | None = None)

Source from the content-addressed store, hash-verified

299
300 @deprecated("The logging capability is deprecated as of 2026-07-28 (SEP-2577).", category=MCPDeprecationWarning)
301 async def warning(self, data: Any, *, logger_name: str | None = None) -> None:
302 """Send a warning log message."""
303 await self.log("warning", data, logger_name=logger_name) # pyright: ignore[reportDeprecated]
304
305 @deprecated("The logging capability is deprecated as of 2026-07-28 (SEP-2577).", category=MCPDeprecationWarning)
306 async def error(self, data: Any, *, logger_name: str | None = None) -> None:

Callers 15

_aggregate_componentsMethod · 0.80
_validate_tool_resultMethod · 0.80
list_toolsMethod · 0.80
_on_notifyMethod · 0.80
_stop_server_processFunction · 0.80
sse_readerFunction · 0.80
_handle_sse_eventMethod · 0.80
terminate_sessionMethod · 0.80
_create_job_objectFunction · 0.80

Calls 1

logMethod · 0.95

Tested by 2

logging_toolMethod · 0.64
narrateFunction · 0.64