Skip to main content
Glama
carlosedp

Windows MCP Server

by carlosedp

Windows-top-processes-by-memory

Retrieves the top processes consuming memory on a Windows system. Specify the number of processes to return.

Instructions

Get the top X processes by memory usage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:216-219 (registration)
    MCP tool registration for 'Windows-top-processes-by-memory' using the @mcp.tool decorator with a description.
    @mcp.tool(
            name="Windows-top-processes-by-memory",
            description="Get the top X processes by memory usage."
    )
  • main.py:220-236 (handler)
    Handler function 'get_top_processes_by_memory' that iterates over running processes using psutil, collects PID, name, and memory (RSS in MB), sorts by memory descending, and returns the top N results.
    def get_top_processes_by_memory(amount: int = 5) -> list[ProcessInfo]:
        """Get the top X processes by memory usage. Returns structured results."""
        import psutil
    
        procs: list[ProcessInfo] = []
        for p in psutil.process_iter(['pid', 'name', 'memory_info']):
            try:
                mem_info = p.info.get('memory_info')
                rss = mem_info.rss if mem_info else p.memory_info().rss
                mem_mb = rss / (1024 ** 2)
                name = p.info.get('name') or p.name()
                procs.append(ProcessInfo(pid=p.pid, name=name, memoryMB=mem_mb))
            except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
                continue
    
        procs.sort(key=lambda x: x.memoryMB or 0.0, reverse=True)
        return procs[:amount]
  • main.py:19-24 (schema)
    ProcessInfo Pydantic model used as the return type for the tool, containing pid, name, cpu_percent, and memoryMB fields.
    class ProcessInfo(BaseModel):
        """Model for process information returned by top-processes tools."""
        pid: int = Field(description="Process ID")
        name: str = Field(description="Process name")
        cpu_percent: float | None = Field(default=None, description="CPU usage percentage sampled over a short interval")
        memoryMB: float | None = Field(default=None, description="Resident memory usage in MB")
Behavior2/5

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

With no annotations, the description must fully disclose behavior. It only states the basic purpose and does not mention performance implications, sorting order, or whether it requires administrative privileges, leaving the agent with incomplete expectations.

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?

The description is a single, concise sentence that directly states the tool's function with no unnecessary words. It is front-loaded and efficient.

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?

While the tool is simple and an output schema exists, the description lacks behavioral context and parameter guidance. It is minimally acceptable for a basic listing tool but could better support agent decision-making.

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?

The input schema has one parameter ('amount') with 0% schema description coverage. The description does not mention this parameter or explain its meaning, default value, or constraints, failing to add value beyond the schema.

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 verb 'Get' and the resource 'top X processes by memory usage', which is specific and distinguishes it from sibling tools like Windows-top-processes-by-cpu.

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 is provided on when to use this tool versus alternatives such as Windows-top-processes-by-cpu or other system info tools. The description does not mention any prerequisites or exclusions.

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/carlosedp/windows-mcp-server'

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