Skip to main content
Glama

processes/top

Read-onlyIdempotent

Snapshot live Linux process activity like top: CPU, memory, load average and per-process stats from /proc, read-only. Sort by cpu, mem, res, time or pid to find resource hogs.

Instructions

Snapshot like top -b -n 1, read from /proc: header (uptime, users, load average, task counts by state, CPU us/sy/ni/id/wa/hi/si/st, memory and swap) plus the process table (PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND), sorted by sort_by (default cpu). Read-only. %CPU is measured over interval_ms (default 1000, max 10000), so the call takes about that long. For a lighter PID list or a single PID use processes/list; to signal a process processes/delete; for memory totals only memory/usage; for which process owns a port network/connections. limit defaults to all processes; user is an exact username. Sizes are bytes (MiB with human_readable). output_format: default and table give top's layout, wide adds PPID, THR and full command lines, json/yaml return an object with summary and processes (memory in bytes).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userNoOnly this user's processes
limitNoMaximum processes to list (default: all)
sort_byNoSort column: cpu (default, like top), mem/res (resident memory), time (total CPU time), pid
privilegedNoRun as root. Needs a grant for this tool in mcp-sudo.yaml, otherwise refused
interval_msNo%CPU sampling interval in milliseconds (default 1000, max 10000)
output_formatNoDefault/table: top's own layout. wide: adds PPID, THR and full command lines (like top -c). json/yaml: structured {summary, processes}, memory in bytes (mem_bytes, swap_bytes, virt_bytes, res_bytes, shr_bytes)
human_readableNoMemory like top (MiB header, m/g columns); default is bytes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.1
    • changedInput schema / properties / privileged / description
      Previous value: -"Set to true to run as root"New value: +"Run as root. Needs a grant for this tool in mcp-sudo.yaml, otherwise refused"
  2. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare read-only/idempotent/non-destructive, so the safety profile is covered. The description adds genuinely new behavioral context: the %CPU sampling window means the call blocks for roughly interval_ms (default 1000, max 10000), and %CPU is measured over that interval rather than instantaneous. It does not discuss permission requirements for privileged mode beyond what the schema says.

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?

Front-loaded with the core behavior, then alternatives, then parameter notes. Dense but every clause carries information; the output_format sentence is long and partly mirrors the schema, which keeps it from being maximally tight.

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

Completeness5/5

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

No output schema exists, yet the description specifies the shape of/yaml output ({summary, processes}, bytes) and the wide/table layouts, so an agent knows what it will receive. All defaults and side effects an agent needs are present.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description goes slightly beyond by restating the operative defaults (sort_by cpu, limit all, interval_ms 1000/10000) and clarifying that `user` is an exact-match username and that memory is bytes unless human_readable. Much of this duplicates the schema, keeping it below 5.

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?

States a specific verb+resource ('Snapshot like `top -b -n 1`, read from /proc') and enumerates exactly what it returns (header fields plus process table columns). It is unmistakably distinct from processes/list and memory/usage.

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

Usage Guidelines5/5

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

Explicitly routes four alternatives by task: processes/list for a lighter PID list, processes/delete to signal, memory/usage for totals, network/connections for port ownership. Conditions for choosing each are stated, not implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.