Skip to main content
Glama

start_sim_log_cap

Capture structured logs from a specified iOS simulator and app using UUID and bundle ID. Optional console output capture requires app relaunch. Returns a session ID for log tracking.

Instructions

Starts capturing logs from a specified simulator. Returns a session ID. By default, captures only structured logs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bundleIdYesBundle identifier of the app to capture logs for.
captureConsoleNoWhether to capture console output (requires app relaunch).
simulatorUuidYesUUID of the simulator to capture logs from (obtained from list_simulators).

Implementation Reference

  • The core handler function `start_sim_log_capLogic` that initiates log capture for the specified simulator and app using the `startLogCapture` utility.
    export async function start_sim_log_capLogic( params: StartSimLogCapParams, _executor: CommandExecutor = getDefaultCommandExecutor(), logCaptureFunction: typeof startLogCapture = startLogCapture, ): Promise<ToolResponse> { const captureConsole = params.captureConsole ?? false; const { sessionId, error } = await logCaptureFunction( { simulatorUuid: params.simulatorId, bundleId: params.bundleId, captureConsole, }, _executor, ); if (error) { return { content: [createTextContent(`Error starting log capture: ${error}`)], isError: true, }; } return { content: [ createTextContent( `Log capture started successfully. Session ID: ${sessionId}.\n\n${captureConsole ? 'Note: Your app was relaunched to capture console output.' : 'Note: Only structured logs are being captured.'}\n\nNext Steps:\n1. Interact with your simulator and app.\n2. Use 'stop_sim_log_cap' with session ID '${sessionId}' to stop capture and retrieve logs.`, ), ], }; }
  • Zod schema defining input parameters for the tool: simulatorId (UUID), bundleId, optional captureConsole.
    const startSimLogCapSchema = z.object({ simulatorId: z .string() .uuid() .describe('UUID of the simulator to capture logs from (obtained from list_simulators).'), bundleId: z.string().describe('Bundle identifier of the app to capture logs for.'), captureConsole: z .boolean() .optional() .describe('Whether to capture console output (requires app relaunch).'), });
  • Default export registering the tool with name, public schema (omitting simulatorId), description, and session-aware handler wrapping the logic function.
    export default { name: 'start_sim_log_cap', description: 'Starts capturing logs from a specified simulator. Returns a session ID. By default, captures only structured logs.', schema: publicSchemaObject.shape, // MCP SDK compatibility handler: createSessionAwareTool<StartSimLogCapParams>({ internalSchema: startSimLogCapSchema as unknown as z.ZodType<StartSimLogCapParams>, logicFunction: start_sim_log_capLogic, getExecutor: getDefaultCommandExecutor, requirements: [{ allOf: ['simulatorId'], message: 'simulatorId is required' }], }), };

Other Tools

Related 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/cameroncooke/XcodeBuildMCP'

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