Skip to main content
Glama

ampl_eval

Execute AMPL statements in sequence, returning per-statement output and errors to help debug optimization models.

Instructions

Run AMPL statements in order, returning per-statement output and errors.

Model-mode set literals need braces: set S = {1,2,3}; and set S := {1,2,3}; both work. Omitting the braces, e.g. set S := 1 2 3;, is a syntax error in model mode. A failing statement stops the batch but never kills the session.

statements must be a non-empty list of strings that contains at least one actual statement: an empty list, or input that is only comments and whitespace, is reported as an argument_error rather than as a successful call over nothing.

A warnings list appears on the result when a statement loads a file (include, commands, model, data) or a shared library (load). Loading is permitted on purpose, but the loaded file's contents are executed WITHOUT being guard-checked - read the warning and tell the user rather than assuming the guard covered it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionNo
statementsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description fully carries the burden and does so thoroughly. It discloses failure semantics, empty-input handling, file-loading behavior, and the important safety caveat that loaded files are executed without guard-checking. This is exactly the kind of behavioral nuance an agent needs.

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 compact despite its length; every sentence provides necessary operational or safety information. It front-loads the core purpose, then layers in examples and caveats in a logical order without filler.

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?

Given the tool's complexity and lack of annotations, the description covers most critical contexts: execution order, error handling, input validation, and unsafe file loading. The only notable omission is how the `session` parameter is resolved (e.g., default vs. explicit), but the output schema likely mitigates some of this.

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?

The description gives substantial semantics for `statements`, including non-empty requirements and the argument_error for whitespace-only input, which goes beyond the schema. However, the optional `session` parameter is never mentioned, leaving a gap in parameter understanding for a tool with 0% schema description coverage.

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 opens with a specific verb and resource: 'Run AMPL statements in order, returning per-statement output and errors.' This clearly distinguishes ampl_eval from siblings like ampl_solve or ampl_display, which target narrower operations.

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 provides clear context for how to use the tool: statements run in order, failures stop the batch but preserve the session, and empty/comment-only input is an error. It does not explicitly name alternative tools or when not to use this one, but the behavioral context is strong enough for an agent to decide when it is appropriate.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/worc4021/ampl-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server