Skip to main content
Glama

flutter_version

Retrieve Flutter SDK version details to verify compatibility and manage development environments for mobile app projects.

Instructions

Get Flutter SDK version information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that runs 'flutter --version --machine', attempts to parse JSON output, and provides fallbacks to human-readable output if machine parsing fails or command errors.
    handler: async () => { const result = await processExecutor.execute('flutter', ['--version', '--machine']); if (result.exitCode !== 0) { // Try fallback without --machine flag const fallbackResult = await processExecutor.execute('flutter', ['--version']); return { success: true, data: { machineOutput: null, humanOutput: fallbackResult.stdout, rawExitCode: result.exitCode, }, }; } // Parse machine output if available let parsedOutput = null; try { parsedOutput = JSON.parse(result.stdout); } catch { // Fallback to human readable const humanResult = await processExecutor.execute('flutter', ['--version']); return { success: true, data: { machineOutput: null, humanOutput: humanResult.stdout, rawExitCode: result.exitCode, }, }; } return { success: true, data: { machineOutput: parsedOutput, rawOutput: result.stdout, exitCode: result.exitCode, }, }; }
  • Input schema defining no required parameters for the tool.
    inputSchema: { type: 'object', properties: {}, required: [] },
  • Registration of the flutter_version tool within the createFlutterTools function, including name, description, schema, and handler.
    tools.set('flutter_version', { name: 'flutter_version', description: 'Get Flutter SDK version information', inputSchema: { type: 'object', properties: {}, required: [] }, handler: async () => { const result = await processExecutor.execute('flutter', ['--version', '--machine']); if (result.exitCode !== 0) { // Try fallback without --machine flag const fallbackResult = await processExecutor.execute('flutter', ['--version']); return { success: true, data: { machineOutput: null, humanOutput: fallbackResult.stdout, rawExitCode: result.exitCode, }, }; } // Parse machine output if available let parsedOutput = null; try { parsedOutput = JSON.parse(result.stdout); } catch { // Fallback to human readable const humanResult = await processExecutor.execute('flutter', ['--version']); return { success: true, data: { machineOutput: null, humanOutput: humanResult.stdout, rawExitCode: result.exitCode, }, }; } return { success: true, data: { machineOutput: parsedOutput, rawOutput: result.stdout, exitCode: result.exitCode, }, }; } });
  • Metadata registration in TOOL_REGISTRY defining category, platform, requirements, and performance expectations for the tool.
    'flutter_version': { name: 'flutter_version', category: ToolCategory.ESSENTIAL, platform: 'flutter', requiredTools: [RequiredTool.FLUTTER], description: 'Get Flutter SDK version information', safeForTesting: true, performance: { expectedDuration: 200, timeout: 10000 } },

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/cristianoaredes/mcp-mobile-server'

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