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
| Name | Required | Description | Default |
|---|---|---|---|
| capture_id | Yes | ||
| cursor | No | ||
| limit | No |
Implementation Reference
- charles_mcp/tools/live.py:103-123 (handler)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 - charles_mcp/tools/live.py:102-123 (registration)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