Skip to main content
Glama
scarletfantasy

pix-mcp

pix_get_context_switches

Read-onlyIdempotent

View a thread's scheduling history to see when it moved on or off a core and the wait reason, distinguishing blocked threads from CPU-bound ones.

Instructions

One thread's scheduling history: every time it came on or off a core, and why.

A row where from_thread_id is this thread is the thread losing the core, and from_thread_wait_reason says what for. That is the column that separates a thread that is slow because it is computing from one that is slow because it is blocked - a distinction a sample count cannot make, since a blocked thread simply produces fewer samples and looks idle.

Wait reasons are the Windows KWAIT_REASON values: 0 is Executive, 1 FreePage, 5 Suspended, 6 UserRequest, 7 WrExecutive, 13 WrQueue, 31 WrDispatchInt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
end_timeNo
thread_idYes
capture_idYes
start_timeNo
cursor_positionNo
timeout_secondsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Beyond the readOnlyHint/idempotent/destructive annotations, the description discloses row-level semantics: a row where from_thread_id is the requested thread represents the thread losing the core, and from_thread_wait_reason encodes why. It also enumerates relevant KWAIT_REASON values, adding useful interpretative context. No contradiction with annotations.

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 description is front-loaded with the core definition, and each paragraph earns its place by adding interpretive value: row direction, the computing-versus-blocked distinction, and wait-reason values. The KWAIT_REASON list is somewhat detailed but directly useful and not redundant with the schema.

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?

The description is strong on result interpretation and the central use case, and an output schema exists to cover return fields. However, it offers no guidance on time filtering, pagination, timeout behavior, or how to choose this tool over siblings, leaving several optional parameters under-specified.

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?

With 0% schema description coverage, the description needed to compensate by explaining the parameters, but it only clarifies thread_id's role and the meaning of from_thread_id/from_thread_wait_reason in the result. capture_id, start_time, end_time, limit, cursor_position, and timeout_seconds are left entirely to inference from their names.

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 first sentence defines the resource precisely: one thread's scheduling history, covering every on-core/off-core transition and the reason. It does not explicitly name sibling tools, but the context-switch semantics distinguish it from nearby tools like pix_get_cpu_samples or pix_get_thread_timeline.

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

Usage Guidelines4/5

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

The description gives a concrete diagnostic use: distinguishing a thread that is slow because it is computing from one that is slow because it is blocked, and explicitly notes that a sample count cannot make this distinction. It does not name alternative tools or exclusion conditions, but the guidance is clear enough to route an agent.

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