Skip to main content
Glama
paulieb89

PyP6Xer MCP Server

pyp6xer_list_resources

Read-onlyIdempotent

List all resources for a project, showing assignment counts and cost/quantity totals from a loaded XER file.

Instructions

List all resources with assignment counts and cost/quantity totals.

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_list_resources tool handler function. Lists all resources with assignment counts and cost/quantity totals. Aggregates TASKRSRC entries by resource name, computes sums for quantities and costs, and returns sorted results.
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
    def pyp6xer_list_resources(
        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:
        """List all resources with assignment counts and cost/quantity totals.
    
        Args:
            cache_key: Cache key of the loaded file.
            proj_id:   Optional project filter (restricts to resources assigned in that project).
        """
        xer = _get_xer(ctx, cache_key)
    
        if proj_id:
            proj = _get_project(xer, proj_id)
            task_rsrcs = proj.resources
        else:
            task_rsrcs = list(xer.tasks.values())
            # flatten: all TASKRSRC across all tasks
            task_rsrcs = [tr for t in xer.tasks.values() for tr in t.resources.values()]
    
        # Aggregate by resource name
        rsrc_stats: dict = {}
        for tr in task_rsrcs:
            name = tr.resource.name
            if name not in rsrc_stats:
                rsrc_stats[name] = {
                    "name": name,
                    "rsrc_id": tr.resource.uid,
                    "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,
                }
            s = rsrc_stats[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
    
        resources = sorted(rsrc_stats.values(), key=lambda r: -r["assignments"])
        return json.dumps({"total": len(resources), "resources": resources}, indent=2)
  • server.py:636-636 (registration)
    Registration via @mcp.tool decorator on the pyp6xer_list_resources function, registered with annotations for read-only, idempotent, non-destructive behavior.
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true, so the safe, read-only nature is covered. The description adds that results include assignment counts and totals, which is extra behavioral context. However, it does not address potential performance implications or pagination, so it is adequate but not excellent.

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?

Single, concise sentence that is front-loaded with the core purpose. No unnecessary words or structure.

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, the description does not need to explain return values. The tool is simple with only two optional parameters, and the description covers the main purpose. However, it falls short of 5 because it omits any mention of sorting, filtering capabilities, or the typical expected number of resources.

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 for both parameters (cache_key and proj_id). The description does not add any additional meaning or context beyond what is already in the schema, so it meets the baseline but adds no extra value.

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 specifies the action (list), the resource (resources), and the included data (assignment counts and cost/quantity totals). It effectively distinguishes from sibling list tools like pyp6xer_list_activities and pyp6xer_list_projects by naming the specific resource type.

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 guidance on when to use this tool versus others, no prerequisites mentioned (though cache_key implies a prior file load), and no exclusion criteria. For a simple list tool, this is a clear gap.

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