Skip to main content
Glama

profile_process

Read-only

Identify what inside a CPU-heavy process consumes processor time. Samples run for 1-30 seconds and return the top functions, modules, threads, and hottest call path as shares of samples. Windows, as administrator.

Instructions

Samples where a process spends its processor time, for a few seconds (1 to 30, default 5): the system's own profiler records what each processor runs a thousand times a second, with the call stack, and the samples of this process are summed. Returns the functions taking the most time (their own time, and with the functions they call, as shares of the samples), the modules, the threads, and the hottest call path from the outermost call in. Use it when a process uses much CPU and the question is what in it does; get_thread_stacks gives one moment's stacks instead. Windows only, as administrator. The process is not opened: the kernel walks its stacks, and names come from the symbols on this PC (the modules' PDB files) or their exports; code without either is named by its module. It runs a kernel trace for the time asked, which costs some CPU while it runs.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "profile_process"
  }
}

Input Schema

NameRequiredDescriptionDefault
pidNoThe process to sample.
topNoHow many functions and modules to list, the most time first (1 to 100, default 25).
secondsNoHow long to sample, in seconds (1 to 30, default 5).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover safety (readOnlyHint true, destructiveHint false), but the description goes well beyond them: it explains that the process is not opened, that the kernel walks its stacks, that names come from local PDBs or exports, and that the kernel trace costs CPU while it runs. That is unusually rich behavioral context; it only misses details like error behavior for bad pids or inaccessible processes.

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?

The purpose and the alternative are front-loaded in the first sentences, and almost every clause carries information (units, symbol sources, cost). It is a dense single block with a slightly meandering middle section on symbol resolution that could be tightened, but nothing is truly redundant.

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?

For a three-parameter read tool with no output schema, the description compensates well: it describes the returned structure (own time vs inclusive time as shares, modules, threads, hottest call path), the sampling mechanism, platform limits, and the runtime cost. An agent has everything needed to call it and interpret results.

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 schema already documents pid, top and seconds, and the description mostly corroborates it (1 to 30 seconds, default 5, listing most-time-first). It adds real meaning by clarifying that the process 'is not opened' and that sampling is per-process sampling summed over the interval, which shapes how the pid argument behaves.

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 opens with a specific verb and resource: 'Samples where a process spends its processor time,' then enumerates exactly what comes back (function times, modules, threads, hottest call path). That scope is distinct enough from siblings such as get_thread_stacks that an agent can choose it without opening other schemas.

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?

It names the exact trigger ('when a process uses much CPU and the question is what in it does') and the alternative it is not ('get_thread_stacks gives one moment's stacks instead'). It also states the platform and permission constraints up front: Windows only, as administrator, which are hard prerequisites an agent must know.

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