Skip to main content
Glama

ampl_option

Fetch or update an AMPL option's value. Prevents silent failures by raising an error if the option name is not recognized, ensuring typos do not create unintended options.

Instructions

Get an AMPL option, or set it when value is given.

An option name AMPL does not have is an argument_error, on both the get and the set: AMPL creates an option on first assignment, so a typo like ampl_option("solvre", "cbc") would otherwise report success while creating an inert option and leaving the real solver untouched. The one exception is the <solver>_options directive convention (highs_options, gurobi_options, ...), which by design does not exist until you create it.

value must be a string when given.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
valueNo
sessionNo

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 carries the full burden and excels: it discloses that unknown option names produce an argument_error on both get and set, explains the rationale (AMPL creates options on first assignment), and notes the <solver>_options exception. It also states the value parameter must be a string when provided.

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 moderately sized but every sentence earns its place: the main function, error behavior, exception, and value constraint are all essential. It is well-structured and free of redundant wording.

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?

The description covers the core functionality, error handling, and value type, and the output schema handles return values. However, the unexplained `session` parameter is a completeness gap, preventing a perfect score.

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 adds meaning for `name` (errors for unknown options) and `value` (must be a string), but the `session` parameter is not mentioned at all. With 0% schema description coverage, this leaves a significant gap, so it only partially compensates for the lack of parameter documentation.

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 clearly states the tool's dual function: 'Get an AMPL option, or set it when `value` is given.' This specifies both the verb (get/set) and the resource (AMPL option), distinguishing it from sibling tools like ampl_eval or ampl_display.

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 implies the tool is for reading or modifying AMPL options, with clear context about error behavior and the special <solver>_options exception. However, it does not explicitly name alternatives or state when not to use this tool, so it falls short of a 5.

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