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 }
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe how it behaves—such as whether it requires Flutter installation, returns structured data, or has any side effects. For a tool with zero annotation coverage, this leaves significant gaps in understanding its operational characteristics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that directly states the tool's function without any unnecessary words. It is front-loaded and efficiently communicates the essential information, making it perfectly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (zero parameters, no output schema, no annotations), the description is adequate but minimal. It covers the basic purpose but lacks details on behavior, output format, or integration context, which could be helpful for an agent to use it effectively in a broader workflow.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the schema description coverage is 100%, so no parameter documentation is needed. The description appropriately focuses on the tool's purpose without redundant parameter details, earning a high baseline score for this dimension.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('Flutter SDK version information'), making it immediately understandable. However, it doesn't differentiate itself from potential sibling tools like 'flutter_doctor' which might also provide version information, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'flutter_doctor' that might overlap in functionality, there's no indication of when this specific version check is preferred or what context warrants its use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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