Skip to main content
Glama

export_contam_sim_text

Run CONTAM simulations automatically by providing pre-defined responses to interactive prompts, enabling batch processing of airflow and contaminant transport models.

Instructions

Use this when you need to run simread on a .sim file and you already know the response-script text needed for the interactive prompts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
simPathYes
responsesTextNo
responsesFilePathNo
timeoutSecondsNo

Implementation Reference

  • The tool `export_contam_sim_text` is defined and implemented here as an MCP tool using the `simread` executable. It handles the interactive nature of `simread` by accepting response text or a file path to feed via stdin.
    server.tool(
      "export_contam_sim_text",
      "Use this when you need to run simread on a .sim file and you already know the response-script text needed for the interactive prompts.",
      {
        simPath: z.string(),
        responsesText: z.string().optional(),
        responsesFilePath: z.string().optional(),
        timeoutSeconds: z.number().int().min(1).max(3600).optional()
      },
      async ({ simPath, responsesText, responsesFilePath, timeoutSeconds }) => {
        if (!responsesText && !responsesFilePath) {
          throw new Error("Provide either responsesText or responsesFilePath. simread is interactive, so MCP usage must supply a response script.");
        }
    
        const executablePath = await resolveExecutable("simread");
        const resolvedSimPath = asAbsolutePath(simPath);
    
        if (!(await fileExists(resolvedSimPath))) {
          throw new Error(`SIM file not found: ${resolvedSimPath}`);
        }
    
        const resolvedResponsesFilePath = responsesFilePath ? asAbsolutePath(responsesFilePath) : null;
        const inputText =
          responsesText ??
          normalizeText(await readFile(resolvedResponsesFilePath, { encoding: "utf8" })).concat("\n");
    
        const simDirectory = path.dirname(resolvedSimPath);
        const before = await snapshotDirectory(simDirectory);
        const result = await runProcess(executablePath, [resolvedSimPath], {
          cwd: simDirectory,
          timeoutSeconds: timeoutSeconds ?? DEFAULT_TIMEOUT_SECONDS,
          stdinText: inputText.endsWith("\n") ? inputText : `${inputText}\n`
        });
        const after = await snapshotDirectory(simDirectory);
    
        return toolResponse(
          result.ok ? "simread completed successfully." : "simread finished with errors or a non-zero exit code.",
          {
            executablePath,
            simPath: resolvedSimPath,
            responsesSource: resolvedResponsesFilePath ?? "inline responsesText",
            ...result,
            fileChanges: diffSnapshots(before, after)
          }
        );
      }
    );
Behavior3/5

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

With no annotations provided, the description carries full disclosure burden. It successfully reveals that the underlying tool involves 'interactive prompts' requiring scripted responses, but fails to mention side effects (file creation?), timeout behavior implications, or what output format to expect.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no redundant words. However, given the complete lack of schema documentation and annotations, the extreme brevity becomes a liability rather than a virtue, as critical information is omitted.

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

Completeness2/5

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

For a tool with 4 parameters, complex interactive behavior, and zero supporting documentation (no annotations, no output schema, 0% schema coverage), a one-sentence description is insufficient. It lacks parameter details, output specification, and error/timeout behavior explanation.

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?

Schema coverage is 0%, requiring the description to fully compensate. While it conceptually alludes to '.sim file' and 'response-script text' (mapping loosely to simPath and responsesText), it completely omits responsesFilePath and timeoutSeconds, and doesn't explicitly map concepts to parameter names or formats.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the core action (run simread on a .sim file) and the specific condition for use (having response-script text ready). However, it doesn't explicitly clarify what 'export' in the tool name refers to, leaving the exact output behavior slightly ambiguous.

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?

Provides explicit when-to-use guidance ('Use this when you need to run simread... and you already know the response-script text'). It implicitly distinguishes from siblings like run_contam_simulation by emphasizing the prerequisite of knowing the interactive prompt responses, though it doesn't explicitly name the alternative tool.

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/summer521521/contam_MCP'

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