Skip to main content
Glama
paulieb89

PyP6Xer MCP Server

pyp6xer_schedule_health_check

Read-onlyIdempotent

Calculates a composite schedule health score from 0 to 100 using data date currency, float distribution, critical path density, open ends, and constraint usage, with a narrative summary.

Instructions

Generate a composite schedule health score with narrative summary.

Combines data date currency, float distribution, critical path density, open ends, and constraint usage into a single 0–100 health score.

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

  • The actual handler implementation of the pyp6xer_schedule_health_check tool. It computes a composite 0-100 health score considering: data date currency (up to -20), open ends (up to -20), negative float (-15), hard constraints (-10), critical path density (-10), and schedule overrun (-15). Returns health_score, rating, issues, and recommendations.
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
    def pyp6xer_schedule_health_check(
        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:
        """Generate a composite schedule health score with narrative summary.
    
        Combines data date currency, float distribution, critical path density,
        open ends, and constraint usage into a single 0–100 health score.
        """
        xer = _get_xer(ctx, cache_key)
        proj = _get_project(xer, proj_id)
        tasks = proj.tasks if proj_id else list(xer.tasks.values())
    
        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)
        score = 100
        issues = []
    
        if n == 0:
            return json.dumps({"health_score": "N/A", "message": "No open activities found."})
    
        # 1. Data date currency (deduct up to 20 pts if data date is old)
        days_since_update = (datetime.now() - proj.data_date).days
        if days_since_update > 90:
            score -= 20
            issues.append(f"Data date is {days_since_update} days old (>90 days)")
        elif days_since_update > 30:
            score -= 10
            issues.append(f"Data date is {days_since_update} days old (>30 days)")
    
        # 2. Open ends
        no_pred_pct = sum(1 for t in workable if not t.predecessors) / n * 100
        no_succ_pct = sum(1 for t in workable if not t.successors) / n * 100
        open_end_pct = (no_pred_pct + no_succ_pct) / 2
        if open_end_pct > 10:
            score -= 20
            issues.append(f"{open_end_pct:.1f}% open ends (predecessors or successors missing)")
        elif open_end_pct > 5:
            score -= 10
            issues.append(f"{open_end_pct:.1f}% open ends")
    
        # 3. Negative float
        neg_float = [t for t in workable if t.total_float is not None and t.total_float < 0]
        if neg_float:
            score -= 15
            issues.append(f"{len(neg_float)} activities have negative float")
    
        # 4. Hard constraints
        constrained_pct = sum(
            1 for t in workable
            if t.cstr_type and t.cstr_type not in ("CS_ALAP", "CS_MSOA")
        ) / n * 100
        if constrained_pct > 10:
            score -= 10
            issues.append(f"{constrained_pct:.1f}% of activities have hard constraints")
    
        # 5. Critical path density
        critical_pct = sum(1 for t in workable if t.is_critical) / n * 100
        if critical_pct > 50:
            score -= 10
            issues.append(f"High critical path density: {critical_pct:.1f}%")
    
        # 6. Schedule overrun
        if proj.data_date > proj.finish_date:
            score -= 15
            issues.append("Scheduled finish date has already passed the data date")
    
        score = max(0, score)
        rating = (
            "Excellent" if score >= 85
            else "Good" if score >= 70
            else "Fair" if score >= 55
            else "Poor"
        )
    
        return json.dumps({
            "health_score": score,
            "rating": rating,
            "open_activities": n,
            "data_date": _fmt_date(proj.data_date),
            "finish_date": _fmt_date(proj.finish_date),
            "days_since_update": days_since_update,
            "issues_found": issues,
            "recommendations": issues if issues else ["Schedule appears healthy."],
        }, indent=2)
  • Input schema for pyp6xer_schedule_health_check defined via Pydantic Field annotations: cache_key (default 'default'), proj_id (optional), and ctx (Context).
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
    def pyp6xer_schedule_health_check(
        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:
  • server.py:903-908 (registration)
    Registration of the tool via @mcp.tool decorator with annotations readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False.
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
    def pyp6xer_schedule_health_check(
        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:
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true, which the description does not contradict. The description adds value by listing the specific metrics combined (float distribution, critical path density, etc.) and the score range (0–100), providing behavioral context beyond the annotations.

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 extremely concise, consisting of two short sentences. The first sentence states the primary purpose (generate composite health score with narrative), and the second lists components. No unnecessary words, and the purpose is front-loaded effectively.

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 presence of an output schema (has_output_schema: true) and comprehensive annotations, the description is largely complete. It explains the score range and components, and the parameters are documented in the schema. A minor gap is that it does not explicitly state that the tool requires a previously loaded file (implied by 'cache_key'), but this is acceptable.

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 description coverage is 100%, with both 'cache_key' and 'proj_id' described clearly in the schema. The description does not add any additional parameter meaning, but the baseline score is 3 due to high schema coverage. No further elaboration is needed.

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 states the tool generates a composite schedule health score with a narrative summary, and lists the components (data date currency, float distribution, etc.). It uses a specific verb ('generate') and resource ('schedule health score'), distinguishing it from siblings like pyp6xer_float_analysis or pyp6xer_schedule_quality by emphasizing the composite nature and narrative output.

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?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., a loaded XER file), nor does it compare with sibling tools like pyp6xer_schedule_quality or pyp6xer_float_analysis. An agent would need to infer usage context from the tool name and parameter hints.

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