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), validate it, and store it as a NEW model you own. The same generator the /api/code-to-flow endpoint uses; refused when this deployment has no LLM provider configured. Returns the new id when the answer validates, otherwise the raw model JSON and the validation errors so you can fix and sim_create_model it by hand.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYessource code to analyse
nameNoname for the derived model
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. First observed

TDQS

A4.5/5.0
Behavior5/5

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

The description goes well beyond the annotations by disclosing that it depends on a configured LLM, creates a new owned model, returns a new id on success, and returns raw model JSON plus validation errors on failure. It also gives a concrete remediation path. This meaningfully enriches the annotation hints without contradicting them.

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

Conciseness5/5

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

The description is three sentences, front-loaded with the core purpose, then covers the endpoint equivalence, refusal condition, and return/fallback behavior. Every sentence adds distinct value and there is no redundant or filler text.

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 tool with four parameters and no output schema, the description is remarkably complete: it explains success and failure return behavior, the LLM dependency, ownership of the new model, and how to recover manually. Nothing essential is missing for correct invocation.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all four parameters. The description adds no parameter-level detail beyond mentioning focus options, which are already listed in the schema, so the baseline score of 3 applies.

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 description states a specific action: derive a Petri-net model from source code, validate it, and store it as a new model the caller owns. It also distinguishes this from manual creation by mentioning the same generator as /api/code-to-flow and the fallback to sim_create_model.

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?

The description gives clear context: use this to generate a validated Petri-net model from source code with an LLM. It also tells the agent when it will fail (no LLM provider configured) and how to recover (fix the JSON and call sim_create_model), though it does not explicitly enumerate exclusions against other sibling tools.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources