Skip to main content
Glama
heizaheiza

Charles MCP Server

throttling

Simulate network conditions by applying preset bandwidth limits like 3G, 4G, or 5G to test application performance under different connection speeds.

Instructions

Set a network throttling preset in Charles.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
presetYes弱网预设名称。仅允许固定值:3G/4G/5G/fibre/100mbps/56k/256k/deactivate/off/on/start。

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `throttling` tool implementation that handles the input, validates the preset, and calls the Charles client.
    async def throttling(ctx: ToolContext, preset: ThrottlingPreset) -> str:
        """Set a network throttling preset in Charles."""
        logger.info("Tool called: throttling(preset=%s)", preset)
        deps = get_tool_dependencies(ctx)
    
        preset_clean = preset.strip()
        if not preset_clean:
            return (
                "Error: parameter `preset` cannot be empty. "
                "Use one of the supported presets, for example: 3G / 4G / 5G / off / deactivate."
            )
    
        preset_lower = preset_clean.lower()
        supported = {value.lower() for value in THROTTLING_PRESET_CHOICES}
        if preset_lower not in supported:
            return (
                "Error: parameter `preset` is invalid. "
                f"Supported values: {', '.join(THROTTLING_PRESET_CHOICES)}. "
                'Retry with something like throttling("3G") or throttling("off").'
            )
    
        normalized_preset = "3G" if preset_lower in ("start", "on") else preset_clean
    
        try:
            async with deps.client_factory(deps.config) as client:
                success, message = await client.set_throttling(normalized_preset)
                return f"{'Success' if success else 'Error'}: {message}"
        except CharlesClientError as exc:
            logger.error("Throttling error: %s", exc)
            return f"Error: {exc}"
  • The MCP tool decorator registration for `throttling`.
    @mcp.tool()
    async def throttling(ctx: ToolContext, preset: ThrottlingPreset) -> str:
  • The `ThrottlingPreset` type definition used for input validation in the throttling tool.
    ThrottlingPreset = Annotated[
        str,
        Field(
            description=(
                "弱网预设名称。"
                "仅允许固定值:3G/4G/5G/fibre/100mbps/56k/256k/deactivate/off/on/start。"
            ),
            json_schema_extra={"enum": list(THROTTLING_PRESET_CHOICES)},
        ),
    ]
Behavior2/5

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

No annotations provided, so description carries full burden. It fails to disclose whether changes apply immediately to active connections, persist across sessions, or explain behavioral differences between enum values like 'off' vs 'deactivate' vs 'stop'.

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?

Single sentence, appropriately front-loaded with zero redundancy. Every word earns its place.

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 low complexity (1 parameter), 100% schema coverage, and existence of output schema, the description is minimally viable. However, lacks behavioral context that would help an agent distinguish between the 'off'/'deactivate'/'stop' states.

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 100%, documenting the preset parameter and its allowed values. The description adds no parameter semantics, earning the baseline score for high schema coverage.

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?

The description uses a specific verb ('Set') and clear resource ('network throttling preset'), distinguishing it from sibling analysis/capture tools. However, it assumes familiarity with 'Charles' (Charles Proxy) without context.

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 provided on when to apply throttling vs. analyzing traffic, prerequisites (e.g., active capture session), or how to disable throttling (though 'off'/'deactivate' enum values exist).

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