Skip to main content
Glama

sim_refine

Destructive

Refine a model's parameter classes by editing what the model SAYS (tags on a place or transition, or assertedClasses), then re-derive. Returns a NEW model id (ids are content addresses, so the original stays reachable) plus a before/after class diff. tags can only split classes; assertedClasses declares a merge and gets re-verified and costed, never trusted blind. Read the sim://docs/classification resource once for why the two levers are not symmetric. Costs 2 tokens from your account's compute bucket (the stored model, 1, and the verified re-classification, 1).

Input Schema

NameRequiredDescriptionDefault
idYesmodel id to refine
gateNomonotone acceptance gate (default false): store the refinement only if the engine-computed defect weight strictly decreases; otherwise store nothing and return accepted:false with the before/after weights and the reason. Weight = dead transitions + unmarked siphons + unreachable goals + unverified asserted classes + lost conservation laws, all engine-computed (see sim://docs/classification). Weights and the regression-rate counters are reported whether or not the gate is on. A model already at weight 0 can never be improved, so a gated refine of one is always rejected.
tagsNoJSON object of place OR transition id -> {key: value}, e.g. {"nurse_avail":{"refine.shift":"night"}}. Keys not prefixed refine. are stored as metadata and refine nothing. classify.go's colour refinement seeds from both places' and transitions' tags, so either kind of id works here.
goalsNooptional JSON array of declared reachability goals, e.g. [{"to":{"done":1}}] (each may carry "from"); a goal sim_reach answers "no" to adds 1 to the defect weight, "unknown" adds nothing.
signerNooptional {"type":"eth"|"ed25519","address":"..."} — signs the lineage claim so it is the refiner's word rather than the server's account of a session
signatureNooptional hex signature over the CID of the signed claim; see modelstore.SignedClaim for the exact bytes. An unverifiable signature is refused, not stored with a flag.
assertedClassesNoJSON array, e.g. [{"id":"items","members":["item0","item1"],"note":"one stocking decision"}]

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / gate
      Added value: +{
      +  "description": "monotone acceptance gate (default false): store the refinement only if the engine-computed defect weight strictly decreases; otherwise store nothing and return accepted:false with the before/after weights and the reason. Weight = dead transitions + unmarked siphons + unreachable goals + unverified asserted classes + lost conservation laws, all engine-computed (see sim://docs/classification). Weights and the regression-rate counters are reported whether or not the gate is on. A model already at weight 0 can never be improved, so a gated refine of one is always rejected.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / goals
      Added value: +{
      +  "description": "optional JSON array of declared reachability goals, e.g. [{\"to\":{\"done\":1}}] (each may carry \"from\"); a goal sim_reach answers \"no\" to adds 1 to the defect weight, \"unknown\" adds nothing.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Adds substantial context beyond the annotations: the original model stays reachable because ids are content addresses, assertedClasses is re-verified rather than trusted, unverifiable signatures are refused, and the call costs 2 tokens from a named compute bucket. These are exactly the traits an agent needs and none of them are recoverable from the hint flags.

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?

Front-loaded with the action and return value, then the two levers and the cost. Four dense sentences with little waste, though the parenthetical cost breakdown and the docs pointer could be trimmed without losing meaning.

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

Completeness4/5

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

With no output schema, the description correctly carries the return-value burden by naming the new model id and the before/after diff, and it covers cost, the gate's rejection mode, and signature handling. It stops short of describing the diff's structure, but nothing critical for correct invocation is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds conceptual meaning the schema does not: the split-vs-merge semantics of tags versus assertedClasses and the fact that assertedClasses is re-verified and costed. The 'refine.' key prefix rule lives only in the schema, but the higher-level lever distinction is a genuine addition.

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?

States a specific verb and resource (refine a model's parameter classes) plus the exact mechanism (edit tags or assertedClasses, then re-derive) and the return shape (new model id + before/after class diff). This is clearly separable from siblings like sim_create_model or sim_classify.

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?

Explains which lever to use and why: 'tags can only split classes; assertedClasses declares a merge and gets re-verified and costed' and points to sim://docs/classification for the asymmetry. It does not explicitly say when to reach for this tool versus sim_create_model or sim_supersede_model, so it stops short of a full when/when-not routing statement.

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