|
| 1 | +# API Documentation |
| 2 | + |
| 3 | +Complete reference for WindRiver Studio MCP Server resources and tools. |
| 4 | + |
| 5 | +## Resources |
| 6 | + |
| 7 | +Resources provide read-only access to Studio data through the MCP protocol. |
| 8 | + |
| 9 | +### Resource URI Structure |
| 10 | + |
| 11 | +``` |
| 12 | +studio:// |
| 13 | +├── plm/ # Pipeline Management |
| 14 | +│ ├── pipelines/ # Pipeline listings |
| 15 | +│ │ ├── {pipeline-id}/info # Pipeline details |
| 16 | +│ │ ├── {pipeline-id}/tasks/ # Pipeline tasks |
| 17 | +│ │ └── {pipeline-id}/history # Execution history |
| 18 | +│ ├── projects/ # PLM projects |
| 19 | +│ └── templates/ # Pipeline templates |
| 20 | +├── config/ # Server configuration |
| 21 | +└── status # Server health status |
| 22 | +``` |
| 23 | + |
| 24 | +### Pipeline Resources |
| 25 | + |
| 26 | +#### List Pipelines |
| 27 | +**URI**: `studio://plm/pipelines` |
| 28 | + |
| 29 | +Returns all accessible pipelines with basic information. |
| 30 | + |
| 31 | +**Response Format**: |
| 32 | +```json |
| 33 | +{ |
| 34 | + "pipelines": [ |
| 35 | + { |
| 36 | + "id": "pipeline-123", |
| 37 | + "name": "My Pipeline", |
| 38 | + "project": "MyProject", |
| 39 | + "status": "idle|running|completed|failed", |
| 40 | + "created": "2024-01-15T10:30:00Z", |
| 41 | + "last_run": "2024-01-20T14:22:00Z" |
| 42 | + } |
| 43 | + ] |
| 44 | +} |
| 45 | +``` |
| 46 | + |
| 47 | +#### Pipeline Details |
| 48 | +**URI**: `studio://plm/pipelines/{pipeline-id}/info` |
| 49 | + |
| 50 | +Detailed information about a specific pipeline. |
| 51 | + |
| 52 | +**Response Format**: |
| 53 | +```json |
| 54 | +{ |
| 55 | + "id": "pipeline-123", |
| 56 | + "name": "My Pipeline", |
| 57 | + "description": "Pipeline description", |
| 58 | + "project": "MyProject", |
| 59 | + "status": "idle", |
| 60 | + "definition": { |
| 61 | + "stages": [...], |
| 62 | + "parameters": {...}, |
| 63 | + "triggers": [...] |
| 64 | + }, |
| 65 | + "statistics": { |
| 66 | + "total_runs": 45, |
| 67 | + "success_rate": 0.89, |
| 68 | + "avg_duration_minutes": 12.5 |
| 69 | + } |
| 70 | +} |
| 71 | +``` |
| 72 | + |
| 73 | +#### Pipeline Tasks |
| 74 | +**URI**: `studio://plm/pipelines/{pipeline-id}/tasks` |
| 75 | + |
| 76 | +List all tasks in a pipeline with their current status. |
| 77 | + |
| 78 | +**Response Format**: |
| 79 | +```json |
| 80 | +{ |
| 81 | + "pipeline_id": "pipeline-123", |
| 82 | + "tasks": [ |
| 83 | + { |
| 84 | + "id": "task-456", |
| 85 | + "name": "Build Task", |
| 86 | + "stage": "build", |
| 87 | + "status": "completed|running|failed|pending", |
| 88 | + "duration_seconds": 145, |
| 89 | + "started": "2024-01-20T14:22:00Z", |
| 90 | + "completed": "2024-01-20T14:24:25Z" |
| 91 | + } |
| 92 | + ] |
| 93 | +} |
| 94 | +``` |
| 95 | + |
| 96 | +#### Pipeline History |
| 97 | +**URI**: `studio://plm/pipelines/{pipeline-id}/history` |
| 98 | + |
| 99 | +Execution history for a pipeline. |
| 100 | + |
| 101 | +**Response Format**: |
| 102 | +```json |
| 103 | +{ |
| 104 | + "pipeline_id": "pipeline-123", |
| 105 | + "runs": [ |
| 106 | + { |
| 107 | + "run_id": "run-789", |
| 108 | + "status": "completed", |
| 109 | + "started": "2024-01-20T14:22:00Z", |
| 110 | + "completed": "2024-01-20T14:35:12Z", |
| 111 | + "duration_seconds": 792, |
| 112 | + "trigger": "manual|schedule|webhook", |
| 113 | + "triggered_by": "[email protected]" |
| 114 | + } |
| 115 | + ] |
| 116 | +} |
| 117 | +``` |
| 118 | + |
| 119 | +### Project Resources |
| 120 | + |
| 121 | +#### List Projects |
| 122 | +**URI**: `studio://plm/projects` |
| 123 | + |
| 124 | +All accessible PLM projects. |
| 125 | + |
| 126 | +**Response Format**: |
| 127 | +```json |
| 128 | +{ |
| 129 | + "projects": [ |
| 130 | + { |
| 131 | + "id": "project-123", |
| 132 | + "name": "MyProject", |
| 133 | + "description": "Project description", |
| 134 | + "pipeline_count": 12, |
| 135 | + "active_pipelines": 3 |
| 136 | + } |
| 137 | + ] |
| 138 | +} |
| 139 | +``` |
| 140 | + |
| 141 | +### Status Resources |
| 142 | + |
| 143 | +#### Server Status |
| 144 | +**URI**: `studio://status` |
| 145 | + |
| 146 | +Current server health and performance metrics. |
| 147 | + |
| 148 | +**Response Format**: |
| 149 | +```json |
| 150 | +{ |
| 151 | + "status": "healthy|degraded|unhealthy", |
| 152 | + "version": "0.2.15", |
| 153 | + "uptime_seconds": 86400, |
| 154 | + "cli_status": { |
| 155 | + "version": "1.2.3", |
| 156 | + "available": true, |
| 157 | + "last_check": "2024-01-20T15:00:00Z" |
| 158 | + }, |
| 159 | + "cache_stats": { |
| 160 | + "hit_rate": 0.87, |
| 161 | + "memory_usage_mb": 45.2, |
| 162 | + "total_operations": 1234 |
| 163 | + }, |
| 164 | + "connections": { |
| 165 | + "default": { |
| 166 | + "status": "connected|disconnected|error", |
| 167 | + "last_success": "2024-01-20T14:58:00Z" |
| 168 | + } |
| 169 | + } |
| 170 | +} |
| 171 | +``` |
| 172 | + |
| 173 | +## Tools |
| 174 | + |
| 175 | +Tools enable actions and operations through the MCP protocol. |
| 176 | + |
| 177 | +### Pipeline Management Tools |
| 178 | + |
| 179 | +#### List Pipelines |
| 180 | +**Tool**: `plm_list_pipelines` |
| 181 | + |
| 182 | +List pipelines with optional filtering. |
| 183 | + |
| 184 | +**Parameters**: |
| 185 | +```json |
| 186 | +{ |
| 187 | + "project": "string (optional)", |
| 188 | + "status": "idle|running|completed|failed (optional)", |
| 189 | + "limit": "number (optional, default: 50)" |
| 190 | +} |
| 191 | +``` |
| 192 | + |
| 193 | +**Response**: |
| 194 | +```json |
| 195 | +{ |
| 196 | + "content": [ |
| 197 | + { |
| 198 | + "type": "text", |
| 199 | + "text": "Found 3 pipelines:\n\n1. My Pipeline (pipeline-123) - Status: idle\n2. Deploy Pipeline (pipeline-456) - Status: running\n3. Test Pipeline (pipeline-789) - Status: completed" |
| 200 | + } |
| 201 | + ] |
| 202 | +} |
| 203 | +``` |
| 204 | + |
| 205 | +#### Get Pipeline Details |
| 206 | +**Tool**: `plm_get_pipeline` |
| 207 | + |
| 208 | +Get detailed information about a specific pipeline. |
| 209 | + |
| 210 | +**Parameters**: |
| 211 | +```json |
| 212 | +{ |
| 213 | + "pipeline_id": "string (required)" |
| 214 | +} |
| 215 | +``` |
| 216 | + |
| 217 | +#### Run Pipeline |
| 218 | +**Tool**: `plm_run_pipeline` |
| 219 | + |
| 220 | +Start pipeline execution. |
| 221 | + |
| 222 | +**Parameters**: |
| 223 | +```json |
| 224 | +{ |
| 225 | + "pipeline_id": "string (required)", |
| 226 | + "parameters": "object (optional)", |
| 227 | + "wait_for_completion": "boolean (optional, default: false)" |
| 228 | +} |
| 229 | +``` |
| 230 | + |
| 231 | +**Response**: |
| 232 | +```json |
| 233 | +{ |
| 234 | + "content": [ |
| 235 | + { |
| 236 | + "type": "text", |
| 237 | + "text": "Pipeline 'My Pipeline' (pipeline-123) started successfully.\nRun ID: run-987\nStatus: running" |
| 238 | + } |
| 239 | + ] |
| 240 | +} |
| 241 | +``` |
| 242 | + |
| 243 | +#### Stop Pipeline |
| 244 | +**Tool**: `plm_stop_pipeline` |
| 245 | + |
| 246 | +Stop a running pipeline. |
| 247 | + |
| 248 | +**Parameters**: |
| 249 | +```json |
| 250 | +{ |
| 251 | + "pipeline_id": "string (required)", |
| 252 | + "run_id": "string (optional, stops latest run if not specified)" |
| 253 | +} |
| 254 | +``` |
| 255 | + |
| 256 | +#### List Tasks |
| 257 | +**Tool**: `plm_list_tasks` |
| 258 | + |
| 259 | +List tasks for a pipeline. |
| 260 | + |
| 261 | +**Parameters**: |
| 262 | +```json |
| 263 | +{ |
| 264 | + "pipeline_id": "string (required)", |
| 265 | + "run_id": "string (optional, uses latest run if not specified)", |
| 266 | + "status": "completed|running|failed|pending (optional)" |
| 267 | +} |
| 268 | +``` |
| 269 | + |
| 270 | +#### Get Task Details |
| 271 | +**Tool**: `plm_get_task` |
| 272 | + |
| 273 | +Get detailed task information. |
| 274 | + |
| 275 | +**Parameters**: |
| 276 | +```json |
| 277 | +{ |
| 278 | + "pipeline_id": "string (required)", |
| 279 | + "task_id": "string (required)", |
| 280 | + "run_id": "string (optional)" |
| 281 | +} |
| 282 | +``` |
| 283 | + |
| 284 | +#### Get Task Logs |
| 285 | +**Tool**: `plm_get_task_logs` |
| 286 | + |
| 287 | +Retrieve task execution logs. |
| 288 | + |
| 289 | +**Parameters**: |
| 290 | +```json |
| 291 | +{ |
| 292 | + "pipeline_id": "string (required)", |
| 293 | + "task_id": "string (required)", |
| 294 | + "run_id": "string (optional)", |
| 295 | + "lines": "number (optional, default: 100)", |
| 296 | + "follow": "boolean (optional, default: false)" |
| 297 | +} |
| 298 | +``` |
| 299 | + |
| 300 | +### System Tools |
| 301 | + |
| 302 | +#### Server Status |
| 303 | +**Tool**: `studio_status` |
| 304 | + |
| 305 | +Get comprehensive server status. |
| 306 | + |
| 307 | +**Parameters**: None |
| 308 | + |
| 309 | +#### Version Information |
| 310 | +**Tool**: `studio_version` |
| 311 | + |
| 312 | +Get version information for server and CLI. |
| 313 | + |
| 314 | +**Parameters**: None |
| 315 | + |
| 316 | +#### CLI Information |
| 317 | +**Tool**: `cli_info` |
| 318 | + |
| 319 | +Get detailed CLI installation and status information. |
| 320 | + |
| 321 | +**Parameters**: None |
| 322 | + |
| 323 | +## Error Responses |
| 324 | + |
| 325 | +All tools return error information in a consistent format: |
| 326 | + |
| 327 | +```json |
| 328 | +{ |
| 329 | + "content": [ |
| 330 | + { |
| 331 | + "type": "text", |
| 332 | + "text": "Error: Pipeline 'invalid-123' not found" |
| 333 | + } |
| 334 | + ], |
| 335 | + "is_error": true |
| 336 | +} |
| 337 | +``` |
| 338 | + |
| 339 | +Common error types: |
| 340 | +- **Authentication Error**: Invalid credentials or expired session |
| 341 | +- **Not Found**: Resource or pipeline doesn't exist |
| 342 | +- **Permission Denied**: Insufficient access rights |
| 343 | +- **Server Error**: Studio CLI or server issues |
| 344 | +- **Timeout**: Operation took too long to complete |
| 345 | + |
| 346 | +## Rate Limiting |
| 347 | + |
| 348 | +The server implements intelligent rate limiting: |
| 349 | +- **Pipeline Operations**: 10 requests per minute |
| 350 | +- **Resource Queries**: 100 requests per minute |
| 351 | +- **Status Checks**: Unlimited |
| 352 | + |
| 353 | +Cached responses don't count toward rate limits. |
| 354 | + |
| 355 | +## Caching Behavior |
| 356 | + |
| 357 | +Resources are cached based on data mutability: |
| 358 | + |
| 359 | +- **Immutable** (1 hour): Pipeline definitions, task libraries |
| 360 | +- **Completed** (24 hours): Finished runs and tasks |
| 361 | +- **Semi-dynamic** (10 minutes): Pipeline lists, project information |
| 362 | +- **Dynamic** (1 minute): Active runs, live task status |
| 363 | + |
| 364 | +Cache can be bypassed by including `"bypass_cache": true` in tool parameters. |
0 commit comments