Skip to main content
Glama
unity-profiler-mcp
by shin0112

profiler_top_markers

Identifies high-cost main-thread markers in a Unity Profiler capture, exporting first if needed; sort by spikeAvg to reveal what grows in the top 5% of frame times.

Instructions

Most expensive main-thread markers of one capture (exports first if needed). sortBy spikeAvg shows what grows in the slowest 5% of frames.

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": {
      "capture": "<capture>"
    },
    "name": "profiler_top_markers"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
folderNoCapture folder. Default: UNITY_PROFILER_CAPTURES or <project>/ProfilerCaptures from the open editor.
sortByNo
captureYesCapture file name (with or without .data) inside the capture folder, or an absolute path.
containsNoCase-insensitive substring filter on the marker path.
maxDepthNoOnly markers at or above this hierarchy depth (0 = PlayerLoop level).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses a side effect (it may export the capture before reading) and explains the spikeAvg semantics ('what grows in the slowest 5% of frames'), but it says nothing about whether the export is slow or writes files, whether the capture must be closed, or whether the operation is purely read-only.

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 sentences, front-loaded with the core purpose, and the parenthetical prerequisite is placed exactly where the agent will look for it. Nothing is wasted.

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 6-parameter analysis tool with no output schema, the description never indicates the return shape (a ranked list of markers with their metrics) or the default result size, so an agent cannot anticipate the response. The export prerequisite is covered, but the result contract is not.

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 67% and several parameters already carry descriptions. The description adds real meaning for only one enum value, spikeAvg; avg, p95, selfAvg and gcBytesAvg remain unexplained, as does the default for limit. That is incremental value, not full compensation.

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 resource and scope: 'most expensive main-thread markers of one capture'. That is enough to separate it from profiler_summary (aggregate stats) and profiler_list_captures (inventory), though it never names a sibling explicitly.

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 is only implied: you reach for this when you need per-marker cost ranking rather than a summary. The 'exports first if needed' parenthetical tells the agent a prerequisite exists, but there is no stated when-not case or explicit routing to profiler_summary or profiler_compare.

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