Skip to main content
Glama

inspect_contam_project

Analyze CONTAM project files to provide structural summaries before editing or simulation runs, enabling informed airflow and contaminant transport modeling decisions.

Instructions

Use this when you want a quick structural summary of a CONTAM .prj file before editing or running it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYes

Implementation Reference

  • Tool registration and handler for "inspect_contam_project"
    server.tool(
      "inspect_contam_project",
      "Use this when you want a quick structural summary of a CONTAM .prj file before editing or running it.",
      {
        projectPath: z.string()
      },
      async ({ projectPath }) => {
        const resolvedProjectPath = asAbsolutePath(projectPath);
        if (!(await fileExists(resolvedProjectPath))) {
          throw new Error(`Project file not found: ${resolvedProjectPath}`);
        }
    
        const inspection = await inspectContamProject(resolvedProjectPath);
        return toolResponse("Parsed CONTAM project metadata.", inspection);
      }
    );
  • The main logic function for inspecting a CONTAM project, which reads the file and calls parsing logic.
    async function inspectContamProject(projectPath) {
      const lines = await readProjectLines(projectPath);
      return {
        projectPath,
        projectDirectory: path.dirname(projectPath),
        ...inspectContamProjectLines(lines)
      };
    }
  • Helper function that parses the contents (lines) of a project file.
    function inspectContamProjectLines(lines) {
      const references = {};
    
      for (const descriptor of projectReferenceDescriptors) {
        references[descriptor.key] = {
          value: null,
          comment: null,
          lineNumber: null
        };
      }
    
      for (let index = 0; index < lines.length; index += 1) {
        const line = lines[index];
        const { valuePart, commentPart } = splitCommentLine(line);
        const normalizedComment = commentPart.toLowerCase();
    
        for (const descriptor of projectReferenceDescriptors) {
          const expected = descriptor.commentLabel;
          if (
            normalizedComment === expected ||
            normalizedComment === `no ${expected}`
          ) {
            references[descriptor.key] = {
              value: valuePart && valuePart.toLowerCase() !== "null" ? valuePart : null,
              comment: commentPart,
              lineNumber: index + 1
            };
          }
        }
      }
    
      return {
        formatLine: lines[0]?.trim() || null,
        title: lines[1]?.trim() || null,
        totalLines: lines.length,
        references,
        dateRange: parseDateRange(lines),
        counts: {
          contaminants: parseSectionCount(lines, "contaminants"),
          species: parseSectionCount(lines, "species"),
          levels: parseSectionCount(lines, "levels plus icon data"),
          daySchedules: parseSectionCount(lines, "day-schedules"),
          weekSchedules: parseSectionCount(lines, "week-schedules"),
          windPressureProfiles: parseSectionCount(lines, "wind pressure profiles")
        },
        preview: lines.slice(0, 20)
      };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but only states it provides a 'quick structural summary.' It fails to specify return format, whether the operation is read-only (implied but not stated), potential errors, or what 'structural' encompasses (e.g., zones, flows, controls).

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?

Single, efficient sentence with no waste. It front-loads the usage context ('Use this when...') and immediately specifies both the action and target file type. Every word earns its place.

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

Completeness3/5

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

Given the tool's simplicity (single path parameter) and lack of output schema, the description adequately covers the basics but leaves gaps. It should specify what structural elements are summarized (e.g., building zones, airflow paths) and the output format since no output schema exists to document the return value.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, leaving the projectPath parameter undocumented in the schema. The description compensates by specifying the target is a 'CONTAM .prj file,' giving clear semantic meaning to the path parameter despite the lack of schema documentation.

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 action (structural summary) and resource (CONTAM .prj file). It effectively distinguishes this from siblings like run_contam_simulation and update_contam_project_references by positioning it as a preliminary inspection step.

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?

It provides explicit timing guidance ('before editing or running it'), implicitly directing users toward diagnose_contam_project for troubleshooting or run_contam_simulation for execution. However, it doesn't explicitly contrast with diagnose_contam_project or mention when to prefer those 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/summer521521/contam_MCP'

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