1111over HTTP using MCP actions.
1212"""
1313
14- from typing import Any , Dict , List
14+ from typing import Dict
1515
1616try :
1717 from core .client_types import StepResult
1818 from core .env_server .types import (
1919 CallToolAction ,
2020 CallToolObservation ,
21- ListToolsAction ,
2221 ListToolsObservation ,
2322 Observation ,
2423 State ,
2928 from openenv_core .env_server .types import (
3029 CallToolAction ,
3130 CallToolObservation ,
32- ListToolsAction ,
3331 ListToolsObservation ,
3432 Observation ,
3533 State ,
@@ -45,23 +43,23 @@ class EchoEnv(HTTPEnvClient[CallToolAction, Observation]):
4543 methods to interact with it using MCP actions.
4644
4745 Example:
46+ >>> from core.env_server.types import CallToolAction
4847 >>> # Connect to a running server
4948 >>> client = EchoEnv(base_url="http://localhost:8000")
5049 >>> result = client.reset()
5150 >>>
52- >>> # List available tools
53- >>> tools = client.list_tools()
54- >>> print(tools) # [{"name": "echo_message", ...}]
55- >>>
56- >>> # Call echo_message tool
57- >>> result = client.echo_message("Hello!")
58- >>> print(result["echoed_message"]) # "Hello!"
51+ >>> # Call echo_message tool using step API
52+ >>> action = CallToolAction(tool_name="echo_message", parameters={"message": "Hello!"})
53+ >>> result = client.step(action)
54+ >>> print(result.observation.result) # {"echoed_message": "Hello!"}
5955
6056 Example with Docker:
57+ >>> from core.env_server.types import CallToolAction
6158 >>> # Automatically start container and connect
6259 >>> client = EchoEnv.from_docker_image("echo-env:latest")
6360 >>> result = client.reset()
64- >>> result = client.echo_message("Test")
61+ >>> action = CallToolAction(tool_name="echo_message", parameters={"message": "Test"})
62+ >>> result = client.step(action)
6563 """
6664
6765 def _step_payload (self , action : CallToolAction ) -> Dict :
0 commit comments