Skip to main content
Glama

profiler-gc-alloc

Identify functions causing garbage collection allocations in Unity to reduce frame hitches by analyzing profiler data and call paths.

Instructions

Returns the top N functions with the highest GC (garbage collection) allocations in a profiler frame, including their call paths. GC allocations are a major source of frame hitches in Unity — use this to find and eliminate them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frameIndexNoFrame index to analyze. Use -1 for the latest available frame. Default: -1-1
threadIndexNoThread index. 0 = Main Thread. Default: 00
topNNoNumber of top entries to return. Default: 2020
minBytesNoMinimum GC allocation bytes to include. Filters out trivial allocations. Default: 00
maxDepthNoMaximum tree depth to scan. Default: 1515
Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It explains the tool's focus on GC allocations and their impact on frame hitches, which is useful context. However, it lacks details on permissions, rate limits, error conditions, or the format of returned data (e.g., JSON structure), leaving gaps for an agent to understand operational behavior.

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 front-loaded with the core purpose in the first sentence, followed by a concise rationale in the second. Every sentence earns its place by clarifying the tool's function and its importance in performance optimization, with no wasted words or redundancy.

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?

Given the tool's moderate complexity (5 parameters, no output schema, no annotations), the description is somewhat complete but has gaps. It explains the 'why' (GC allocations cause hitches) but lacks details on output format, error handling, or integration with sibling tools. Without an output schema, the agent must infer return values, making the description insufficient for full contextual understanding.

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?

The input schema has 100% description coverage, providing clear defaults and meanings for all parameters (e.g., frameIndex, threadIndex). The description does not add any parameter-specific semantics beyond what the schema already documents, such as explaining interactions between parameters or edge cases. With high schema coverage, the baseline score of 3 is appropriate.

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 clearly states the tool's purpose with specific verbs ('Returns the top N functions') and resources ('GC allocations in a profiler frame'), including call paths. It distinguishes itself from sibling tools by focusing on GC allocation analysis rather than asset management, scene operations, or other profiling tasks like 'profiler-hotpath' or 'profiler-frame-hierarchy'.

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 for when to use this tool ('GC allocations are a major source of frame hitches in Unity — use this to find and eliminate them'), explaining its role in performance optimization. However, it does not explicitly state when not to use it or name specific alternatives among sibling tools (e.g., 'profiler-hotpath' for non-GC performance issues).

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/butterlatte-zhang/unity-ai-bridge'

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