Skip to main content
Glama

sim_code_to_flow

Destructive

Derive a Petri-net model from source code with the configured LLM (control-flow, state-machine, resources or concurrency focus) and store it as a NEW model you own when it passes sim_create_model's decode and the model validator. Stored, it returns stored: true with id, url, name, usage and warnings (what sim_create_model would warn about the model, omitted when there is nothing to say). Otherwise nothing is stored, and it returns stored: false with the LLM's model JSON as model, usage, and either error — one string: the decode failure ("response is not a model: ...") or the unknown-field refusal worded as sim_create_model words it, each misspelt key by path with the key it most likely meant and the structural reasons after them — or errors, the validator's list (each with code, message and fix); fix the JSON and store it with sim_create_model. A reply with no JSON object in it, or a model the store's own validation still refuses, is a tool error naming why. Runs generator.CodeToFlow directly; this tool is its only surface on sim.pflow.xyz, which mounts no code-to-flow HTTP endpoint. Needs sign-in; refused when this deployment has no LLM provider configured.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYessource code to analyse
nameNoname for the derived model; the LLM is asked to use it, and it is filled in, before any check, when the model comes back without one
focusNocontrol-flow (default), state-machine, resources or concurrency
languageNosource language hint, e.g. go, python, javascript

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / name / description
      Previous value: -"name for the derived model"New value: +"name for the derived model; the LLM is asked to use it, and it is filled in, before any check, when the model comes back without one"
  2. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources