Skip to main content
Glama
paulieb89

PyP6Xer MCP Server

pyp6xer_float_analysis

Read-onlyIdempotent

Analyze total float distribution across schedule activities, grouping them into float buckets and identifying near-critical activities to assess schedule risk.

Instructions

Analyse total float distribution across activities.

Groups activities into float buckets and flags near-critical activities.

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
max_float_daysNoUpper bound for float display in days

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the pyp6xer_float_analysis tool. It retrieves the XER schedule from cache, filters to non-completed/non-LOE/non-WBS tasks with float data, buckets them by total float ranges (negative, zero, 0-5, 5-15, 15-30, over_30), and returns distribution stats including min/max/avg float.
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
    def pyp6xer_float_analysis(
        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,
        max_float_days: Annotated[int, Field(description="Upper bound for float display in days", ge=0)] = 30,
        ctx: Context = None,
    ) -> str:
        """Analyse total float distribution across activities.
    
        Groups activities into float buckets and flags near-critical activities.
    
        Args:
            cache_key:      Cache key of the loaded file.
            proj_id:        Optional project filter.
            max_float_days: Upper bound for detailed buckets (default 30).
        """
        xer = _get_xer(ctx, cache_key)
        tasks = _get_tasks(xer, proj_id)
    
        # Only non-completed, non-LOE tasks
        relevant = [
            t for t in tasks
            if not t.status.is_completed
            and not t.type.is_loe
            and not t.type.is_wbs
            and t.total_float is not None
        ]
    
        buckets = {
            "negative": [],
            "zero": [],
            "0_to_5": [],
            "5_to_15": [],
            "15_to_30": [],
            "over_30": [],
        }
    
        for t in relevant:
            f = t.total_float
            if f < 0:
                buckets["negative"].append(t.task_code)
            elif f == 0:
                buckets["zero"].append(t.task_code)
            elif f <= 5:
                buckets["0_to_5"].append(t.task_code)
            elif f <= 15:
                buckets["5_to_15"].append(t.task_code)
            elif f <= max_float_days:
                buckets["15_to_30"].append(t.task_code)
            else:
                buckets["over_30"].append(t.task_code)
    
        floats = [t.total_float for t in relevant]
        return json.dumps({
            "analyzed_activities": len(relevant),
            "total_activities": len(tasks),
            "distribution": {k: len(v) for k, v in buckets.items()},
            "negative_float_activities": buckets["negative"],
            "zero_float_activities": buckets["zero"][:50],  # cap for readability
            "stats": {
                "min_float_days": min(floats) if floats else None,
                "max_float_days": max(floats) if floats else None,
                "avg_float_days": round(sum(floats) / len(floats), 1) if floats else None,
            },
        }, indent=2)
  • server.py:755-761 (registration)
    Tool registration via the @mcp.tool decorator from FastMCP. The annotations mark it as read-only, non-destructive, idempotent, and not open-world.
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
    def pyp6xer_float_analysis(
        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,
        max_float_days: Annotated[int, Field(description="Upper bound for float display in days", ge=0)] = 30,
        ctx: Context = None,
    ) -> str:
  • Input schema/parameters: cache_key (str, default 'default'), proj_id (optional str), max_float_days (int, default 30, min 0), and ctx (FastMCP Context). Output type is str (JSON).
    def pyp6xer_float_analysis(
        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,
        max_float_days: Annotated[int, Field(description="Upper bound for float display in days", ge=0)] = 30,
        ctx: Context = None,
    ) -> str:
Behavior4/5

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

Annotations already indicate read-only and idempotent behavior. The description adds context about grouping into float buckets and flagging near-critical activities, which are not covered by annotations. No contradiction with 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 two concise sentences. The first sentence states the primary purpose, and the second adds key details. No superfluous information.

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 that the tool has an output schema (not shown) and annotations, the description provides sufficient context for an agent to understand the tool's function. Some detail about float bucket ranges might be useful, but overall it is complete enough.

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?

Input schema has 100% description coverage, so the schema documents parameters adequately. The description does not add meaning beyond the schema for parameters like cache_key or max_float_days, so a baseline score of 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?

Description clearly states the tool analyzes total float distribution, groups into buckets, and flags near-critical activities. This specifies the verb (analyse) and resource (float distribution), and distinguishes from siblings like critical_path and 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 Guidelines3/5

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

No explicit when-to-use or when-not-to-use guidance is provided. Usage is implied by the description, but alternatives such as critical_path or schedule_health_check are not mentioned, leaving the agent to infer context.

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