Skip to main content
Glama
LBurny

py-spy MCP Server

by LBurny

top_profile

Destructive

Run a live sampling profiler on a Python process for a few seconds and return a summary of the most time-consuming functions.

Instructions

Run a live py-spy top view for a few seconds and return the summary.

On Windows, py-spy top cannot be captured through a pipe, so this tool falls back to a short record --format raw sample and returns the hottest frames instead of raw top output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gilNoOnly show traces holding the GIL.
pidNoProcess ID. Use this OR command.
idleNoInclude idle threads.
rateNoSamples per second (default 100).
nativeNoInclude native frames if supported.
commandNoCommand to run and monitor. Use this OR pid.
durationNoHow many seconds to run top (default 5, recommended 5-60).
subprocessesNoInclude child processes.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

The description adds value by explaining the Windows fallback behavior, but beyond that, it does not elaborate on the implications of the destructiveHint annotation (e.g., resource usage). The annotations already indicate destructiveness, so the added context is moderate.

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 two sentences, front-loaded with the core purpose, and contains no superfluous information. Every sentence earns its place.

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

Completeness4/5

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

Given that the tool has a complete schema, an output schema, and annotations, the description covers the essential purpose and a behavioral nuance (Windows fallback). It could be slightly more explicit about the non-Windows behavior, but it is largely complete.

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

Parameters3/5

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

Schema coverage is 100%, so the input schema already describes all parameters. The description does not add any parameter-level details beyond what's in the schema, meeting the baseline expectation.

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 tool runs a live py-spy top view and returns a summary. It distinguishes itself from sibling tools like record_profile by specifying it's a live view, and also notes a platform-specific fallback on Windows.

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

Usage Guidelines3/5

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

The description implies usage for quick live monitoring but does not explicitly compare with sibling tools like record_profile. It provides a Windows-specific guideline but lacks general when-to-use or when-not-to-use advice.

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/LBurny/pyspy-mcp'

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