Skip to main content
Glama
flutter-devtools-mcp

flutter-devtools-mcp

by draganbajic

inspect_widget

Retrieves render details, constraints, size, and state for a specific Flutter widget by ID so you can diagnose layout and state issues from the widget tree.

Instructions

Get detailed information about a specific widget by its ID (obtained from get_widget_tree). Returns render details, constraints, size, and state.

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": {
      "widgetId": "<widgetId>"
    },
    "name": "inspect_widget"
  }
}

Input Schema

NameRequiredDescriptionDefault
widgetIdYesThe widget ID from the widget tree (valueId field)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are supplied, so the description must carry the behavioral burden. It enumerates what comes back (render details, constraints, size, state), which implies a safe read, but it never states that the call is non-mutating, what happens if the widget ID is stale after a rebuild or hot reload, or whether an error is raised for an unknown ID. Adequate but incomplete for a zero-annotation tool.

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?

Two short sentences with the purpose front-loaded and the provenance requirement trailing as a parenthetical. Every clause adds information; nothing is redundant.

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 and no annotations, so the description's short return-value summary (render details, constraints, size, state) is genuinely valuable. The main gap is failure behavior for invalid or stale widget IDs, which matters in a hot-reload environment. Otherwise it is sufficient for a one-parameter read tool.

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?

Schema coverage is 100% and the schema already documents widgetId as "the widget ID from the widget tree (valueId field)". The description adds only a pointer to the producing tool, which the schema partially duplicates. With one fully documented parameter, the schema does the heavy lifting and the baseline of 3 is correct.

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 ("Get detailed information about a specific widget by its ID") and names the sibling that produces the ID (get_widget_tree), so the agent can tell it apart from the tree-listing tool. It stops short of contrasting with other inspection tools like evaluate_expression or get_memory_snapshot, but the core purpose is unambiguous.

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

Usage Guidelines4/5

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

Provides a concrete prerequisite: the widgetId must come from get_widget_tree. That gives the agent a clear call-ordering rule. It does not say when to prefer this over other diagnostic tools or what to do if the ID is unknown, but the context is clear enough to act on.

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