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

Function announce

tests/interaction/transports/test_flows.py:33–36  ·  view source on GitHub ↗

Emit one info-level log carrying the caller's label, then return it.

(label: str, ctx: Context)

Source from the content-addressed store, hash-verified

31
32 @mcp.tool()
33 async def announce(label: str, ctx: Context) -> str:
34 """Emit one info-level log carrying the caller's label, then return it."""
35 await ctx.info(label) # pyright: ignore[reportDeprecated]
36 return label
37
38 received_a: list[object] = []
39 received_b: list[object] = []

Callers

nothing calls this directly

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected