hangup_call
End an active phone call by providing its unique call ID. Use this tool to terminate a call that is in progress; if the call is already ended, the action has no effect.
Instructions
End an in-progress call immediately. No-op / error if the call already terminated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| call_id | Yes |
Implementation Reference
- agentline_mcp/server.py:251-259 (handler)Handler function for the 'hangup_call' tool. Accepts a call_id string, delegates to the Agentline client's hangup() method, and returns the result or an error dict.
@mcp.tool() def hangup_call(call_id: str) -> dict: """End an in-progress call immediately. No-op / error if the call already terminated. """ try: return _client_or_init().hangup(call_id) except AgentlineError as e: return {"error": str(e), "status_code": e.status_code} - agentline_mcp/server.py:251-252 (registration)Registration of 'hangup_call' as an MCP tool via the @mcp.tool() decorator from FastMCP.
@mcp.tool() def hangup_call(call_id: str) -> dict: - agentline_mcp/server.py:51-55 (helper)Helper function that lazily initializes and returns the shared Agentline client instance used by hangup_call.
def _client_or_init() -> Agentline: global _client if _client is None: _client = _build_client() return _client