client.cli
The CLI’s listen tunnel: events and tool calls forwarded to your machine. These methods are on client.cli, where client is a MoreVoice client (see the Python SDK). On AsyncMoreVoice the same methods are awaited. Each one returns the response object and raises an exception when the API answers with an error.
submit_tool_result()
Section titled “submit_tool_result()”Answer a relayed tool call. Sends your local tool server’s answer (status and body, as it responded) for a tool_call frame of your listen session. Only the key that opened the session can answer, within the call’s timeout_ms.
def submit_tool_result(self, session_id: str, body: _m.CliToolResultParamsInput | Mapping[str, Any], *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.CliToolResultclient.cli.submit_tool_result() · await async_client.cli.submit_tool_result() · POST /cli/listen/{session_id}/tool_results · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
session_id |
str |
yes | The session’s ID (clis_…, from the cli.session frame). |
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
yes | The tool_call frame’s id. |
body |
string |
no | Your local server’s response body, as is (the tool’s answer). |
error |
string |
no | Your local server could not be reached: the tool call fails with this message. |
headers |
Record<string, string> |
no | Your local server’s response headers (informational). |
status |
integer |
no | Your local server’s HTTP status (default 200). |
Returns
Section titled “Returns”CliToolResult:
| Field | Type | Description |
|---|---|---|
object |
"cli_tool_result" |
Always cli_tool_result. |
id |
string |
clitc_… ID. |
session_id |
string |
— |
accepted |
true |
— |
Example
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
cli_tool_result = client.cli.submit_tool_result("clis_5bH8jK3mN6pQ9rT2vW4xYz", { "body": "{\"status\":\"shipped\"}", "id": "clitc_7cJ9kL4mP2qR5sT8uV1wXy", "status": 200,})print(cli_tool_result)