Skip to main content
Glama
carloshpdoc

memorydetective

Build, boot, install, and launch an iOS app for leak investigation

bootAndLaunchForLeakInvestigation

Orchestrates building, booting a simulator, and launching an iOS app with MallocStackLogging=1 to enable memory leak detection, returning PID and UDID for further analysis.

Instructions

[mg.build] Single-call orchestration that runs xcodebuild build (optional), boots the iOS Simulator, installs the .app, and launches it with MallocStackLogging=1 propagated via SIMCTL_CHILD_*. Required because leaks --outputGraph regressed on macOS 26.x and only works when the target was launched with malloc-stack-logging in its environment. Returns the host PID + simulator UDID + bundle id ready to chain into captureMemgraph. Auto-discovers BUILT_PRODUCTS_DIR, WRAPPER_NAME, EXECUTABLE_NAME, and PRODUCT_BUNDLE_IDENTIFIER from xcodebuild -showBuildSettings -json. Required: scheme and exactly one of workspace or project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceNoAbsolute path to a .xcworkspace. Mutually exclusive with `project`.
projectNoAbsolute path to a .xcodeproj. Mutually exclusive with `workspace`.
schemeYesXcode scheme that builds the iOS application bundle.
configurationNoxcodebuild configuration. Default "Debug".Debug
bundleIdNoOverride the bundle identifier. By default it is discovered from `xcodebuild -showBuildSettings`.
derivedDataPathNoCustom -derivedDataPath. Useful to avoid collisions when multiple investigations run in parallel.
simulatorNoPick a simulator by `udid`, by `name` (with optional `os`), or omit to use whichever simulator is currently booted.
envVarsNoExtra env vars to apply to the launched app (propagated via SIMCTL_CHILD_*). Default already includes MallocStackLogging=1.
launchArgsNoExtra arguments passed to the app on launch.
buildBeforeLaunchNoRun `xcodebuild build` before installing. Set false when you've already built and want to skip straight to install/launch.
warmupSecondsNoHow long to wait after launch before resolving the host PID. Default 3 seconds.
Behavior5/5

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

With no annotations provided, the description fully carries the burden. It discloses all key behaviors: optional build, simulator boot, app install and launch with environment variable propagation, auto-discovery of build settings, and the returned data. No contradictions or omissions are apparent.

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 a single dense paragraph that front-loads the purpose. It is relatively concise for a complex tool with 11 parameters, though it could benefit from bullet points or clearer separation of logical sections to aid readability. No extraneous information is present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (11 parameters, nested objects, no output schema), the description adequately covers return values (host PID, simulator UDID, bundle ID) and explains how the tool chains into `captureMemgraph`. It also mentions auto-discovery, fulfilling the contextual needs for an agent to use it effectively.

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?

The input schema covers 100% of parameters with descriptions. The description adds extra meaning for several parameters, such as the default `MallocStackLogging=1` for `envVars` and the conditional use of `buildBeforeLaunch`. This goes beyond the schema alone, justifying a score above baseline.

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 what the tool does: orchestrates build, boot, install, and launch of an iOS app with MallocStackLogging=1 for leak investigation. It specifies the verb 'orchestration' and the resource 'iOS app', distinguishing it from sibling tools that analyze leaks rather than prepare the environment.

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 explains why this tool is needed (regression in `leaks --outputGraph` on macOS 26.x) and that it is a prerequisite for `captureMemgraph`. It provides context on when to use it, but does not explicitly state when not to use it or mention alternatives among siblings.

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