Skip to main content
Glama
heizaheiza

Charles MCP Server

proxy_by_time

Capture network traffic for a specified duration or retrieve the most recent saved traffic package for analysis and debugging.

Instructions

Capture traffic for a fixed duration or read the latest saved history package.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
record_secondsYes录制持续时长,单位为秒。绝对不是 Unix 时间戳(如 1700000000)也不是毫秒时间戳(如 1700000000000)。0 表示读取最新历史流量包。

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The implementation of the `proxy_by_time` tool handler, which captures traffic for a duration and returns the proxy data.
    async def proxy_by_time(record_seconds: RecordSeconds, ctx: ToolContext) -> list[dict]:
        """Capture traffic for a fixed duration or read the latest saved history package."""
        logger.info("Tool called: proxy_by_time(record_seconds=%s)", record_seconds)
        deps = get_tool_dependencies(ctx)
    
        error_payload = seconds_input_error(
            parameter="record_seconds",
            value=record_seconds,
            max_allowed=deps.config.max_stoptime,
            retry_example="proxy_by_time(record_seconds=30)",
        )
        if error_payload:
            return error_payload
    
        return await get_proxy_data(record_seconds, ctx, deps=deps)
  • The `register_legacy_tools` function that contains the decorator registering `proxy_by_time` with the MCP server.
    def register_legacy_tools(mcp: FastMCP) -> None:
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the dual-mode behavior (capture vs read) but omits critical operational details: where captures are persisted, whether they overwrite previous data, what the 'history package' format is, or any side effects.

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?

Single sentence efficiently conveys dual functionality without verbosity. Front-loaded with the primary action. Minor awkwardness in 'saved history package' phrasing prevents a 5.

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 has only one parameter (well-documented in schema) and an output schema exists (per context signals), the description adequately covers the functional scope. The dual-mode behavior is mentioned, though could be elaborated.

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 coverage is 100% with detailed parameter descriptions (including Chinese documentation explaining the 0-value behavior and timestamp warnings). The description adds no parameter context, but the schema handles this adequately, warranting the baseline score.

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?

States two distinct operations clearly: 'Capture traffic for a fixed duration' (time-boxed recording) and 'read the latest saved history package' (retrieval). The 'fixed duration' phrasing implicitly distinguishes it from sibling start_live_capture which likely runs indefinitely.

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

Usage Guidelines2/5

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

No guidance on when to choose capture mode vs read mode (record_seconds=0), nor when to use this versus siblings like start_live_capture, read_live_capture, or get_recording_snapshot. The dual-purpose nature creates ambiguity without selection criteria.

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