Skip to main content
Glama
heizaheiza

Charles MCP Server

by heizaheiza

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 表示读取最新历史流量包。

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:

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