Skip to main content
Glama

ampl_read_files

Load AMPL model, data, and run files from the session directory, blocking hidden shell commands. Get warnings when loaded files include unchecked sub-files.

Instructions

Load .mod/.dat/.run files by path, resolved inside the session workdir.

Each file's contents are guard-checked exactly like a statement passed to ampl_eval before AMPL is asked to load it: a shell statement hidden inside a .run/.mod/.dat file is refused, not silently executed, subject to the same AMPL_MCP_ALLOW_SHELL escape hatch.

That check stops at the file it is given. If the file itself loads another file (include, commands, model, data) or a shared library (load), AMPL executes THAT file's contents unchecked - a shell there will run. Such statements are permitted deliberately and reported in a top-level warnings list; read it and tell the user.

On a load failure, message is a human-readable string and the full per-statement record is under detail.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
runNo
dataNo
modelNo
sessionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/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 discloses critical security behavior: direct file contents are guard-checked, but nested includes/libraries execute unchecked and are reported in a 'warnings' list, plus it details failure return structure with 'message' and 'detail'. This is exceptional transparency that goes well beyond a typical tool description.

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 dense but every sentence earns its place: it starts with the primary purpose, then layers essential security caveats and failure reporting behavior. There is no filler, repetition, or ambiguity, and the structure front-loads the most important information.

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

Completeness5/5

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

Given the tool's high-complexity security profile, the description is self-sufficient: it covers file resolution, guard-checking, nested-file execution risk, warnings, and error detail. It also aligns with the output schema by referencing 'warnings', 'message', and 'detail', so explicit return-value documentation is unnecessary.

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 input schema has 0% description coverage, so the description must compensate for parameter meaning. It maps .mod/.dat/.run to file types, which partially clarifies model/data/run parameters, but it does not explain the 'session' parameter or individual parameter semantics. The parameter names are self-evident, but the description does not fully fill the schema coverage gap.

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: 'Load .mod/.dat/.run files by path, resolved inside the session workdir.' It also distinguishes itself from sibling ampl_eval by noting files are guard-checked 'exactly like a statement passed to ampl_eval,' making clear this tool is for file loading rather than inline evaluation.

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 establishes the tool's use case: loading files by path within a session workdir, with explicit file types (.mod/.dat/.run). It does not explicitly name alternative tools or give when-not-to-use conditions, but the context is sufficient to differentiate from inline evaluation and other session management tools.

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