Skip to main content
Glama
LBurny

py-spy MCP Server

by LBurny

record_profile

Destructive

Profile a Python process or command by recording stack samples to identify performance bottlenecks.

Instructions

Record a sampling profile of a Python process or command.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gilNoOnly include traces holding the GIL.
pidNoProcess ID to sample. Use this OR command, not both.
idleNoInclude idle threads.
rateNoSamples per second (default 100).
nativeNoInclude native/C extension frames if supported on this platform.
commandNoCommand to run and sample, e.g. ["python", "script.py"]. Use this OR pid.
durationNoHow many seconds to sample (default 5, recommended 5-60).
subprocessesNoInclude child Python processes.
output_formatNoOne of "speedscope" (JSON), "flamegraph" (SVG), "raw" (text), "chrometrace".speedscope

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

The description adds no behavioral context beyond the annotation 'destructiveHint=true'. While the annotation covers destructive nature, the description could elaborate on performance impact or system effects during sampling. It does not contradict annotations.

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 with no fluff. It front-loads the core purpose and uses precise language, earning its place without unnecessary details.

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 the complexity (9 parameters), complete schema descriptions, and existence of an output schema, the description is adequate. It succinctly defines the tool's purpose, though it could briefly note default behavior (e.g., duration) to tie parameters to usage.

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?

The input schema provides 100% coverage with detailed descriptions for all 9 parameters. The tool description adds no extra meaning beyond the schema, meeting the baseline expected for high schema coverage.

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 'record' and the resource 'sampling profile' with a specific target 'Python process or command', distinguishing it from sibling tools like 'analyze_profile' and 'compare_profiles' which focus on analysis rather than data capture.

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 does not explicitly state when to use this tool over alternatives. It implies usage via the action of recording, but lacks guidance on scenarios where this tool is preferred over, say, 'dump_stacks' or 'top_profile'. The schema includes mutual exclusivity notes for parameters, but no tool-level usage guidance.

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