cc_list_agents
List all call center agents and their current state to monitor agent availability and call center performance.
Instructions
List all call center agents and their current state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The actual handler function for the cc_list_agents tool. It is decorated with @mcp.tool() and @require_permission('mi.read'), and executes the 'cc_list_agents' MI command via the MI client.
@mcp.tool() @require_permission("mi.read") async def cc_list_agents(ctx: Context) -> dict[str, Any]: """List all call center agents and their current state.""" app = ctx.request_context.lifespan_context result = await app.mi_client.execute("cc_list_agents") return result - cc_list_agents is also used indirectly inside cc_status() which aggregates call center status (queue, agents, flows) into a single response.
@mcp.tool() @require_permission("mi.read") async def cc_status(ctx: Context) -> dict[str, Any]: """Get a combined call center status: queue, agents, and flows. Returns all three datasets in a single response for a complete overview of the call center state. """ app = ctx.request_context.lifespan_context queue = await app.mi_client.execute("cc_list_queue") agents = await app.mi_client.execute("cc_list_agents") flows = await app.mi_client.execute("cc_list_flows") return { "queue": queue, "agents": agents, "flows": flows, } - src/opensips_mcp/mi/commands.py:156-156 (registration)Registration of cc_list_agents in the MI_COMMANDS registry. Defines its module ('call_center'), description, default permission ('mi.read'), and category ('call_center').
_r("cc_list_agents", "call_center", "List call center agents", category="call_center") - src/opensips_mcp/server.py:165-165 (registration)The call_center_tools module is imported in server.py to trigger the @mcp.tool() decorator and register cc_list_agents (and all other call center tools) with the FastMCP server instance.
from opensips_mcp.tools import call_center_tools as _cc_tools # noqa: E402, F401