Skip to main content
Glama
heizaheiza

Charles MCP Server

by heizaheiza

peek_live_capture

Preview real-time network traffic without consuming data. View compact entry summaries (host/method/path/status) to monitor incremental traffic flow during debugging sessions.

Instructions

Preview incremental traffic without advancing the cursor. Returns compact entry summaries (host/method/path/status only). Safe to call repeatedly — does not consume items. Use query_live_capture_entries for structured filtering and analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
capture_idYes
cursorNo
limitNo

Implementation Reference

  • The `peek_live_capture` tool handler function. It reads incremental traffic from a live capture session without advancing the internal cursor.
    async def peek_live_capture(
        ctx: ToolContext,
        capture_id: str,
        cursor: Optional[int] = None,
        limit: int = 50,
    ) -> LiveCaptureReadResult:
        """Preview incremental traffic without advancing the cursor.
        Returns compact entry summaries (host/method/path/status only).
        Safe to call repeatedly — does not consume items.
        Use query_live_capture_entries for structured filtering and analysis."""
        deps = get_tool_dependencies(ctx)
        try:
            result = await deps.live_service.read(
                capture_id,
                cursor=cursor,
                limit=limit,
                advance=False,
            )
            return _compact_read_result(result)
        except Exception as exc:
            raise ValueError(str(exc)) from exc
  • The `peek_live_capture` tool is registered using the `@mcp.tool()` decorator within the `register_live_tools` function in `charles_mcp/tools/live.py`.
    @mcp.tool()
    async def peek_live_capture(
        ctx: ToolContext,
        capture_id: str,
        cursor: Optional[int] = None,
        limit: int = 50,
    ) -> LiveCaptureReadResult:
        """Preview incremental traffic without advancing the cursor.
        Returns compact entry summaries (host/method/path/status only).
        Safe to call repeatedly — does not consume items.
        Use query_live_capture_entries for structured filtering and analysis."""
        deps = get_tool_dependencies(ctx)
        try:
            result = await deps.live_service.read(
                capture_id,
                cursor=cursor,
                limit=limit,
                advance=False,
            )
            return _compact_read_result(result)
        except Exception as exc:
            raise ValueError(str(exc)) from exc

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/heizaheiza/Charles-mcp'

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