{
  "components": {
    "schemas": {
      "ToolError": {
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ToolResult": {
        "properties": {
          "content": {
            "items": {
              "properties": {
                "text": {
                  "type": "string"
                },
                "type": {
                  "enum": [
                    "text"
                  ],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "isError": {
            "type": "boolean"
          }
        },
        "type": "object"
      }
    }
  },
  "info": {
    "description": "Auto-generated OpenAPI spec from MCP tool definitions. These tools are available via the MCP protocol (JSON-RPC over Streamable HTTP at /mcp) or as individual REST endpoints at /mcp/tools/{name}.",
    "title": "petri-pilot MCP Tools API",
    "version": "1.0.0"
  },
  "openapi": "3.0.3",
  "paths": {
    "/mcp/tools/petri_analyze": {
      "post": {
        "operationId": "petri_analyze",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "full": {
                    "description": "Include sensitivity analysis (element importance, symmetry groups)",
                    "type": "boolean"
                  },
                  "model": {
                    "description": "The Petri net model as JSON or tokenmodel DSL (S-expression format starting with '(')",
                    "type": "string"
                  }
                },
                "required": [
                  "model"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Analyze a Petri net model for behavioral properties including reachability, deadlocks, liveness, boundedness, and element importance.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_application": {
      "post": {
        "operationId": "petri_application",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "backend": {
                    "description": "Backend language: go, javascript (default: go)",
                    "type": "string"
                  },
                  "database": {
                    "description": "Database: postgres, sqlite (default: sqlite)",
                    "type": "string"
                  },
                  "frontend": {
                    "description": "Frontend framework: esm (ES modules), none (default: esm)",
                    "type": "string"
                  },
                  "spec": {
                    "description": "Complete Application specification as JSON (with entities, roles, pages, workflows)",
                    "type": "string"
                  }
                },
                "required": [
                  "spec"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Generate a complete full-stack application from an Application specification. This accepts the high-level Application DSL with entities, roles, pages, and workflows.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_code_to_flow": {
      "post": {
        "operationId": "petri_code_to_flow",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "code": {
                    "description": "Source code to analyze and convert into a Petri net model",
                    "type": "string"
                  },
                  "focus": {
                    "description": "Analysis focus: control-flow (function call sequences), state-machine (state transitions), resources (resource allocation/consumption), concurrency (parallel processes, synchronization). Defaults to auto-detect.",
                    "type": "string"
                  },
                  "language": {
                    "description": "Programming language of the source code (e.g., go, python, javascript, java). Auto-detected if omitted.",
                    "type": "string"
                  },
                  "name": {
                    "description": "Name for the generated model. Defaults to a name derived from the code.",
                    "type": "string"
                  }
                },
                "required": [
                  "code"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Convert source code into a formal Petri net model. Analyzes code structure (control flow, state machines, resource management, concurrency) and produces an executable, verifiable Petri net — not just a diagram.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_codegen": {
      "post": {
        "operationId": "petri_codegen",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "extensions": {
                    "description": "Optional JSON object with extensions: {\"roles\":[...], \"views\":[...], \"admin\":{...}, \"navigation\":{...}}. These add authentication, views, and UI features to the generated code.",
                    "type": "string"
                  },
                  "language": {
                    "description": "Target language: go, javascript, python (default: go)",
                    "type": "string"
                  },
                  "model": {
                    "description": "The Petri net model as JSON or tokenmodel DSL (S-expression format starting with '(')",
                    "type": "string"
                  },
                  "package": {
                    "description": "Package/module name for generated code",
                    "type": "string"
                  }
                },
                "required": [
                  "model"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Generate executable code from a validated Petri net model. Produces event-sourced application code with state machine, events, and API handlers.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_diff": {
      "post": {
        "operationId": "petri_diff",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "model_a": {
                    "description": "First model as JSON (the 'before' or 'base' model)",
                    "type": "string"
                  },
                  "model_b": {
                    "description": "Second model as JSON (the 'after' or 'new' model)",
                    "type": "string"
                  }
                },
                "required": [
                  "model_a",
                  "model_b"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Compare two Petri net models and show structural differences. Reports added, removed, and modified places, transitions, arcs, roles, and access rules.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_docs": {
      "post": {
        "operationId": "petri_docs",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "include_metadata": {
                    "description": "Include model metadata in documentation (default: true)",
                    "type": "boolean"
                  },
                  "model": {
                    "description": "The Petri net model as JSON or tokenmodel DSL (S-expression format starting with '(')",
                    "type": "string"
                  }
                },
                "required": [
                  "model"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Generate markdown documentation from a Petri net model with mermaid diagrams for visualization. Useful for exploring and understanding models.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_extend": {
      "post": {
        "operationId": "petri_extend",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "model": {
                    "description": "The Petri net model as JSON",
                    "type": "string"
                  },
                  "operations": {
                    "description": "JSON array of operations. Each operation has 'op' (operation type) and operation-specific fields. Examples: {\"op\":\"add_place\",\"id\":\"new_state\"}, {\"op\":\"add_transition\",\"id\":\"transfer\",\"event\":\"transferred\",\"guard\":\"balances[from] \u003e= amount\",\"bindings\":[{\"name\":\"from\",\"type\":\"string\",\"keys\":[\"from\"]},{\"name\":\"amount\",\"type\":\"number\",\"value\":true}]}, {\"op\":\"add_arc\",\"from\":\"pending\",\"to\":\"approve\"}, {\"op\":\"add_event\",\"id\":\"transferred\",\"fields\":[{\"name\":\"from\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"number\"}]}, {\"op\":\"add_binding\",\"transition\":\"transfer\",\"name\":\"to\",\"type\":\"string\",\"keys\":[\"to\"]}",
                    "type": "string"
                  }
                },
                "required": [
                  "model",
                  "operations"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Modify an existing Petri net model by applying operations. Operations: add_place, add_transition, add_arc, add_event, add_event_field, add_binding, remove_place, remove_transition, remove_arc, remove_event, remove_binding. Returns the modified model.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_frontend": {
      "post": {
        "operationId": "petri_frontend",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "api_url": {
                    "description": "Backend API base URL (default: http://localhost:8080)",
                    "type": "string"
                  },
                  "extensions": {
                    "description": "Optional JSON object with extensions: {\"roles\":[...], \"views\":[...], \"admin\":{...}, \"navigation\":{...}}. These add authentication, views, and UI features to the generated frontend.",
                    "type": "string"
                  },
                  "model": {
                    "description": "The Petri net model as JSON or tokenmodel DSL (S-expression format starting with '(')",
                    "type": "string"
                  },
                  "project": {
                    "description": "Project name for package.json (default: model name)",
                    "type": "string"
                  }
                },
                "required": [
                  "model"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Generate a vanilla JavaScript ES modules frontend application from a Petri net model. Produces a Vite + ES modules project with API client, state display, and transition forms using plain JavaScript.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_heatmap": {
      "post": {
        "operationId": "petri_heatmap",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "cols": {
                    "description": "Grid columns (0/omit = auto-square)",
                    "type": "number"
                  },
                  "labels": {
                    "description": "Show place IDs and values in each cell (default true)",
                    "type": "boolean"
                  },
                  "marking": {
                    "description": "Optional JSON object {place_id: value} overriding the initial marking",
                    "type": "string"
                  },
                  "model": {
                    "description": "Petri net model JSON or tokenmodel DSL",
                    "type": "string"
                  },
                  "rows": {
                    "description": "Grid rows (0/omit = auto-square)",
                    "type": "number"
                  },
                  "title": {
                    "description": "Optional title shown above the heatmap",
                    "type": "string"
                  }
                },
                "required": [
                  "model"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Render the model's marking as a 2D colored grid heatmap (viridis colormap). Useful for high-place models (TTT boards, zk-ode topologies, grid-structured nets). Each cell shows place ID + value. Returns inline PNG.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_migrate": {
      "post": {
        "operationId": "petri_migrate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "model": {
                    "description": "The v1 Petri net model as a JSON string",
                    "type": "string"
                  }
                },
                "required": [
                  "model"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Migrate a Petri net model from v1 (flat) to v2 (nested) schema format. V2 format separates the net definition from extensions like roles and views.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_ode": {
      "post": {
        "operationId": "petri_ode",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "layout": {
                    "description": "Output layout: 'plot' (default, trajectory only), 'combined' (net snapshot at final marking + plot side-by-side), or 'net' (net snapshot only, no plot)",
                    "type": "string"
                  },
                  "method": {
                    "description": "'tsit5' (default), 'rk45', 'rk4', or 'euler'",
                    "type": "string"
                  },
                  "mode": {
                    "description": "'solve' (full trajectory, default) or 'equilibrium' (stop at steady state)",
                    "type": "string"
                  },
                  "model": {
                    "description": "Petri net model JSON or tokenmodel DSL",
                    "type": "string"
                  },
                  "plot": {
                    "description": "Include inline PNG plot (default true). Ignored when layout is set.",
                    "type": "boolean"
                  },
                  "rates": {
                    "description": "Optional JSON object mapping transition_id to rate (default 1.0 for each transition)",
                    "type": "string"
                  },
                  "samples": {
                    "description": "Max trajectory samples returned (default 200, downsampled if needed)",
                    "type": "number"
                  },
                  "tspan": {
                    "description": "Optional JSON array [t0, tf] (default [0, 10])",
                    "type": "string"
                  },
                  "variables": {
                    "description": "Optional JSON array of place IDs to plot (default: all places)",
                    "type": "string"
                  }
                },
                "required": [
                  "model"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Run an ODE (mass-action kinetics) simulation of the Petri net using the Tsit5 solver (matches pflow.xyz). Returns a downsampled time series of place concentrations and an inline PNG plot. Use mode=equilibrium to integrate until the system stabilizes.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_ode_sensitivity": {
      "post": {
        "operationId": "petri_ode_sensitivity",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "base_rates": {
                    "description": "JSON object of base rates per transition (default 1.0)",
                    "type": "string"
                  },
                  "delta": {
                    "description": "Perturbation fraction (default 0.05 = 5%)",
                    "type": "number"
                  },
                  "model": {
                    "description": "Petri net model JSON or tokenmodel DSL",
                    "type": "string"
                  },
                  "observable": {
                    "description": "Place ID whose equilibrium value is the target metric",
                    "type": "string"
                  },
                  "title": {
                    "description": "Title shown above the sensitivity diagram",
                    "type": "string"
                  },
                  "tspan": {
                    "description": "Per-run integration span (default [0, 50])",
                    "type": "string"
                  }
                },
                "required": [
                  "model",
                  "observable"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "ODE sensitivity analysis: perturb each transition's rate by a small delta and measure how much an observable's equilibrium value moves. Returns dimensionless elasticities per transition plus an inline net diagram tinted by influence. Use when you want to know which knobs matter for dynamics, not just structure.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_ode_sweep": {
      "post": {
        "operationId": "petri_ode_sweep",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "fixed_rates": {
                    "description": "JSON object of other transition rates (default 1.0)",
                    "type": "string"
                  },
                  "model": {
                    "description": "Petri net model JSON or tokenmodel DSL",
                    "type": "string"
                  },
                  "observable": {
                    "description": "Place ID whose trajectory is shown (one observable per call to keep the plot readable)",
                    "type": "string"
                  },
                  "range": {
                    "description": "JSON array [start, stop, n] generating n equally-spaced rates. Alternative to values",
                    "type": "string"
                  },
                  "samples": {
                    "description": "Max samples per trajectory after downsampling (default 200)",
                    "type": "number"
                  },
                  "transition": {
                    "description": "Transition ID whose rate is being swept",
                    "type": "string"
                  },
                  "tspan": {
                    "description": "Integration span (default [0, 10])",
                    "type": "string"
                  },
                  "values": {
                    "description": "JSON array of rate values to sweep. Alternative to range",
                    "type": "string"
                  }
                },
                "required": [
                  "model",
                  "transition",
                  "observable"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Run multiple ODE trajectories at different rates and overlay them on one plot. Useful for seeing how dynamics change with a parameter — regime shifts, peak shifts, time-to-equilibrium. Each rate value gets its own viridis-colored line.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_preview": {
      "post": {
        "operationId": "petri_preview",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "file": {
                    "description": "Template name to preview (e.g., 'api', 'workflow', 'events', 'aggregate', 'main')",
                    "type": "string"
                  },
                  "model": {
                    "description": "The Petri net model as JSON",
                    "type": "string"
                  }
                },
                "required": [
                  "model",
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Preview a single generated file without full code generation. Use this to check specific files before committing to full generation. Available templates: main, workflow, events, aggregate, api, openapi, test, config, migrations, auth, middleware, permissions, views, navigation, admin, debug",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_rate_scan": {
      "post": {
        "operationId": "petri_rate_scan",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "fixed_rates": {
                    "description": "JSON object of other transition rates held constant during the sweep (default 1.0 for unspecified)",
                    "type": "string"
                  },
                  "model": {
                    "description": "Petri net model JSON or tokenmodel DSL",
                    "type": "string"
                  },
                  "observables": {
                    "description": "JSON array of place IDs to track at equilibrium (default: all places)",
                    "type": "string"
                  },
                  "plot": {
                    "description": "Include inline PNG plot (default true)",
                    "type": "boolean"
                  },
                  "range": {
                    "description": "JSON array [start, stop, n] generating n equally-spaced rate values from start to stop. Alternative to 'values'",
                    "type": "string"
                  },
                  "transition": {
                    "description": "Transition ID whose rate is being swept",
                    "type": "string"
                  },
                  "tspan": {
                    "description": "Per-run integration span (default [0, 50]). Must be long enough for the system to settle at each rate",
                    "type": "string"
                  },
                  "values": {
                    "description": "JSON array of rate values to test (e.g. [0.1, 0.5, 1.0, 2.0, 5.0]). Either this or 'range' is required",
                    "type": "string"
                  }
                },
                "required": [
                  "model",
                  "transition"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Parameter sweep: vary one transition's mass-action rate over a list of values, run each to equilibrium, plot observables (steady-state place concentrations) vs the swept rate. Returns JSON of all results plus an inline PNG.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_simulate": {
      "post": {
        "operationId": "petri_simulate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "model": {
                    "description": "The Petri net model as JSON",
                    "type": "string"
                  },
                  "steps": {
                    "description": "JSON array of simulation steps with optional bindings: [{\"transition\":\"id\",\"bindings\":{...}}]. For simple cases, you can also use 'transitions' parameter.",
                    "type": "string"
                  },
                  "transitions": {
                    "description": "JSON array of transition IDs to fire in order (simple alternative to 'steps')",
                    "type": "string"
                  }
                },
                "required": [
                  "model"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Simulate firing transitions and see state changes. Returns detailed step-by-step state trace. Use this to verify workflow behavior before code generation.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_validate": {
      "post": {
        "operationId": "petri_validate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "model": {
                    "description": "The Petri net model as JSON or tokenmodel DSL (S-expression format starting with '(')",
                    "type": "string"
                  }
                },
                "required": [
                  "model"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Validate a Petri net model for structural correctness. Checks for empty models, unconnected elements, and invalid arc references.",
        "tags": [
          "petri"
        ]
      }
    },
    "/mcp/tools/petri_visualize": {
      "post": {
        "operationId": "petri_visualize",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "marking": {
                    "description": "Optional JSON object {place_id: value} overriding the initial marking. Used as both label values and (with shade=marking) fill saturation",
                    "type": "string"
                  },
                  "model": {
                    "description": "The Petri net model as JSON or tokenmodel DSL (S-expression format starting with '(')",
                    "type": "string"
                  },
                  "shade": {
                    "description": "'none' (default), 'sensitivity' (color by analyzer importance), or 'marking' (color places by marking values)",
                    "type": "string"
                  },
                  "title": {
                    "description": "Optional title shown above the diagram",
                    "type": "string"
                  }
                },
                "required": [
                  "model"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolResult"
                }
              }
            },
            "description": "Tool result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            },
            "description": "Invalid parameters"
          }
        },
        "summary": "Generate an SVG visualization of a Petri net model showing places, transitions, and arcs. Returns both SVG text and an inline PNG. Supports shading: 'sensitivity' (run analyzer and tint by element importance) or 'marking' (color places by user-supplied values).",
        "tags": [
          "petri"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "Production",
      "url": "https://pilot.pflow.xyz"
    },
    {
      "description": "Development",
      "url": "http://localhost:8083"
    }
  ]
}