Skip to main content
Glama
carloshpdoc

memorydetective

Compare before/after .trace bundles for a perf regression target

compareTracesByPattern

Compare before and after performance traces to verify fixes for hangs, animation hitches, or app launch duration, returning PASS/PARTIAL/FAIL verdict with before/after stats and deltas.

Instructions

[mg.trace][mg.ci] Trace-side counterpart to verifyFix. Compares two .trace bundles for a specific perf category (hangs, animation-hitches, or app-launch) and emits a PASS/PARTIAL/FAIL verdict plus before/after stats and deltas. Apply thresholds: hangs PASS when longest is below hangsMaxLongestMs (default 0); hitches PASS when longest is below hitchesMaxLongestMs (default 100ms — Apple's user-perceptible threshold); app-launch PASS when total is below appLaunchMaxTotalMs (default 1000ms).

Pipeline: capture before/after .trace (via recordTimeProfile or Xcode), then point this at the pair. The natural followup to a hangs/jank/launch fix PR.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
beforeYesAbsolute path to the baseline `.trace` (pre-fix).
afterYesAbsolute path to the post-fix `.trace`.
categoryYesWhich perf category to verify. `hangs` parses the `potential-hangs` schema, `animation-hitches` parses `animation-hitches`, `app-launch` parses the launch breakdown.
thresholdsNo
hangsMinDurationMsNoFor `category: hangs` — only count hangs longer than this. Default 250ms (Apple's user-perceptible threshold for hangs).
hitchesMinDurationMsNoFor `category: animation-hitches` — only count hitches longer than this. Default 100ms (Apple's user-perceptible threshold).
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses default thresholds, PASS conditions per category, and the verdict output. It does not state whether it is read-only or destructive, but the comparison nature suggests no side effects. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two paragraphs with key information front-loaded. It is fairly concise but includes some redundant detail (e.g., repeating thresholds). Still, it earns its keep.

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 6 parameters, no output schema, and many sibling tools, the description covers purpose, usage, thresholds, and pipeline adequately. It could be more explicit about the output format but is sufficient.

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 83%, but the description adds meaning beyond schema by explaining default values, condition for PASS, and how category affects parsing. It also clarifies the pipeline context (e.g., absolute paths).

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 explicitly states it compares two .trace bundles for a specific perf category and emits a PASS/PARTIAL/FAIL verdict, distinguishing it from siblings like verifyFix. The verb 'compares' and resource '.trace bundles' are specific.

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 description provides clear context: it is the natural followup to a fix PR, and mentions the pipeline of capturing traces first. It does not explicitly exclude alternative tools but implies its role relative to verifyFix.

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/carloshpdoc/memorydetective'

If you have feedback or need assistance with the MCP directory API, please join our Discord server