Files
xer-mcp/specs/001-schedule-tools/contracts/mcp-tools.json
Bill Ballou a7b6b76db8 feat: add milestone_type field to distinguish start/finish milestones
Add milestone_type field to milestone queries that indicates whether
a milestone is a start milestone ('start') or finish milestone ('finish').

Changes:
- Add milestone_type column to activities table schema
- Parse milestone_type from XER TASK table (MS_Start/MS_Finish)
- Include milestone_type in list_milestones response
- Update contract tests for milestone_type field
- Update specs, contracts, and documentation

The milestone_type is determined by:
1. Explicit milestone_type field in XER (MS_Start -> 'start', MS_Finish -> 'finish')
2. Derived from task_type (TT_Mile -> 'start', TT_FinMile -> 'finish')
2026-01-08 12:18:34 -05:00

375 lines
11 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "XER MCP Server Tools",
"description": "MCP tool definitions for Primavera P6 XER file analysis",
"version": "0.1.0",
"tools": [
{
"name": "load_xer",
"description": "Load a Primavera P6 XER file and parse its schedule data. For multi-project files, specify project_id to select a project.",
"inputSchema": {
"type": "object",
"properties": {
"file_path": {
"type": "string",
"description": "Absolute path to the XER file"
},
"project_id": {
"type": "string",
"description": "Project ID to select (required for multi-project files)"
}
},
"required": ["file_path"]
},
"outputSchema": {
"type": "object",
"properties": {
"success": { "type": "boolean" },
"project": {
"type": "object",
"properties": {
"proj_id": { "type": "string" },
"proj_short_name": { "type": "string" },
"plan_start_date": { "type": "string", "format": "date-time" },
"plan_end_date": { "type": "string", "format": "date-time" }
}
},
"activity_count": { "type": "integer" },
"relationship_count": { "type": "integer" },
"available_projects": {
"type": "array",
"items": {
"type": "object",
"properties": {
"proj_id": { "type": "string" },
"proj_short_name": { "type": "string" }
}
},
"description": "Only present for multi-project files without selection"
},
"warnings": {
"type": "array",
"items": { "type": "string" }
}
}
}
},
{
"name": "list_activities",
"description": "List activities from the loaded XER file with optional filtering and pagination.",
"inputSchema": {
"type": "object",
"properties": {
"start_date": {
"type": "string",
"format": "date",
"description": "Filter activities starting on or after this date (YYYY-MM-DD)"
},
"end_date": {
"type": "string",
"format": "date",
"description": "Filter activities ending on or before this date (YYYY-MM-DD)"
},
"wbs_id": {
"type": "string",
"description": "Filter by WBS element ID"
},
"activity_type": {
"type": "string",
"enum": ["TT_Task", "TT_Mile", "TT_LOE", "TT_WBS", "TT_Rsrc"],
"description": "Filter by activity type"
},
"limit": {
"type": "integer",
"default": 100,
"minimum": 1,
"maximum": 1000,
"description": "Maximum number of activities to return"
},
"offset": {
"type": "integer",
"default": 0,
"minimum": 0,
"description": "Number of activities to skip"
}
}
},
"outputSchema": {
"type": "object",
"properties": {
"activities": {
"type": "array",
"items": {
"$ref": "#/$defs/ActivitySummary"
}
},
"pagination": { "$ref": "#/$defs/Pagination" }
}
}
},
{
"name": "get_activity",
"description": "Get detailed information for a specific activity by ID.",
"inputSchema": {
"type": "object",
"properties": {
"activity_id": {
"type": "string",
"description": "The task_id of the activity"
}
},
"required": ["activity_id"]
},
"outputSchema": {
"$ref": "#/$defs/ActivityDetail"
}
},
{
"name": "list_relationships",
"description": "List all relationships (dependencies) with pagination.",
"inputSchema": {
"type": "object",
"properties": {
"limit": {
"type": "integer",
"default": 100,
"minimum": 1,
"maximum": 1000
},
"offset": {
"type": "integer",
"default": 0,
"minimum": 0
}
}
},
"outputSchema": {
"type": "object",
"properties": {
"relationships": {
"type": "array",
"items": { "$ref": "#/$defs/Relationship" }
},
"pagination": { "$ref": "#/$defs/Pagination" }
}
}
},
{
"name": "get_predecessors",
"description": "Get all predecessor activities for a given activity.",
"inputSchema": {
"type": "object",
"properties": {
"activity_id": {
"type": "string",
"description": "The task_id of the activity"
}
},
"required": ["activity_id"]
},
"outputSchema": {
"type": "object",
"properties": {
"activity_id": { "type": "string" },
"predecessors": {
"type": "array",
"items": { "$ref": "#/$defs/RelatedActivity" }
}
}
}
},
{
"name": "get_successors",
"description": "Get all successor activities for a given activity.",
"inputSchema": {
"type": "object",
"properties": {
"activity_id": {
"type": "string",
"description": "The task_id of the activity"
}
},
"required": ["activity_id"]
},
"outputSchema": {
"type": "object",
"properties": {
"activity_id": { "type": "string" },
"successors": {
"type": "array",
"items": { "$ref": "#/$defs/RelatedActivity" }
}
}
}
},
{
"name": "get_project_summary",
"description": "Get high-level summary of the loaded project.",
"inputSchema": {
"type": "object",
"properties": {}
},
"outputSchema": {
"type": "object",
"properties": {
"project": {
"type": "object",
"properties": {
"proj_id": { "type": "string" },
"proj_short_name": { "type": "string" },
"plan_start_date": { "type": "string", "format": "date-time" },
"plan_end_date": { "type": "string", "format": "date-time" }
}
},
"activity_count": { "type": "integer" },
"milestone_count": { "type": "integer" },
"relationship_count": { "type": "integer" },
"wbs_element_count": { "type": "integer" },
"critical_activity_count": { "type": "integer" }
}
}
},
{
"name": "list_milestones",
"description": "List all milestone activities with pagination.",
"inputSchema": {
"type": "object",
"properties": {
"limit": {
"type": "integer",
"default": 100,
"minimum": 1,
"maximum": 1000
},
"offset": {
"type": "integer",
"default": 0,
"minimum": 0
}
}
},
"outputSchema": {
"type": "object",
"properties": {
"milestones": {
"type": "array",
"items": { "$ref": "#/$defs/ActivitySummary" }
},
"pagination": { "$ref": "#/$defs/Pagination" }
}
}
},
{
"name": "get_critical_path",
"description": "Get activities on the critical path (using P6's stored critical flags).",
"inputSchema": {
"type": "object",
"properties": {
"limit": {
"type": "integer",
"default": 100,
"minimum": 1,
"maximum": 1000
},
"offset": {
"type": "integer",
"default": 0,
"minimum": 0
}
}
},
"outputSchema": {
"type": "object",
"properties": {
"critical_activities": {
"type": "array",
"items": { "$ref": "#/$defs/ActivitySummary" }
},
"pagination": { "$ref": "#/$defs/Pagination" }
}
}
}
],
"$defs": {
"ActivitySummary": {
"type": "object",
"properties": {
"task_id": { "type": "string" },
"task_code": { "type": "string" },
"task_name": { "type": "string" },
"task_type": { "type": "string" },
"target_start_date": { "type": "string", "format": "date-time" },
"target_end_date": { "type": "string", "format": "date-time" },
"status_code": { "type": "string" },
"driving_path_flag": { "type": "boolean" },
"milestone_type": { "type": "string", "enum": ["start", "finish", null], "description": "Type of milestone: 'start' for start milestones, 'finish' for finish milestones, null for non-milestones" }
}
},
"ActivityDetail": {
"type": "object",
"properties": {
"task_id": { "type": "string" },
"task_code": { "type": "string" },
"task_name": { "type": "string" },
"task_type": { "type": "string" },
"wbs_id": { "type": "string" },
"wbs_name": { "type": "string" },
"target_start_date": { "type": "string", "format": "date-time" },
"target_end_date": { "type": "string", "format": "date-time" },
"act_start_date": { "type": "string", "format": "date-time" },
"act_end_date": { "type": "string", "format": "date-time" },
"total_float_hr_cnt": { "type": "number" },
"status_code": { "type": "string" },
"driving_path_flag": { "type": "boolean" },
"predecessor_count": { "type": "integer" },
"successor_count": { "type": "integer" }
}
},
"Relationship": {
"type": "object",
"properties": {
"task_pred_id": { "type": "string" },
"task_id": { "type": "string" },
"task_name": { "type": "string" },
"pred_task_id": { "type": "string" },
"pred_task_name": { "type": "string" },
"pred_type": {
"type": "string",
"enum": ["FS", "SS", "FF", "SF"]
},
"lag_hr_cnt": { "type": "number" },
"driving": {
"type": "boolean",
"description": "True if this relationship drives the successor's early start date"
}
}
},
"RelatedActivity": {
"type": "object",
"properties": {
"task_id": { "type": "string" },
"task_code": { "type": "string" },
"task_name": { "type": "string" },
"relationship_type": {
"type": "string",
"enum": ["FS", "SS", "FF", "SF"]
},
"lag_hr_cnt": { "type": "number" },
"driving": {
"type": "boolean",
"description": "True if this relationship drives the successor's early start date"
}
}
},
"Pagination": {
"type": "object",
"properties": {
"total_count": { "type": "integer" },
"offset": { "type": "integer" },
"limit": { "type": "integer" },
"has_more": { "type": "boolean" }
}
}
}
}