MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / echo_cm

Function echo_cm

tests/lib/tools/test_session_runner.py:2122–2134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2120
2121 @asynccontextmanager
2122 async def echo_cm() -> AsyncIterator[Callable[..., Awaitable[str]]]:
2123 events_seen.append("enter")
2124
2125 # `Optional[str]` (not `str | None`) because `@beta_async_tool`
2126 # evaluates these annotations at runtime via pydantic, and PEP 604 union
2127 # syntax can't be `eval`'d under Python 3.9 — our minimum version.
2128 async def echo(command: Optional[str] = None) -> str:
2129 return f"echo:{command}"
2130
2131 try:
2132 yield echo
2133 finally:
2134 events_seen.append("exit")
2135
2136 echo_tool = beta_async_tool(name="echo", input_schema=BetaManagedAgentsAgentToolset20260401BashInput)(
2137 cast(Any, echo_cm)

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected