Skip to main content
Glama
paulieb89

PyP6Xer MCP Server

pyp6xer_list_calendars

Read-onlyIdempotent

Retrieve all calendars from a loaded P6 XER file, including name, type (global/project/resource), hours per day/week/year, and project default status.

Instructions

List all calendars defined in the XER file.

Returns calendar name, type (global/project/resource), hours per day/week/year, and whether it is the project default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cache_keyNoCache key identifying the loaded XER file (set when calling pyp6xer_load_file)default

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:688-689 (registration)
    The tool 'pyp6xer_list_calendars' is registered as an MCP tool via the @mcp.tool decorator on line 688.
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
    def pyp6xer_list_calendars(
  • The handler function for pyp6xer_list_calendars that lists all calendars from the XER file, returning calendar name, type, hours per day/week/year, and whether it's the project default.
    def pyp6xer_list_calendars(
        cache_key: Annotated[str, Field(description="Cache key identifying the loaded XER file (set when calling pyp6xer_load_file)")] = "default",
        ctx: Context = None,
    ) -> str:
        """List all calendars defined in the XER file.
    
        Returns calendar name, type (global/project/resource), hours per day/week/year,
        and whether it is the project default.
        """
        xer = _get_xer(ctx, cache_key)
        cals = []
        for cal in xer.calendars.values():
            cals.append({
                "clndr_id": cal.uid,
                "name": cal.name,
                "type": cal.type.name if hasattr(cal, "type") else "",
                "is_default": getattr(cal, "is_default", False),
                "day_hr_cnt": getattr(cal, "day_hr_cnt", 8),
                "week_hr_cnt": getattr(cal, "week_hr_cnt", 40),
                "year_hr_cnt": getattr(cal, "year_hr_cnt", 2080),
            })
        return json.dumps({"total": len(cals), "calendars": cals}, indent=2)
  • Input/output schema is defined via function signature and decorator annotations. Takes a cache_key string parameter (default 'default') and returns a JSON string with total calendar count and calendar details.
    @mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False))
    def pyp6xer_list_calendars(
        cache_key: Annotated[str, Field(description="Cache key identifying the loaded XER file (set when calling pyp6xer_load_file)")] = "default",
        ctx: Context = None,
    ) -> str:
        """List all calendars defined in the XER file.
    
        Returns calendar name, type (global/project/resource), hours per day/week/year,
        and whether it is the project default.
        """
        xer = _get_xer(ctx, cache_key)
        cals = []
        for cal in xer.calendars.values():
            cals.append({
                "clndr_id": cal.uid,
                "name": cal.name,
                "type": cal.type.name if hasattr(cal, "type") else "",
                "is_default": getattr(cal, "is_default", False),
                "day_hr_cnt": getattr(cal, "day_hr_cnt", 8),
                "week_hr_cnt": getattr(cal, "week_hr_cnt", 40),
                "year_hr_cnt": getattr(cal, "year_hr_cnt", 2080),
            })
        return json.dumps({"total": len(cals), "calendars": cals}, indent=2)
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true; description adds value by listing exact return fields (name, type, hours, default). No contradiction, and extra context provided.

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 sentences, front-loaded with action and resource, no redundant information. Each sentence earns its place.

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 output schema exists, the description sufficiently covers return values. Could mention requirement to call pyp6xer_load_file first, but cache_key implies it. Slightly incomplete but still good.

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% for cache_key, with description and default provided. The tool description adds no further detail about the parameter, so baseline 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?

States clearly 'List all calendars' (verb+resource) and distinguishes from siblings like pyp6xer_list_projects. Specifies return fields (name, type, hours, default), making purpose unambiguous.

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?

Implies usage after loading a file (via cache_key), but does not explicitly state when to use or avoid it, nor mention alternatives among sibling list tools. Adequate but not explicit.

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