Skip to main content
Glama
paulieb89

PyP6Xer MCP Server

pyp6xer_schedule_quality

Read-onlyIdempotent

Run DCMA-style schedule quality checks to identify missing predecessors, lags, leads, hard constraints, negative float, unassigned resources, and milestone issues.

Instructions

Run DCMA-style schedule quality checks.

Checks include:

  • Missing predecessors / successors (open ends)

  • Activities with lags or leads

  • Activities with hard constraints

  • Negative total float

  • Activities with no resources (optional warning)

  • Milestone checks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cache_keyNoCache key identifying the loaded XER file (set when calling pyp6xer_load_file)default
proj_idNoProject ID or short name; uses first project if omitted

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:822-827 (registration)
    Tool registration using @mcp.tool decorator with readOnlyHint=True annotation
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
    def pyp6xer_schedule_quality(
        cache_key: Annotated[str, Field(description="Cache key identifying the loaded XER file (set when calling pyp6xer_load_file)")] = "default",
        proj_id: Annotated[str | None, Field(description="Project ID or short name; uses first project if omitted")] = None,
        ctx: Context = None,
    ) -> str:
  • Implements DCMA-style schedule quality checks: open ends, lags/leads, hard constraints, negative float, resource gaps, and milestone checks with DCMA threshold pass/fail scoring
    def pyp6xer_schedule_quality(
        cache_key: Annotated[str, Field(description="Cache key identifying the loaded XER file (set when calling pyp6xer_load_file)")] = "default",
        proj_id: Annotated[str | None, Field(description="Project ID or short name; uses first project if omitted")] = None,
        ctx: Context = None,
    ) -> str:
        """Run DCMA-style schedule quality checks.
    
        Checks include:
        - Missing predecessors / successors (open ends)
        - Activities with lags or leads
        - Activities with hard constraints
        - Negative total float
        - Activities with no resources (optional warning)
        - Milestone checks
        """
        xer = _get_xer(ctx, cache_key)
        tasks = _get_tasks(xer, proj_id)
    
        # Exclude LOE, WBS summary, and completed
        workable = [
            t for t in tasks
            if not t.type.is_loe
            and not t.type.is_wbs
            and not t.status.is_completed
        ]
        n = len(workable)
        if n == 0:
            return json.dumps({"error": "No open activities to analyse."})
    
        no_pred = [t.task_code for t in workable if not t.predecessors]
        no_succ = [t.task_code for t in workable if not t.successors]
        with_lags = [
            t.task_code for t in workable
            if any(lnk.lag > 0 for lnk in t.predecessors)
        ]
        with_leads = [
            t.task_code for t in workable
            if any(lnk.lag < 0 for lnk in t.predecessors)
        ]
        constrained = [
            t.task_code for t in workable
            if t.cstr_type and t.cstr_type not in ("CS_ALAP", "CS_MSOA")
        ]
        neg_float = [t.task_code for t in workable if t.is_critical and t.total_float is not None and t.total_float < 0]
        no_resources = [t.task_code for t in workable if not t.resources and not t.type.is_milestone]
    
        def _pct(lst):
            return round(len(lst) / n * 100, 1)
    
        checks = {
            "activities_analysed": n,
            "missing_predecessors": {"count": len(no_pred), "pct": _pct(no_pred), "activities": no_pred[:20]},
            "missing_successors": {"count": len(no_succ), "pct": _pct(no_succ), "activities": no_succ[:20]},
            "activities_with_lags": {"count": len(with_lags), "pct": _pct(with_lags)},
            "activities_with_leads": {"count": len(with_leads), "pct": _pct(with_leads), "activities": with_leads[:20]},
            "hard_constraints": {"count": len(constrained), "pct": _pct(constrained), "activities": constrained[:20]},
            "negative_float": {"count": len(neg_float), "pct": _pct(neg_float), "activities": neg_float},
            "no_resources_assigned": {"count": len(no_resources), "pct": _pct(no_resources)},
        }
    
        # DCMA thresholds (pass if below)
        thresholds = {
            "missing_predecessors": 5.0,
            "missing_successors": 5.0,
            "activities_with_lags": 5.0,
            "activities_with_leads": 0.0,
            "hard_constraints": 5.0,
            "negative_float": 0.0,
        }
        flags = {
            k: ("FAIL" if checks[k]["pct"] > v else "PASS")
            for k, v in thresholds.items()
        }
        pass_count = sum(1 for v in flags.values() if v == "PASS")
        checks["dcma_results"] = flags
        checks["dcma_score"] = f"{pass_count}/{len(flags)}"
    
        return json.dumps(checks, indent=2)
Behavior4/5

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

Annotations declare readOnlyHint, destructiveHint, idempotentHint, openWorldHint. The description adds value by listing the specific DCMA checks performed, providing behavioral context beyond annotations. No contradictions.

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?

Concise single line plus bullet list. Front-loaded with purpose, every sentence earns its place.

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?

Given the tool complexity and presence of an output schema, the description covers the checks performed. It does not explain return format, but output schema likely covers that. It could differentiate from pyp6xer_schedule_health_check.

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?

Schema coverage is 100% with clear parameter descriptions. The description adds no further parameter detail, so baseline 3 is appropriate.

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 clearly states it runs DCMA-style schedule quality checks and lists specific checks. It effectively identifies the resource (schedule) and action (run quality checks), distinguishing it from siblings like pyp6xer_schedule_health_check.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives such as pyp6xer_schedule_health_check or pyp6xer_critical_path. It only implies usage for DCMA checks without prerequisites or exclusions.

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/paulieb89/pyp6xer-mcp'

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