Skip to main content
Glama
flutter-devtools-mcp

flutter-devtools-mcp

by draganbajic

evaluate_expression

Run Dart expressions inside a running Flutter app to inspect runtime values, verify state, and perform diagnostics without restarting the app.

Instructions

Evaluate a Dart expression in the context of the running Flutter app. Useful for inspecting runtime values, checking state, or running diagnostics.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "expression": "<expression>"
    },
    "name": "evaluate_expression"
  }
}

Input Schema

NameRequiredDescriptionDefault
expressionYesThe Dart expression to evaluate (e.g., 'MediaQuery.of(context).size', 'MyClass.instance.someValue')

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden, and it only hints that the app must be running/connected. It says nothing about whether the expression can mutate app state, whether exceptions are returned as values or errors, or how arbitrary code evaluation is sandboxed — significant gaps for an eval tool.

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

Conciseness4/5

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

Two short sentences with the core action front-loaded and no filler. The usage sentence is a little list-like and generic, but nothing is redundant enough to cut.

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?

For a one-parameter tool this covers the essentials, and no output schema exists so return-value exposition isn't strictly required. However, prerequisites (connected running app) and failure behavior are left implicit, which matters because evaluation depends on live runtime state.

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

Parameters3/5

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

There is a single parameter and schema description coverage is 100%, with the schema itself supplying concrete example expressions. The description adds no syntax, scoping, or context-availability guidance beyond what the schema already documents, so baseline 3 applies.

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?

States a specific verb and resource ('Evaluate a Dart expression') plus the execution context ('in the context of the running Flutter app'), which is enough to separate it from inspection siblings like get_widget_tree or inspect_widget. It does not name any sibling to sharpen that distinction, so it stops short of a 5.

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

Usage Guidelines3/5

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

The second sentence gives implied use cases ('inspecting runtime values, checking state, or running diagnostics'), which is real but generic guidance. There is no statement of when to prefer this over inspect_widget/get_widget_tree for reading state, and no exclusions or preconditions.

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