Skip to main content
Glama

debugpy_status

Attach debugpy to running Python processes in Docker containers for enhanced debugging and inspection. Use this tool to inject debugging capabilities into containerized applications.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
containerYes
portNo
hostNo0.0.0.0
python_binNopython

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'debugpy_status' tool. It checks if a Docker container is running, whether debugpy is installed, if the debug port is listening, retrieves the process table, and returns comprehensive status information.
    @mcp.tool()
    def debugpy_status(container: str, port: int = DEFAULT_PORT, host: str = DEFAULT_HOST, python_bin: str = "python") -> dict[str, Any]:
        running = docker_inspect_running(container)
        if not running:
            return DebugpyStatusResult(ok=False, container=container, port=port, host=host, container_running=False, debugpy_installed=False, debugpy_listening=False, notes=["Container is not running or does not exist."]).model_dump()
        installed, _version = detect_debugpy_installed(container, python_bin=python_bin)
        mapped_port = docker_port_mapping(container, port)
        notes: list[str] = []
        if mapped_port is None:
            notes.append(f"No docker port mapping was found for container port {port}. Your IDE may still connect if the network path is otherwise reachable.")
        processes = get_process_table(container)
        suggested_pid, pid_notes = choose_pid(processes)
        notes.extend(pid_notes)
        listening = port_is_listening(container, port)
        notes.append(f"Port {port} is {'already' if listening else 'not'} listening inside the container.")
        if not installed:
            notes.append("debugpy is not importable inside the container.")
        return DebugpyStatusResult(ok=True, container=container, port=port, host=host, container_running=True, debugpy_installed=installed, debugpy_listening=listening, mapped_port=mapped_port, candidate_processes=processes, suggested_pid=suggested_pid, notes=notes).model_dump()
  • The Pydantic BaseModel that defines the output schema for the debugpy_status tool, including fields for container status, debugpy installation status, port listening status, process candidates, and notes.
    class DebugpyStatusResult(BaseModel):
        ok: bool
        container: str
        port: int
        host: str
        container_running: bool
        debugpy_installed: bool
        debugpy_listening: bool
        mapped_port: str | None = None
        candidate_processes: list[ProcessInfo] = Field(default_factory=list)
        suggested_pid: int | None = None
        notes: list[str] = Field(default_factory=list)
  • The @mcp.tool() decorator registers the debugpy_status function as an MCP tool, making it available to MCP clients.
    @mcp.tool()
Behavior1/5

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

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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/will-garrett/debugpy-mcp'

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