Skip to main content
Glama
paulieb89

PyP6Xer MCP Server

pyp6xer_critical_path

Read-onlyIdempotent

Identify all critical path activities from Primavera P6 XER files, sorted by early start, with float, dates, and predecessor/successor counts.

Instructions

Return all activities on the critical path (total float ≤ 0 or longest path flag).

Activities are sorted by early start date. Includes float, dates, and predecessor/successor counts.

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 pyp6xer_critical_path tool function. It retrieves activities on the critical path (total float ≤ 0 or longest path flag), sorts by early start date, and returns them with predecessor/successor counts.
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
    def pyp6xer_critical_path(
        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:
        """Return all activities on the critical path (total float ≤ 0 or longest path flag).
    
        Activities are sorted by early start date. Includes float, dates, and
        predecessor/successor counts.
        """
        xer = _get_xer(ctx, cache_key)
        tasks = _get_tasks(xer, proj_id)
        critical = [t for t in tasks if t.is_critical or t.is_longest_path]
    
        def _sort_key(t):
            try:
                return t.start
            except Exception:
                return datetime.max
    
        critical.sort(key=_sort_key)
    
        result = []
        for t in critical:
            d = _task_to_dict(t)
            d["predecessor_count"] = len(t.predecessors)
            d["successor_count"] = len(t.successors)
            result.append(d)
    
        return json.dumps({
            "critical_count": len(result),
            "total_activities": len(tasks),
            "critical_pct": round(len(result) / len(tasks) * 100, 1) if tasks else 0,
            "activities": result,
        }, indent=2)
  • server.py:717-718 (registration)
    Registration of pyp6xer_critical_path as an MCP tool via the @mcp.tool decorator with readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False.
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
    def pyp6xer_critical_path(
  • Input parameters for the tool: cache_key (str, default 'default'), proj_id (optional str), and ctx (Context injected by FastMCP).
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
    def pyp6xer_critical_path(
        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 readOnly and idempotent. Description adds sorting by early start date and included fields (float, dates, predecessor/successor counts). No contradiction.

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?

Two concise sentences: first defines tool and criteria, second adds sorting and included fields. No extraneous content.

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?

With an output schema present, description adequately covers purpose, criteria, sorting, and fields. Complete for a read-only analysis tool.

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 descriptions for both parameters. Description adds no new parameter information beyond what's in the schema.

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?

Clearly states it returns activities on the critical path with explicit criteria (total float ≤ 0 or longest path flag). Distinguished from siblings like pyp6xer_float_analysis and pyp6xer_list_activities by its specific focus.

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. The name and description imply critical path analysis, but alternatives are not mentioned. Could be improved by suggesting pyp6xer_float_analysis for individual float values.

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