Skip to main content
Glama
flutter-devtools-mcp

flutter-devtools-mcp

by draganbajic

get_widget_tree

Retrieves the running Flutter app's current widget tree as structured data, helping you inspect on-screen widgets and identify project-specific components.

Instructions

Get the current widget tree of the running Flutter app. Returns a structured representation of all widgets on screen. Widgets marked with ★ are from your project code (not framework widgets).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_widget_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
maxDepthNoMaximum depth of the widget tree to return (default: 15)
projectOnlyNoIf true, only show widgets created by the project (skip framework internals)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.7/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. It usefully discloses the return shape ('structured representation of all widgets on screen') and the ★ marker convention for project widgets, but says nothing about whether a live connection/session is required, how large the output can get, or the cost of a deep tree.

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?

Three short sentences, front-loaded with what the tool returns and followed by the one non-obvious convention (★). Nothing is redundant or padded.

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

Completeness4/5

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

There is no output schema, so the description must sketch the return value, and it does so adequately along with the ★ marker. The only meaningful gap is the unstated prerequisite of a connected/running app session, which matters for a tool that reads live state.

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?

Schema coverage is 100%, so both maxDepth and projectOnly are fully documented with defaults and bounds, establishing a baseline of 3. The description adds the ★ project-code convention, which gives the agent semantic grounding for the projectOnly flag beyond the schema's mechanical wording.

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 gives a specific verb and resource ('Get the current widget tree') and scopes it to 'the running Flutter app', which is enough for an agent to recognize a hierarchy-snapshot read. It stops short of contrasting with the sibling inspect_widget, so the agent must infer that this returns the whole tree rather than a single widget.

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?

Usage is only implied: the agent can infer it should call this when it needs an overview of the on-screen hierarchy, and the ★ convention hints at how to separate project code from framework noise. There is no explicit when-to-use, when-not, or pointer to alternatives such as inspect_widget for a single node.

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