Skip to main content
Glama

collapsed_as_built

Collapsed As-Built / But-For analysis on a post-impact XER.

        Implements AACE RP 29R-03 §3.8 Modeled / Subtractive / Single
        Simulation method (paired with MIP 3.3 Windows for the dual-method
        gap report per SCL §11.5). Validates a forensic windows
        analysis (MIP 3.3) by independently computing the same
        project drift via subtractive removal of delays from the
        as-built schedule.

        For each delay event, the as-built duration of every
        ``affected_activity`` is shortened by ``impact_days`` working
        days on that activity's calendar (or removed entirely if
        ``removal_method="remove"``), then CPM re-runs and the
        resulting "but-for" finish date is compared to the as-built
        finish. Cumulative pass removes ALL events at once for a
        project-level but-for finish. Every finish shift is stated in
        working days on ``workday_calendar``; the calendar-day span of
        the same shift is kept beside it, and ``day_unit_basis`` names
        the unit of every bare ``*_days`` key in the result.

        Use this tool when opposing counsel demands a but-for analysis
        or you need a dual-method validation pairing §3.3 (windows) with
        §3.8 (collapsed-as-built). For prospective fragnet insertion
        (MIP 3.7), use ``time_impact_analysis_fragnet`` instead.

        Args:
            as_built_xer_path:    server-side post-impact XER (after delays incurred).
            as_built_xer_content: full text of post-impact XER (alternative for hosted/remote use).
                                  Supply EXACTLY ONE of path/content.
            delay_events: list of event dicts. Each must have
                ``event_id``, ``affected_activities`` (list of
                task_codes), and ``impact_days`` (number of working
                days on the affected activity's calendar). Optional:
                ``removal_method`` ('shorten'|'remove'),
                ``responsible_party``, ``name``, ``description``.
            output_dir: optional output dir for HTML/CSV (tempdir if "").
            project_name: optional override.
            removal_method: global default 'shorten' or 'remove'.
            contractor_filter: when True, exclude contractor-caused
                events from the cumulative pass (owner audit mode).
            preparer / company: optional, printed on the dashboard and
                narrative as who prepared the analysis. Both are blank
                unless supplied.

        Returns:
            {
              "as_built_finish": "YYYY-MM-DD",
              "per_event_results": [{event_id, but_for_finish,
                                      impact_workdays_collapsed,
                                      collapse_state,
                                      duration_removal_basis,
                                      finish_driver_after_removal, ...}, ...],
              # impact_workdays_collapsed is the event's finish shift in
              # working days on workday_calendar. Each event also carries
              # impact_days_collapsed: the same shift in calendar days.
              # duration_removal_basis discloses WHAT duration was removed
              # and on what basis; finish_driver_after_removal discloses
              # WHAT drives the but-for finish (incl. whether it is bound by
              # the data-date floor) so a reader sees WHY the finish did or
              # did not move across data dates.
              "cumulative_but_for_finish": "YYYY-MM-DD",
              "cumulative_impact_workdays": int,  # working days on workday_calendar
              "cumulative_impact_days": int,  # the same shift in calendar days
              "cumulative_collapse_state": str,  # a 'locked_by_actuals' zero is not "no impact"
              "workday_calendar": str,  # the calendar every working-day figure is stated on
              "day_unit_basis": dict,  # each bare *_days key: 'working_days' or 'calendar_days'
              "dual_method_gap": dict | None,  # working days only
              "output_files": {...},
              "warnings": [...],
              "method": "AACE 29R-03 §3.8 (Modeled/Subtractive/Single Simulation)"
            }
        

Input Schema

NameRequiredDescriptionDefault
companyNo
preparerNo
output_dirNo
delay_eventsNo
project_nameNo
removal_methodNoshorten
as_built_xer_pathNo
contractor_filterNo
as_built_xer_contentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / company
      Added value: +{
      +  "default": "",
      +  "title": "Company",
      +  "type": "string"
      +}
    • addedInput schema / properties / preparer
      Added value: +{
      +  "default": "",
      +  "title": "Preparer",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.7/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden, and it does substantial work: it discloses the mutation-like behavior (activity durations shortened by impact_days on that activity's calendar, or removed entirely), the cumulative pass semantics, contractor_filter's owner-audit behavior, and interpretability caveats ('locked_by_actuals' zero is not 'no impact'). Remaining gaps are operational rather than conceptual — it does not say what happens when a task_code in affected_activities is not found in the XER, nor whether the XER must be a validated/post-impact file, nor anything about runtime cost on large schedules.

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?

Well structured and front-loaded: purpose, then method framing, then usage/exclusions, then Args, then Returns. It is long, and the middle methodological paragraph partly restates the Returns annotations (working-days vs calendar-days explanation appears in both places), which is mild redundancy. Given the domain complexity, the length is largely earned rather than padding.

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?

There is no output schema, but the description supplies a detailed Returns block covering as_built_finish, per_event_results with the diagnostic keys, cumulative results, dual_method_gap, output_files, warnings, and method. It also documents the unit disambiguation (day_unit_basis, workday_calendar) that would otherwise be a common source of misinterpretation, which is exactly the gap a missing output schema would leave.

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

Parameters5/5

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

Schema description coverage is 0% and the schema itself is nearly bare (only titles and defaults), so the Args block is doing all the work — and it documents all nine parameters, including the nested delay_events dict keys (event_id, affected_activities, impact_days, removal_method, responsible_party, name, description). It adds genuinely non-inferable meaning: 'Supply EXACTLY ONE of path/content', impact_days being in working days on the affected activity's calendar, removal_method per-event vs the global default, and contractor_filter as an exclusion switch for cumulative results.

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?

States a specific technique and resource ('Collapsed As-Built / But-For analysis on a post-impact XER') tied to a named standard (AACE RP 29R-03 §3.8) and explains the mechanism in one sentence (subtractive removal, CPM re-run, but-for finish compared to as-built). It also names the sibling it is NOT ('For prospective fragnet insertion (MIP 3.7), use time_impact_analysis_fragnet instead'), so an agent can disambiguate without opening schemas.

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?

Explicit when-to-use ('when opposing counsel demands a but-for analysis or you need a dual-method validation pairing §3.3 (windows) with §3.8') and an explicit alternative with its selecting condition (fragnet insertion → time_impact_analysis_fragnet). It also specifies the paired-sibling relationship for the dual-method gap report, leaving little to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.