Skip to main content
Glama

ampl_init_session

Start an AMPL engine to enable optimization modeling. Call this first to initialize the session for subsequent AMPL operations.

Instructions

Start an AMPL engine. No engine exists until this is called.

workdir defaults to a per-session temporary directory; pass a path to work against a real project. Every path ARGUMENT to a tool is resolved inside it and an escape is refused - but this is not a sandbox: AMPL expression text is not path-guarded (ampl_display("1 > 'C:/elsewhere.txt'") writes outside it via AMPL's own redirection), and an include with an absolute path reads from outside it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo
solverNo
workdirNo

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 provided, the description carries full responsibility for disclosing behavior. It goes beyond expectations by explaining workdir defaults, path-resolution rules and escape refusal, and explicitly warns that the tool is not a sandbox with concrete examples of how AMPL expression text can write outside and include can read outside. This level of transparency is exemplary.

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 front-loaded with the core purpose ('Start an AMPL engine') followed by essential operational details. The lengthy caveat about path protection and sandboxing is justified given its security implications and is well-structured. Every sentence adds value, and there is no 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?

The description comprehensively covers purpose, workdir behavior, and critical security caveats, making it highly usable for initialization. However, it omits explanations of the name and solver parameters and does not discuss return values or error behavior (though an output schema exists). These gaps prevent a perfect completeness score.

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?

The input schema has 0% description coverage for its three parameters. The description only explains workdir (default behavior and path resolution) but says nothing about the name or solver parameters. Since the schema provides no semantics, the description needed to compensate for all parameters but only covers one, leaving the other two ambiguous.

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 'Start an AMPL engine,' a specific verb and resource, and clarifies that 'No engine exists until this is called.' This distinguishes it from sibling tools like ampl_use_session, ampl_restart_session, and ampl_close_session, making its purpose unmistakable.

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 clearly implies this is the initialization step before using any other AMPL tool ('No engine exists until this is called'). It also gives practical guidance on when to pass a workdir ('pass a path to work against a real project'). However, it does not explicitly name alternative tools or state when not to use this tool, so it does not fully reach the explicit-exclusion level.

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