Skip to main content
Glama

flutter_version

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

Instructions

Get Flutter SDK version information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'flutter_version' tool within the createFlutterTools function. Includes name, description, empty input schema (no parameters), and the complete handler logic that executes the Flutter version command with machine-readable output preference, JSON parsing, and human-readable fallbacks.
    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, }, }; } });
  • The core handler function implementing the flutter_version tool logic. Executes 'flutter --version --machine', handles non-zero exit codes with fallback to plain 'flutter --version', parses JSON output when available, and returns structured data with machineOutput, humanOutput, and status information.
    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 for flutter_version tool: empty object schema as the tool requires no input parameters.
    inputSchema: { type: 'object', properties: {}, required: [] },
  • Metadata registration for flutter_version in the global TOOL_REGISTRY, categorizing it as essential Flutter tool requiring FLUTTER, safe for testing with performance expectations.
    '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