Skip to main content
Glama

umlforge_state_machine

Read-only

Design a state machine for a domain entity's lifecycle to model workflows, approval chains, or subscription states, and identify missing states, invalid transitions, and race conditions.

Instructions

Design a state machine for a domain entity that has a lifecycle.

USE THIS WHEN:

  • An entity moves through states (Order: pending ? active ? cancelled)

  • You need to model a workflow, approval chain, or subscription lifecycle

  • You want to find missing states, invalid transitions, or race conditions

NOT FOR:

  • Flows between services (requests, responses) ? use umlforge_api_sequence

  • Async event messaging between services ? use umlforge_event_driven

  • Full codebase analysis ? use umlforge_reverse_engineer

Produces:

  • stateDiagram-v2: all states, entry/exit actions, guard conditions, composite states, explicit ERROR and TERMINAL states

  • State transition table: current state ? event ? guard ? next state ? action

  • Implementation notes: DB write requirements, domain events, race condition guards

  • (report_mode=True) Analysis Notes: transition risks, unreachable states, quick wins

Args: entity: The domain entity (e.g. "Order", "Subscription", "JobApplication"). states: Known lifecycle states (e.g. "pending, active, suspended, cancelled"). events: Triggers that cause transitions (e.g. "payment_received, user_cancels"). business_rules: Constraints on transitions (optional). report_mode: True ? also produce State Machine Analysis Notes. Pro/Team/Enterprise only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityYes
eventsYes
statesYes
report_modeNo
business_rulesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, openWorldHint=true, destructiveHint=false, so the safety profile is covered; the description adds value beyond that by disclosing the artifact set produced (stateDiagram-v2, transition table, implementation notes) and an access restriction — report_mode is Pro/Team/Enterprise only. It does not explain idempotency behavior despite idempotentHint=false, but it does not contradict it either.

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?

Content is front-loaded (one-line purpose, then routing, then outputs, then args) and every section is skimmable. It is on the long side for a five-parameter tool, and the output inventory is somewhat verbose given an output schema already exists, but no sentence is filler.

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

Completeness5/5

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

For a design-generation tool with zero schema descriptions and an available output schema, the description closes every gap an agent needs: what it produces, when to pick it over three named siblings, what each input means, and the tier gate on report_mode. Nothing required for correct invocation is missing.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden and does so: every one of the five parameters is annotated with intent and a concrete example, including the comma-separated format implied by "pending, active, suspended, cancelled". Optionality is marked ("business_rules: ... (optional)") and the gated report_mode is explained with its tier requirement.

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?

The opening line states a specific verb and artifact ("Design a state machine") scoped to "a domain entity that has a lifecycle," which immediately separates it from diagram generators for APIs, ERDs, or deployments. The separate NOT FOR block names the exact sibling tools to use instead, so the agent can discriminate without opening any schema.

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

Usage Guidelines5/5

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

Unusually complete routing guidance: USE THIS WHEN lists three concrete trigger conditions with a worked example (Order: pending → active → cancelled), plus the analytical goal (finding missing states, invalid transitions, race conditions). NOT FOR explicitly redirects three adjacent use cases to umlforge_api_sequence, umlforge_event_driven, and umlforge_reverse_engineer by name.

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