Skip to main content
Glama

list_conversations

Retrieve and filter conversation history from ElevenLabs agents, enabling users to review past interactions and monitor audio processing activities with pagination and time-based filtering.

Instructions

Lists agent conversations. Returns: conversation list with metadata. Use when: asked about conversation history.

Args:
    agent_id (str, optional): Filter conversations by specific agent ID
    cursor (str, optional): Pagination cursor for retrieving next page of results
    call_start_before_unix (int, optional): Filter conversations that started before this Unix timestamp
    call_start_after_unix (int, optional): Filter conversations that started after this Unix timestamp
    page_size (int, optional): Number of conversations to return per page (1-100, defaults to 30)
    max_length (int, optional): Maximum character length of the response text (defaults to 10000)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idNo
call_start_after_unixNo
call_start_before_unixNo
cursorNo
max_lengthNo
page_sizeNo

Implementation Reference

  • The @mcp.tool decorator registers the 'list_conversations' tool and provides the schema via parameter descriptions in the docstring.
    @mcp.tool(
        description="""Lists agent conversations. Returns: conversation list with metadata. Use when: asked about conversation history.
    
        Args:
            agent_id (str, optional): Filter conversations by specific agent ID
            cursor (str, optional): Pagination cursor for retrieving next page of results
            call_start_before_unix (int, optional): Filter conversations that started before this Unix timestamp
            call_start_after_unix (int, optional): Filter conversations that started after this Unix timestamp
            page_size (int, optional): Number of conversations to return per page (1-100, defaults to 30)
            max_length (int, optional): Maximum character length of the response text (defaults to 10000)
        """
    )
  • The core handler function that executes the tool: fetches conversations from ElevenLabs API, formats them with metadata, handles pagination, truncates large responses if needed, and returns formatted TextContent.
    def list_conversations(
        agent_id: str | None = None,
        cursor: str | None = None,
        call_start_before_unix: int | None = None,
        call_start_after_unix: int | None = None,
        page_size: int = 30,
        max_length: int = 10000,
    ) -> TextContent:
        """List conversations with filtering options."""
        page_size = min(page_size, 100)
    
        try:
            response = client.conversational_ai.conversations.list(
                cursor=cursor,
                agent_id=agent_id,
                call_start_before_unix=call_start_before_unix,
                call_start_after_unix=call_start_after_unix,
                page_size=page_size,
            )
    
            if not response.conversations:
                return TextContent(type="text", text="No conversations found.")
    
            conv_list = []
            for conv in response.conversations:
                start_time = datetime.fromtimestamp(conv.start_time_unix_secs).strftime(
                    "%Y-%m-%d %H:%M:%S"
                )
    
                conv_info = f"""Conversation ID: {conv.conversation_id}
    Status: {conv.status}
    Agent: {conv.agent_name or 'N/A'} (ID: {conv.agent_id})
    Started: {start_time}
    Duration: {conv.call_duration_secs} seconds
    Messages: {conv.message_count}
    Call Successful: {conv.call_successful}"""
    
                conv_list.append(conv_info)
    
            formatted_list = "\n\n".join(conv_list)
    
            pagination_info = f"Showing {len(response.conversations)} conversations"
            if response.has_more:
                pagination_info += f" (more available, next cursor: {response.next_cursor})"
    
            full_text = f"{pagination_info}\n\n{formatted_list}"
    
            # Use utility to handle large text content
            result_text = handle_large_text(full_text, max_length, "conversation list")
    
            # If content was saved to file, prepend pagination info
            if result_text != full_text:
                result_text = f"{pagination_info}\n\n{result_text}"
    
            return TextContent(type="text", text=result_text)
    
        except Exception as e:
            make_error(f"Failed to list conversations: {str(e)}")
            # This line is unreachable but satisfies type checker
            return TextContent(type="text", text="")
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions pagination ('cursor for retrieving next page') and default values for page_size and max_length, which adds useful context. However, it doesn't disclose important behavioral traits like whether this is a read-only operation, rate limits, authentication requirements, error conditions, or what the metadata includes. For a list tool with 6 parameters, this leaves significant gaps.

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

Conciseness4/5

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

The description is well-structured and appropriately sized. It front-loads the core purpose, then provides usage guidance, followed by a clear parameter documentation section. Every sentence earns its place, though the 'Args:' section could be slightly more integrated with the main description. The information density is high without being verbose.

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

Completeness3/5

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

Given the tool's complexity (6 parameters, no annotations, no output schema), the description is moderately complete. It covers parameters well but lacks information about return format details, error handling, authentication needs, and rate limits. The absence of an output schema means the description should ideally explain the structure of returned conversations and metadata, which it doesn't do beyond mentioning they exist.

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

Parameters4/5

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

The schema description coverage is 0%, so the description must compensate - and it does so effectively. It provides clear semantic explanations for all 6 parameters, including optional filtering by agent_id, pagination with cursor, time-based filtering with Unix timestamps, and defaults for page_size and max_length. The description adds substantial value beyond what the bare schema provides, though it doesn't explain parameter interactions or constraints beyond the listed ranges.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Lists agent conversations' with a specific verb and resource. It distinguishes from sibling tools like 'get_conversation' (singular) and 'list_agents', but doesn't explicitly contrast with other list tools like 'list_phone_numbers' or 'list_models'. The description is specific about what it returns: 'conversation list with metadata'.

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

Usage Guidelines3/5

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

The description provides some usage guidance with 'Use when: asked about conversation history', which gives context for when this tool is appropriate. However, it doesn't specify when NOT to use it or mention alternatives like 'get_conversation' for single conversations or other filtering approaches. The guidance is implied rather than explicit about tool selection.

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/projectservan8n/elevenlabs-mcp'

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