Skip to main content
Glama

generate_model_code

Translates an approved mathematical formulation into structured PySCIPOpt Python code with model metadata, dependencies, assumptions, and objective sense.

Instructions

Translates an approved mathematical formulation into structured, executable PySCIPOpt Python code. Returns structured metadata (model_name, description, code, dependencies, assumptions, objective_sense).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
feedbackNo
formulationYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It states that the tool generates code and returns metadata, but does not disclose side effects, permission requirements, rate limits, error behavior, or whether the generated code is executed.

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?

The description is two sentences and front-loads the core action before listing return metadata. It is efficient, though the second sentence partly restates fields already present in the output schema.

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

Completeness3/5

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

With an output schema present, the description need not fully explain return values, and it does state the tool's role in the pipeline. However, it leaves the optional feedback parameter unexplained and provides no explicit routing guidance relative to sibling tools.

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

Parameters2/5

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

Schema description coverage is 0% and there are two parameters. The description implies that the 'formulation' parameter is an approved mathematical formulation, but it says nothing about the optional 'feedback' parameter or its expected format or effect.

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 verb and resource: translating an approved mathematical formulation into PySCIPOpt Python code. It clearly distinguishes this generation step from sibling tools like formulate_math_model and execute_model_code by focusing on code generation from an already-approved formulation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'approved mathematical formulation' implies a prerequisite and workflow position, but the description does not explicitly say when to use this tool versus alternatives such as formulate_math_model or review_model_code. Usage is only implied rather than clearly stated with exclusions.

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