Skip to main content

:::warning AUTO-GENERATED — do not edit This page is generated from the MCP server snapshot content/guide-mcp.json. Edit the source MCP server (not this file), then run npm run generate. :::

Trigger and poll a Dynamix simulation

When to use: The dashboard needs to run a parametric simulation and show results when it completes.

Prerequisites

  • Completed discover-api against dynamixApiV1.
  • You have a ConfigurationId and the UserInput parameter shape.

Steps

Step 1: Confirm the trigger/state/dataset endpoints and their contracts.

Tools: get_endpoint_details, validate_endpoint

Step 2: Create the service with a polling helper.

Step 3: Model the run as a TanStack Query/mutation with polling via refetchInterval.

Step 4: Run the quality gate.

Full recipe definition

The complete machine-readable recipe as returned by the MCP server:

{
"id": "wire-dynamix-simulation",
"title": "Trigger and poll a Dynamix simulation",
"when": "The dashboard needs to run a parametric simulation and show results when it completes.",
"prerequisites": [
"Completed `discover-api` against `dynamixApiV1`.",
"You have a ConfigurationId and the UserInput parameter shape."
],
"steps": [
{
"action": "Confirm the trigger/state/dataset endpoints and their contracts.",
"tools": [
"get_endpoint_details",
"validate_endpoint"
],
"note": "Typically POST /Trigger/start, GET /State/{id}, GET /Dataset. Verify each."
},
{
"action": "Create the service with a polling helper.",
"files": [
"src/lib/dynamix.ts",
"src/types/dynamix.ts"
],
"note": "Poll GET /State/{id} until status===100 (complete) or -1 (error). Respect a max-attempts cap and interval."
},
{
"action": "Model the run as a TanStack Query/mutation with polling via refetchInterval.",
"files": [
"src/routes/_authenticated/{feature}.tsx"
],
"note": "Stop polling on complete/error. Surface progress (0-99) to the user."
},
{
"action": "Run the quality gate.",
"note": "npm run verify"
}
],
"filesToCreate": [
"src/lib/dynamix.ts",
"src/types/dynamix.ts",
"src/routes/_authenticated/{feature}.tsx"
],
"validation": [
"`npm run verify` passes.",
"Polling terminates on completion/error and never loops forever."
],
"doneCriteria": [
"verify green",
"Status codes match the real State contract (-1 error, 100 complete)."
],
"commonMistakes": [
"Assuming status semantics instead of reading them from `get_endpoint_details`.",
"Unbounded polling with no max-attempts / error handling."
],
"relatedRecipes": [
"discover-api",
"run-verify-gate"
]
}