Skip to main content
Glama
Nubville

storybook-events-inspector

by Nubville

Dispatch a synthetic event

dispatch_event

Fire a synthetic event at a Storybook story's rendered element to verify it responds as documented without a real UI trigger; the dispatch is also captured for inspection.

Instructions

The reverse direction: fire a synthetic event at the story's rendered custom element (found automatically, not necessarily the canvas's first child), to check it responds the way its docs claim — without a real UI trigger to click. The dispatch itself is also captured, same as anything else, so it shows up in the next get_events call too.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesEvent name, e.g. 'item-command'.
detailNoJSON detail payload for the event, if any.
bubblesNo
composedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose real behavior: the target element is found automatically (and may not be the canvas's first child), and the dispatched event is itself captured so it appears in the next get_events call. It omits what happens when no listener exists, whether errors are raised, and what the call returns.

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

Conciseness3/5

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

The key action is front-loaded, but the first sentence is a dense clause stack (parenthetical target-finding caveat, em-dash justification) that is harder to parse than necessary; the trailing sentence about capture is useful but could be tighter.

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 four-parameter mutation-like tool with no annotations and no output schema, the description covers the interesting element-resolution and event-capture behaviors but leaves parameter meanings, return values, and failure modes unaddressed, so an agent must infer several things before calling it.

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

Parameters2/5

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

Schema coverage is only 50%, and the description adds no meaning for any of the four parameters (name, detail, bubbles, composed). The 'bubbles' and 'composed' parameters have no schema descriptions at all, so they are effectively undocumented in both places.

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

Purpose5/5

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

States a specific verb (fire/dispatch) and resource (synthetic event at the story's rendered custom element), and explicitly frames it as 'the reverse direction' relative to the event-capturing siblings. An agent can distinguish it from click and get_events without opening a schema.

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?

Gives clear context for use: verifying that the element responds as its docs claim when there is no real UI trigger to click, which implicitly contrasts it with click. It does not state explicit exclusions or prerequisites, so it stops short of naming when-not to use it.

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