Skip to main content
Glama

spix_call_list

Retrieve and filter call session records from the Spix MCP server to monitor status, track progress, and manage telephony operations.

Instructions

List call sessions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
playbook_idNoFilter by playbook
statusNoFilter by status
limitNoNumber of results
cursorNoPagination cursor

Implementation Reference

  • `create_tool_handler` is the generic handler for all MCP tools. It resolves the `tool_name` (like "spix_call_list") to a `CommandSchema` via `get_schema_by_tool_name`, validates access, and dispatches the request to the API.
    async def create_tool_handler(
        session: McpSessionContext,
        tool_name: str,
        arguments: dict,
    ) -> list:
        """Execute an MCP tool call by dispatching to the backend API.
    
        This function:
        1. Resolves the tool name to a command schema
        2. Validates session scope (playbook access, channel access)
        3. Builds the API request
        4. Dispatches to the backend
        5. Returns the response as MCP TextContent
    
        Args:
            session: The MCP session context for scope validation.
            tool_name: The MCP tool name (e.g., "spix_playbook_create").
            arguments: The tool arguments from the MCP client.
    
        Returns:
            List containing a single TextContent with the JSON response.
        """
        # Import here to avoid circular imports and handle missing mcp package
        try:
            from mcp.types import TextContent
        except ImportError:
            # Fallback for when mcp is not installed
            class TextContent:  # type: ignore[no-redef]
                def __init__(self, type: str, text: str) -> None:
                    self.type = type
                    self.text = text
    
        # Resolve tool name to schema
        schema = get_schema_by_tool_name(tool_name)
        if not schema:
            return [
                TextContent(
                    type="text",
                    text=orjson.dumps(
                        {"ok": False, "error": {"code": "unknown_tool", "message": f"Unknown tool: {tool_name}"}}
                    ).decode(),
                )
            ]
    
        # Validate tool access (not disabled)
        try:
            session.validate_tool_access(schema.path)
        except Exception as e:
            from spix_mcp.session import McpScopeError
    
            if isinstance(e, McpScopeError):
                return [TextContent(type="text", text=orjson.dumps({"ok": False, "error": e.to_dict()}).decode())]
            raise
    
        # Validate channel access if applicable
        channel = infer_channel_from_tool(schema.path)
        if channel:
            try:
                session.validate_channel_access(channel)
            except Exception as e:
                from spix_mcp.session import McpScopeError
    
                if isinstance(e, McpScopeError):
                    return [TextContent(type="text", text=orjson.dumps({"ok": False, "error": e.to_dict()}).decode())]
                raise
    
        # Handle playbook_id: validate and apply default
        playbook_id = arguments.get("playbook_id")
        try:
            effective_playbook = session.validate_playbook_access(playbook_id)
            if effective_playbook and not playbook_id:
                # Apply default playbook
                arguments["playbook_id"] = effective_playbook
        except Exception as e:
            from spix_mcp.session import McpScopeError
    
            if isinstance(e, McpScopeError):
                return [TextContent(type="text", text=orjson.dumps({"ok": False, "error": e.to_dict()}).decode())]
            raise
    
        # Build endpoint URL with path parameters
        endpoint, remaining_args = build_endpoint_url(schema, arguments)
    
        # Dispatch to backend API
        client = session.client
        method = schema.http_method.lower()
    
        if method == "get":
            response = await asyncio.to_thread(client.get, endpoint, params=remaining_args if remaining_args else None)
        elif method == "post":
            response = await asyncio.to_thread(client.post, endpoint, json=remaining_args if remaining_args else None)
        elif method == "patch":
            response = await asyncio.to_thread(client.patch, endpoint, json=remaining_args if remaining_args else None)
        elif method == "delete":
            response = await asyncio.to_thread(client.delete, endpoint, params=remaining_args if remaining_args else None)
        else:
            response = await asyncio.to_thread(client.get, endpoint)
    
        # Build response envelope
        envelope: dict = {"ok": response.ok, "meta": response.meta}
        if response.ok:
            envelope["data"] = response.data
            if response.pagination:
                envelope["pagination"] = response.pagination
            if response.warnings:
                envelope["warnings"] = response.warnings
        else:
            envelope["error"] = response.error
    
        return [TextContent(type="text", text=orjson.dumps(envelope).decode())]
  • The `CommandSchema` definition for "call.list". The `spix_call_list` tool name is dynamically mapped to this schema at runtime.
        path="call.list",
        cli_usage="spix call list [--playbook <id>] [--status <s>]",
        http_method="GET",
        api_endpoint="/calls",
        mcp_expose="tool",
        mcp_profile="safe",
        description="List call sessions",
        params=[
            CommandParam("playbook_id", "string", description="Filter by playbook"),
            CommandParam(
                "status",
                "enum",
                choices=["queued", "dialing", "ringing", "in_progress", "completed", "failed", "cancelled"],
                description="Filter by status",
            ),
            CommandParam("limit", "integer", default=50, description="Number of results"),
            CommandParam("cursor", "string", description="Pagination cursor"),
        ],
    ),
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'List call sessions' implies a read-only operation, but it doesn't specify whether this requires authentication, how results are ordered, if there are rate limits, or what the output format looks like (e.g., pagination details beyond the cursor parameter). For a tool with no annotations, this leaves significant gaps in understanding its behavior and constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just three words, 'List call sessions', which is front-loaded and wastes no space. Every word directly contributes to stating the tool's purpose without unnecessary elaboration, making it efficient and easy to parse at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a list operation with filtering and pagination, no annotations, and no output schema, the description is incomplete. It doesn't address key contextual aspects like authentication requirements, response format, error handling, or how to interpret the cursor for pagination. For a tool with four parameters and multiple sibling tools, more detail is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with clear documentation for all four parameters (playbook_id, status, limit, cursor), including an enum for status. The description adds no additional semantic context beyond what the schema provides (e.g., it doesn't explain how filtering works or typical use cases for parameters). Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List call sessions' clearly states the verb ('List') and resource ('call sessions'), providing a basic understanding of the tool's function. However, it lacks specificity about scope or differentiation from sibling tools like spix_call_show or spix_call_summary, which also relate to calls but serve different purposes. This makes it adequate but vague, as it doesn't clarify what aspects of call sessions are listed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, context for filtering (e.g., when to apply playbook_id or status filters), or comparisons to sibling tools like spix_call_show (for details on a single call) or spix_call_summary (for aggregated data). Without such information, users must infer usage from the tool name and parameters alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Spix-HQ/spix-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server