flutter_doctor
Check Flutter development environment setup to identify configuration issues and ensure proper tool installation for mobile app development.
Instructions
Run Flutter doctor to check development environment setup
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/flutter.ts:241-279 (handler)The handler function executes 'flutter doctor --machine', falls back to verbose output if machine-readable fails, parses JSON output, and returns structured diagnostic information including issues and status.
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:236-240 (schema)JSON Schema for input validation. flutter_doctor requires no parameters (empty object).
inputSchema: { type: 'object', properties: {}, required: [] }, - src/tools/flutter.ts:233-280 (registration)Registers the flutter_doctor tool in the Map returned by createFlutterTools function, including name, description, schema, and handler.
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, }, }; } });