Skip to main content
Glama

ampl_set_data

Assign a parameter from JSON in AMPL models, bypassing hand-written .dat syntax. Set scalar, indexed, or multi-dimensional values directly.

Instructions

Assign a parameter from JSON, avoiding hand-written .dat syntax.

values may be a scalar, a mapping of index to value, or a list of [index..., value] records for multi-dimensional entities. The parameter must already be declared. This tool handles parameters only; to declare or assign a set, use ampl_eval with a statement such as set S = {1,2,3};.

name must be a bare AMPL entity name; it is interpolated into an AMPL statement, so anything else is an argument_error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
valuesYes
sessionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Since no annotations are provided, the description carries the full burden. It discloses input format flexibility (scalar, mapping, list), the declaration requirement, and potential error condition (non-bare name triggers argument_error). It doesn't mention side effects or return details, but the output schema likely covers return values. Overall, strong disclosure for a mutation tool.

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 efficiently structured with a clear one-sentence purpose, followed by specific details on values, scope limitation, and error behavior. Every sentence adds value, and the use of code examples aids clarity without unnecessary length.

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?

For a tool with no annotations, the description covers the key contextual aspects: accepted value shapes, prerequisite (parameter must exist), scope (parameters only), and error semantics. It also references ampl_eval for sets, which helps integration. The omission of session behavior is minor given sibling tools, and the output schema handles return values. Overall, quite complete for its complexity.

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 0%, so the description must compensate. It richly explains `values` (scalar/mapping/list of records) and `name` (bare entity name, interpolated into AMPL). However, the `session` parameter is not explained at all, leaving a gap in parameter understanding. The description adds meaning beyond the schema for two of three parameters, but incomplete coverage keeps it at a 3.

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 assigns a parameter from JSON, avoiding hand-written .dat syntax. It specifies the verb (assign), resource (parameter), and input format, and distinguishes itself from ampl_eval (which handles sets). This is a specific and differentiated purpose.

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

Usage Guidelines5/5

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

The description explicitly says this tool handles parameters only, and instructs to use ampl_eval for sets with a concrete example. It also states that the parameter must already be declared, providing a clear prerequisite. This gives explicit when-to-use and when-not-to-use guidance with alternatives.

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