flutter_doctor
Check Flutter development environment setup to identify and resolve configuration issues for mobile app development.
Instructions
Run Flutter doctor to check development environment setup
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/flutter.ts:241-279 (handler)The main handler function that executes the 'flutter doctor --machine' command, provides fallback to verbose output if machine-readable output fails, parses JSON output when successful, and returns a structured response with status, parsed output, issues, and exit code.handler: async () => { const result = await processExecutor.execute('flutter', ['doctor', '--machine']); if (result.exitCode !== 0) { // Try fallback without --machine flag const fallbackResult = await processExecutor.execute('flutter', ['doctor', '-v']); return { success: true, data: { status: 'completed_with_issues', machineOutput: null, humanOutput: fallbackResult.stdout, issues: fallbackResult.stderr, rawExitCode: result.exitCode, }, }; } // Parse machine output if available let parsedOutput = null; try { parsedOutput = JSON.parse(result.stdout); } catch { // If JSON parsing fails, provide raw output parsedOutput = null; } return { success: true, data: { status: 'completed', machineOutput: parsedOutput, rawOutput: result.stdout, issues: result.stderr, exitCode: result.exitCode, }, }; }
- src/tools/flutter.ts:233-280 (registration)Registration of the flutter_doctor tool in the createFlutterTools map. Includes the tool name, description, empty input schema (no parameters needed), and inline handler definition.tools.set('flutter_doctor', { name: 'flutter_doctor', description: 'Run Flutter doctor to check development environment setup', inputSchema: { type: 'object', properties: {}, required: [] }, handler: async () => { const result = await processExecutor.execute('flutter', ['doctor', '--machine']); if (result.exitCode !== 0) { // Try fallback without --machine flag const fallbackResult = await processExecutor.execute('flutter', ['doctor', '-v']); return { success: true, data: { status: 'completed_with_issues', machineOutput: null, humanOutput: fallbackResult.stdout, issues: fallbackResult.stderr, rawExitCode: result.exitCode, }, }; } // Parse machine output if available let parsedOutput = null; try { parsedOutput = JSON.parse(result.stdout); } catch { // If JSON parsing fails, provide raw output parsedOutput = null; } return { success: true, data: { status: 'completed', machineOutput: parsedOutput, rawOutput: result.stdout, issues: result.stderr, exitCode: result.exitCode, }, }; } });