Skip to main content
Glama

torch_trace

Profile Python scripts with torch.profiler to identify GPU kernels and aten ops by time and input shapes; use it first when Nsight is unavailable.

Instructions

Run a Python script under torch.profiler in the user's interpreter. Returns kernels (real GPU kernels by device time, pct over total kernel time) and ops (aten ops with input shapes, inclusive time). Works without Nsight installed; use this first.

Input Schema

NameRequiredDescriptionDefault
cwdNo
topNo
argsNo
scriptYes
timeoutNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It usefully discloses that the script runs in the user's interpreter and describes returned data, but it does not cover execution side effects, permissions, timeout behavior, or what happens when the profiler is unavailable.

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 three short sentences and front-loads the primary action and return values. Every sentence adds useful information without repetition.

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?

For a tool with five parameters, no annotations, and no output schema, the description does well on purpose and return keys. It is incomplete on parameter meaning and execution semantics, which are important for correct invocation.

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?

Schema description coverage is 0% across five parameters. The description only implies the `script` parameter by saying it runs a Python script; it does not explain `cwd`, `args`, `top`, or `timeout`, so the low-coverage schema is not compensated.

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 names a specific action and tool context: running a Python script under torch.profiler in the user's interpreter. It also states what the tool returns (`kernels` and `ops`) and distinguishes itself from alternatives by saying it works without Nsight and should be used first.

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 phrase 'use this first' and 'Works without Nsight installed' gives clear priority and a condition for choosing this tool. However, it does not explicitly name the alternative profiler sibling or state when to switch away from this tool.

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