Skip to main content
Glama
heizaheiza

Charles MCP Server

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
statusYes
warningsNo
truncatedNo
capture_idYes
next_cursorYes
total_new_itemsYes

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
Behavior4/5

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

With no annotations provided, the description carries full responsibility for behavioral disclosure. It successfully communicates that the operation is non-destructive ('does not consume items'), safe for polling, and returns compact summaries. It does not mention error conditions or authentication requirements, hence not a perfect 5.

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?

Four sentences with zero waste: opens with the core action, details the return format, explains the safety/behavioral contract, and concludes with sibling differentiation. Every sentence earns its place and is front-loaded with critical information.

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

Completeness4/5

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

Given the tool's moderate complexity (3 params, simple concept) and the existence of an output schema, the description is appropriately complete. It summarizes the return value sufficiently without duplicating the output schema, though it could have briefly mentioned the limit parameter's role in pagination.

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?

Schema description coverage is 0%, requiring the description to compensate. It successfully explains the 'cursor' semantics ('without advancing the cursor'), which is the most complex parameter (anyOf int/null). However, it omits explicit description of 'limit' and 'capture_id', though these are relatively self-explanatory from their titles and context.

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

Purpose5/5

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

The description clearly states the action (preview incremental traffic), the resource (live capture), and the key mechanism (without advancing the cursor). It effectively distinguishes from siblings by contrasting with query_live_capture_entries and implying the difference from read_live_capture through the 'does not consume items' clarification.

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

Usage Guidelines5/5

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

Excellent guidance provided: explicitly states 'Safe to call repeatedly' indicating polling scenarios, clarifies the non-consuming nature (idempotent peek semantics), and directly names the alternative tool 'query_live_capture_entries' for when structured filtering is needed instead of simple preview.

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

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