Skip to main content
Glama
heizaheiza

Charles MCP Server

stop_live_capture

Stop active network traffic capture in Charles Proxy and optionally save filtered data for analysis. Use this tool to end monitoring sessions and preserve relevant traffic snapshots.

Instructions

Stop an active live capture and optionally persist the filtered snapshot. Only status='stopped' means the capture is fully closed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
capture_idYes
persistNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
statusYes
warningsNo
capture_idYes
recoverableNo
total_itemsYes
persisted_pathNo
active_capture_preservedNo

Implementation Reference

  • The MCP tool handler for 'stop_live_capture' which delegates the request to the live service.
    async def stop_live_capture(
        ctx: ToolContext,
        capture_id: str,
        persist: bool = True,
    ) -> StopLiveCaptureResult:
        """Stop an active live capture and optionally persist the filtered snapshot.
        Only status='stopped' means the capture is fully closed."""
        deps = get_tool_dependencies(ctx)
        try:
            return await deps.live_service.stop(capture_id, persist=persist)
        except Exception as exc:
            raise ValueError(str(exc)) from exc
  • The actual service logic that executes the stop operation for live captures.
    ) -> StopLiveCaptureResult:
        capture = self.live_manager.require(capture_id)
        raw_items = await self.export_current_session()
        self.live_manager.read(
            capture_id,
            raw_items,
            cursor=capture.cursor,
            limit=max(len(raw_items), 1),
            advance=True,
        )
    
        if capture.managed:
            stop_succeeded, stop_warnings, stop_error = await self._stop_recording_with_retry()
            capture.warnings = list(dict.fromkeys(capture.warnings + stop_warnings))
            if not stop_succeeded:
                return StopLiveCaptureResult(
                    capture_id=capture.capture_id,
                    status="stop_failed",
                    persisted_path=None,
                    total_items=len(capture.items),
                    recoverable=True,
                    active_capture_preserved=True,
                    error=stop_error or "failed to stop Charles recording",
                    warnings=list(capture.warnings),
                )
    
        persisted_path: str | None = None
        if persist:
            client = await self._get_shared_client()
            persisted_path = self.save_capture_items(
                client.get_full_save_path(),
                capture.items,
            )
    
        stopped = self.live_manager.close(capture_id)
        await self._close_shared_client()
        return StopLiveCaptureResult(
            capture_id=stopped.capture_id,
  • The Pydantic model for the result returned by stop_live_capture.
    class StopLiveCaptureResult(BaseModel):
        """Stop a live capture session."""
    
        capture_id: str
        status: Literal["stopped", "stop_failed"]
Behavior3/5

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

With no annotations provided, the description carries the full burden. It adds valuable context about the persistence option and status verification, but fails to disclose mutation characteristics, idempotency concerns, or what occurs when persist=false (e.g., data loss risks).

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?

Two sentences efficiently convey the core action, optional persistence behavior, and critical status-checking guidance without redundancy. Every sentence earns its place and critical information is front-loaded.

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 has an output schema (reducing the need to describe return values) and a simple 2-parameter structure, the description covers the primary behavioral concerns. However, gaps remain in parameter documentation and explicit state transition prerequisites.

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

Parameters2/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 implicitly references the 'persist' parameter via 'optionally persist' but provides no semantics for 'capture_id' (what format, where to obtain it). Partial compensation warrants a below-average score.

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 specific action ('Stop an active live capture') and resource, distinguishing it from siblings like start_live_capture, peek_live_capture, and read_live_capture. The mention of 'filtered snapshot' adds specific context about what is being handled.

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 implies usage by specifying 'active' live capture and provides a validation hint ('Only status='stopped' means the capture is fully closed'), but lacks explicit guidance on when to use this versus peek_live_capture or read_live_capture, and omits prerequisites like requiring an active capture_id.

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