Skip to main content
Glama

samply inspect thread

samply_inspect_thread
Read-onlyIdempotent

Inspect a single profiled thread to identify high-cost functions and common call stacks, using a thread index or name substring for targeted CPU performance analysis.

Instructions

Inspect one thread in detail, including its hottest functions and most common stacks. The thread argument accepts either the numeric thread index from samply_summarize_profile or a thread name substring.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "thread": "<thread>"
    },
    "name": "samply_inspect_thread"
  }
}

Input Schema

NameRequiredDescriptionDefault
threadYesThread index or thread name / substring.
maxStacksNoMaximum number of representative stacks to include.
maxMarkersNoMaximum number of marker categories to include.
profilePathNoPath to a profile JSON or JSON.GZ file.
maxFunctionsNoMaximum number of hot functions to include.

Output Schema

NameRequiredDescriptionDefault
threadYes
profilePathYes
sidecarPathYes
presymbolicatedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile is fully covered. The description adds only that output includes hottest functions and common stacks, without disclosing cost, limits, or ordering behavior. That is useful context but thin beyond the structured fields.

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 tight sentences, purpose first and the identifier-provenance hint second. Nothing is repeated from the schema or annotations, and no sentence is filler.

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?

With complete annotations, a full input schema, and an output schema covering return shape, the description needs only purpose and the identifier source, both of which it supplies. Minor gaps remain: no mention of sourcing profilePath or how the detail level compares to sibling drill-down tools.

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 description coverage is 100%, so a baseline of 3 applies. The description does add one piece of meaning beyond the schema for the required param: where the numeric index originates, which the schema's "Thread index or thread name / substring" does not say. None of the four optional parameters (maxStacks, maxMarkers, maxFunctions, profilePath) are addressed.

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?

"Inspect one thread in detail, including its hottest functions and most common stacks" gives a specific verb (inspect), a bounded resource (one thread), and what the result contains, which cleanly separates it from the profile-wide siblings. It stops short of naming an explicit complement, so differentiation is inferred rather than stated.

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 second sentence tells the agent how to obtain the required identifier (numeric index from samply_summarize_profile or a name substring), which is concrete pre-call guidance. It gives no when-not-to-use guidance or comparison against siblings like samply_focus_functions or samply_breakdown_subsystems.

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