Skip to main content
Glama

samply record

samply_record
Destructive

Records CPU profiles to disk in save-only mode by profiling a command, attaching to an existing process ID, or capturing the whole system.

Instructions

Run samply record --save-only and write a profile to disk. Use exactly one recording mode: command, pid, or all=true.

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": "samply_record"
  }
}

Input Schema

NameRequiredDescriptionDefault
allNoProfile the whole system with `samply record --all`.
cwdNoWorking directory for the profiled command and output path.
gfxNoEnable Graphics-related event capture.
pidNoExisting process ID to attach to.
rateHzNoSampling rate in Hz.
commandNoCommand and arguments to profile.
extraArgsNoAdditional raw arguments appended to `samply record`.
outputPathNoWhere to save the profile. Relative paths are resolved from cwd.
samplyPathNoOptional path to a specific samply executable.
durationSecNoOptional recording duration in seconds.
profileNameNoCustom profile name.
reuseThreadsNoEnable `--reuse-threads`.
mainThreadOnlyNoOnly include the main thread when supported by samply.
presymbolicateNoGenerate a `.syms.json` sidecar for better offline symbol resolution. Enabled by default.

Output Schema

NameRequiredDescriptionDefault
okYes
cwdYes
argsYes
modeYes
errorYes
signalYes
stderrYes
stdoutYes
exitCodeYes
durationMsYes
samplyPathYes
installHintYes
profilePathYes
sidecarPathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the write profile is consistent, and the description's 'write a profile to disk' corroborates it. It does not add the behavior an agent most needs: that profiling a `command` executes an arbitrary process, and that an existing file at outputPath may be overwritten despite no annotation detail on that.

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?

Two short sentences, the operation front-loaded and the invocation constraint immediately after. Nothing is redundant or padded.

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?

For a 14-parameter tool with an output schema, the description covers the one thing the schema fails to enforce (mode exclusivity) and the write-to-disk outcome. It leaves a minor gap around what happens when no mode is supplied and around defaults such as presymbolicate being enabled by default.

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, but the description adds a real semantic constraint the schema lacks: command, pid, and all are mutually exclusive and exactly one must be used, even though the schema marks zero parameters required and defines no oneOf. That is meaningful meaning beyond the structured fields.

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 description names a specific verb and resource ('Run `samply record --save-only` and write a profile to disk'), which is far more precise than the tautological title. It does not name a sibling to contrast with, but the recording-vs-analysis split against the samply_* analysis tools is clear from the verb alone.

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?

'Use exactly one recording mode: command, pid, or all=true' gives a real selection constraint among the three modes, which is genuine guidance. It stops short of saying when to prefer attaching to a pid versus launching a command, or when to record at all versus analyzing an existing profile.

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