Skip to main content
Glama

Break down Metal allocations by type

perf_memory_breakdown
Read-only

Breaks down saved Metal recording allocations by type into allocated, live, and gone memory, exposing churn behind spikes or stalls. Reports totals, live memory by mode, allocation rate, and peak.

Instructions

Breaks down the Metal allocations of a saved recording by type (texture, buffer, heap...): allocated, still live and gone per type. A small live share of a large allocated size is churn, the pattern behind a memory spike or a stall. Also totals, live memory by mode, allocation rate and peak. Needs a Metal recording above tier light.

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": {
      "run": "<run>"
    },
    "name": "perf_memory_breakdown"
  }
}

Input Schema

NameRequiredDescriptionDefault
runYesa run name from perf_runs
topNohow many resource types to keep, the largest allocated first, default 10
fieldsNoresult paths to keep, dotted: common.frame_pacing

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.28.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already establish readOnly and closed-world, and the description adds value on top: the prerequisite of a Metal recording above tier light, that the input is a saved recording rather than a live capture, and what the breakdown will contain (per-type allocated/live/gone plus totals, live by mode, allocation rate, peak). It does not cover behavior on unsupported recordings or how missing data is reported.

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?

Three dense sentences with the purpose front-loaded, followed by the interpretive heuristic and then the prerequisite. Every sentence carries information, though the telegraphic phrasing ('heap...', backticked `gone`) is slightly compressed for an agent parsing it cold.

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 an output schema present, the description need not explain return values, and it still sketches the key result categories plus the recording-tier requirement. For a single-required-parameter analytical read tool this is nearly complete; only edge-case behavior is left unspecified.

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 `run`, `top` and `fields` are already documented, and the description only loosely reinforces `run` via 'a saved recording' / 'Needs a Metal recording'. It adds no meaning for `top` truncation ordering or the dotted `fields` paths beyond what the schema says, so baseline 3 applies.

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?

States a specific verb and resource — breaking down Metal allocations of a saved recording by resource type — and enumerates the concrete outputs (allocated, still live, gone per type). An agent can immediately tell this is an allocation-attribution tool rather than a recording, comparison, or gating tool like its siblings.

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?

Provides a real diagnostic framing — 'a small live share of a large allocated size is churn, the pattern behind a memory spike or a stall' — which tells the agent when this tool is the right lens. It also states a hard precondition ('Needs a Metal recording above tier light'). It does not name an alternative sibling for related questions, so it stops short of full routing guidance.

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