pyp6xer_get_activity_schema
Retrieve field names for Primavera P6 activities. Use these fields to limit activity queries to only the columns you need.
Instructions
Return the available field names for activity read tools.
Use the returned field names with the fields parameter of
pyp6xer_list_activities, pyp6xer_get_activity, and pyp6xer_search_activities
to limit response size to only the columns you need.
summary_fields are available on list_activities and search_activities. detail_fields are only available on get_activity (they require fetching relationships and resources which are not on the list view).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- server.py:299-318 (handler)The actual handler function for pyp6xer_get_activity_schema. It returns a JSON string with available field names (summary_fields and detail_fields) for activity read tools.
@mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False)) def pyp6xer_get_activity_schema() -> str: """Return the available field names for activity read tools. Use the returned field names with the `fields` parameter of pyp6xer_list_activities, pyp6xer_get_activity, and pyp6xer_search_activities to limit response size to only the columns you need. summary_fields are available on list_activities and search_activities. detail_fields are only available on get_activity (they require fetching relationships and resources which are not on the list view). """ return json.dumps({ "summary_fields": ACTIVITY_SUMMARY_FIELDS, "detail_fields": ACTIVITY_DETAIL_FIELDS, "note": ( "summary_fields: available on list_activities and search_activities. " "detail_fields: available on get_activity only." ), }, indent=2) - server.py:110-118 (helper)Defines ACTIVITY_SUMMARY_FIELDS, the list of field names returned by pyp6xer_get_activity_schema as 'summary_fields'. Available on list_activities and search_activities.
ACTIVITY_SUMMARY_FIELDS: list[str] = [ "task_id", "task_code", "name", "status", "type", "wbs", "wbs_name", "start", "finish", "target_start", "target_finish", "original_duration_days", "remaining_duration_days", "total_float_days", "free_float_days", "is_critical", "is_longest_path", "percent_complete", "budgeted_cost", "actual_cost", "remaining_cost", ] - server.py:121-126 (helper)Defines ACTIVITY_DETAIL_FIELDS, the list of field names returned by pyp6xer_get_activity_schema as 'detail_fields'. Includes summary fields plus additional fields only available on get_activity.
ACTIVITY_DETAIL_FIELDS: list[str] = ACTIVITY_SUMMARY_FIELDS + [ "actual_start", "actual_finish", "early_start", "early_finish", "late_start", "late_finish", "resources", "predecessors", "successors", ] - server.py:299-300 (registration)Decorator registering pyp6xer_get_activity_schema as an MCP tool via @mcp.tool(), marking it as readonly, non-destructive, idempotent, and open-world.
@mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False)) def pyp6xer_get_activity_schema() -> str: - server.py:299-318 (schema)The function itself returns the activity schema (field names) as a JSON string. It acts as both handler and schema definition by returning the list of available fields for other tools.
@mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False)) def pyp6xer_get_activity_schema() -> str: """Return the available field names for activity read tools. Use the returned field names with the `fields` parameter of pyp6xer_list_activities, pyp6xer_get_activity, and pyp6xer_search_activities to limit response size to only the columns you need. summary_fields are available on list_activities and search_activities. detail_fields are only available on get_activity (they require fetching relationships and resources which are not on the list view). """ return json.dumps({ "summary_fields": ACTIVITY_SUMMARY_FIELDS, "detail_fields": ACTIVITY_DETAIL_FIELDS, "note": ( "summary_fields: available on list_activities and search_activities. " "detail_fields: available on get_activity only." ), }, indent=2)