Skip to main content
Glama
paulieb89

PyP6Xer MCP Server

pyp6xer_resource_utilization

Read-onlyIdempotent

Summarize resource loading by comparing planned, actual, and remaining quantities and costs for project resources.

Instructions

Summarise resource loading: planned vs actual vs remaining quantities and costs.

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
rsrc_nameNoFilter by resource name (partial match)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The pyp6xer_resource_utilization tool handler function. Aggregates resource loading data (planned vs actual vs remaining quantities and costs) from the XER file, optionally filtered by project ID and resource name. Returns utilization percentages and cost summaries.
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
    def pyp6xer_resource_utilization(
        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,
        rsrc_name: Annotated[str | None, Field(description="Filter by resource name (partial match)")] = None,
        ctx: Context = None,
    ) -> str:
        """Summarise resource loading: planned vs actual vs remaining quantities and costs.
    
        Args:
            cache_key:  Cache key of the loaded file.
            proj_id:    Optional project filter.
            rsrc_name:  Filter to a specific resource name (substring match).
        """
        xer = _get_xer(ctx, cache_key)
        if proj_id:
            task_rsrcs = _get_project(xer, proj_id).resources
        else:
            task_rsrcs = [tr for t in xer.tasks.values() for tr in t.resources.values()]
    
        # Aggregate by resource
        by_rsrc: dict = {}
        for tr in task_rsrcs:
            name = tr.resource.name
            if rsrc_name and rsrc_name.lower() not in name.lower():
                continue
            if name not in by_rsrc:
                by_rsrc[name] = {
                    "resource": name,
                    "type": tr.resource.type,
                    "assignments": 0,
                    "target_qty": 0.0,
                    "actual_qty": 0.0,
                    "remain_qty": 0.0,
                    "target_cost": 0.0,
                    "actual_cost": 0.0,
                    "remain_cost": 0.0,
                    "at_completion_cost": 0.0,
                }
            s = by_rsrc[name]
            s["assignments"] += 1
            s["target_qty"] += tr.target_qty
            s["actual_qty"] += tr.act_reg_qty + tr.act_ot_qty
            s["remain_qty"] += tr.remain_qty
            s["target_cost"] += tr.target_cost
            s["actual_cost"] += tr.act_total_cost
            s["remain_cost"] += tr.remain_cost
            s["at_completion_cost"] += tr.act_total_cost + tr.remain_cost
    
        for s in by_rsrc.values():
            s["utilization_pct"] = (
                round(s["actual_qty"] / s["target_qty"] * 100, 1)
                if s["target_qty"] else None
            )
    
        items = sorted(by_rsrc.values(), key=lambda x: -x["target_cost"])
        return json.dumps({"total_resources": len(items), "resources": items}, indent=2)
  • server.py:1140-1146 (registration)
    Registration of pyp6xer_resource_utilization as an MCP tool via the @mcp.tool decorator with annotations for read-only, non-destructive, idempotent behavior.
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
    def pyp6xer_resource_utilization(
        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,
        rsrc_name: Annotated[str | None, Field(description="Filter by resource name (partial match)")] = None,
        ctx: Context = None,
    ) -> str:
Behavior4/5

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

Annotations already declare readOnlyHint, destructiveHint false, and idempotentHint true. The description adds value by specifying the output summarizes planned vs actual vs remaining quantities and costs, which goes 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?

A single, well-structured sentence conveys the tool's purpose without any wasted words. It is front-loaded with the key action and resource.

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 and moderate complexity, the description is largely complete. It could optionally mention aggregation behavior but is sufficient for an AI agent to understand the tool's purpose.

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%, so each parameter has clear meaning in the schema. The description does not add extra context beyond the schema, warranting the baseline score.

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 summarizes resource loading with planned vs actual vs remaining quantities and costs. It uses a specific verb ('summarise') and resource ('resource loading'), distinguishing it from sibling tools like pyp6xer_earned_value or pyp6xer_list_resources.

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?

The description implies it is used for resource loading analysis but does not explicitly state when to use it over alternatives like pyp6xer_earned_value or pyp6xer_progress_summary. No exclusions or contextual guidance are provided.

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