Canadian National Railway Capabilities

Naftiko 0.5 capability definitions for Canadian National Railway - 100 capabilities showing integration workflows and service orchestrations.

Sort
Expand

Triggers an Alteryx workflow that produces commodity demand forecasts by corridor for capacity planning.

naftiko: "0.5"
info:
  label: "Alteryx Demand Forecasting Workflow"
  description: "Triggers an Alteryx workflow that produces commodity demand forecasts by corridor for capacity planning."
  tags:
    - analytics
    - forecasting
    - alteryx
    - snowflake
capability:
  exposes:
    - type: mcp
      namespace: demand-forecasting
      port: 8080
      tools:
        - name: run-demand-forecast
          description: "Execute the Alteryx demand forecasting workflow and load results to Snowflake."
          inputParameters:
            - name: commodity_group
              in: body
              type: string
              description: "Commodity group (e.g., grain, intermodal, petroleum)."
            - name: forecast_months
              in: body
              type: integer
              description: "Months to forecast ahead."
          steps:
            - name: trigger-workflow
              type: call
              call: "alteryx.run-workflow"
              with:
                workflow_id: "demand_forecast_v4"
                parameters: "{\"commodity\": \"{{commodity_group}}\", \"months\": {{forecast_months}}}"
            - name: load-results
              type: call
              call: "snowflake.run-query"
              with:
                query: "CALL load_demand_forecasts('{{commodity_group}}', {{forecast_months}})"
  consumes:
    - type: http
      namespace: alteryx
      baseUri: "https://alteryx.cn.ca/api/v3"
      authentication:
        type: bearer
        token: "$secrets.alteryx_token"
      resources:
        - name: workflows
          path: "/workflows/{{workflow_id}}/jobs"
          inputParameters:
            - name: workflow_id
              in: path
          operations:
            - name: run-workflow
              method: POST
    - type: http
      namespace: snowflake
      baseUri: "https://cn-railway.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-query
              method: POST

Archives locomotive telemetry data from the operational database to Amazon S3 for long-term storage and regulatory retention.

naftiko: "0.5"
info:
  label: "Amazon S3 Telemetry Data Archiver"
  description: "Archives locomotive telemetry data from the operational database to Amazon S3 for long-term storage and regulatory retention."
  tags:
    - data-engineering
    - archival
    - amazon-s3
capability:
  exposes:
    - type: mcp
      namespace: data-archival
      port: 8080
      tools:
        - name: archive-telemetry
          description: "Archive locomotive telemetry data to S3 for long-term retention."
          inputParameters:
            - name: date
              in: body
              type: string
              description: "Date to archive in YYYY-MM-DD format."
            - name: locomotive_class
              in: body
              type: string
              description: "Locomotive class filter."
          call: "s3.put-object"
          with:
            bucket: "cn-telemetry-archive"
            key: "telemetry/{{locomotive_class}}/{{date}}/data.parquet"
            content_type: "application/octet-stream"
          outputParameters:
            - name: etag
              type: string
              mapping: "$.ETag"
            - name: version_id
              type: string
              mapping: "$.VersionId"
  consumes:
    - type: http
      namespace: s3
      baseUri: "https://cn-telemetry-archive.s3.ca-central-1.amazonaws.com"
      authentication:
        type: aws-sig-v4
        access_key: "$secrets.aws_access_key"
        secret_key: "$secrets.aws_secret_key"
      resources:
        - name: objects
          path: "/{{key}}"
          inputParameters:
            - name: key
              in: path
          operations:
            - name: put-object
              method: PUT

Retrieves track design files from the AutoCAD document management system for engineering review.

naftiko: "0.5"
info:
  label: "AutoCAD Track Design File Retriever"
  description: "Retrieves track design files from the AutoCAD document management system for engineering review."
  tags:
    - engineering
    - design
    - autocad
capability:
  exposes:
    - type: mcp
      namespace: track-design
      port: 8080
      tools:
        - name: get-track-design
          description: "Retrieve a track design file from AutoCAD document management."
          inputParameters:
            - name: project_id
              in: body
              type: string
              description: "Engineering project ID."
            - name: drawing_number
              in: body
              type: string
              description: "Drawing number."
          call: "autocad.get-drawing"
          with:
            project_id: "{{project_id}}"
            drawing_number: "{{drawing_number}}"
          outputParameters:
            - name: file_url
              type: string
              mapping: "$.download_url"
            - name: revision
              type: string
              mapping: "$.revision"
            - name: last_modified
              type: string
              mapping: "$.modified_date"
  consumes:
    - type: http
      namespace: autocad
      baseUri: "https://developer.api.autodesk.com/data/v1"
      authentication:
        type: bearer
        token: "$secrets.autodesk_token"
      resources:
        - name: items
          path: "/projects/{{project_id}}/items/{{drawing_number}}"
          inputParameters:
            - name: project_id
              in: path
            - name: drawing_number
              in: path
          operations:
            - name: get-drawing
              method: GET

Checks the status of Azure Data Factory pipelines that move rail operations data into Snowflake.

naftiko: "0.5"
info:
  label: "Azure Data Factory ETL Pipeline Monitor"
  description: "Checks the status of Azure Data Factory pipelines that move rail operations data into Snowflake."
  tags:
    - data-engineering
    - etl
    - azure-data-factory
capability:
  exposes:
    - type: mcp
      namespace: etl-monitoring
      port: 8080
      tools:
        - name: get-pipeline-status
          description: "Check the latest ADF pipeline run status for rail data ETL."
          inputParameters:
            - name: pipeline_name
              in: body
              type: string
              description: "ADF pipeline name."
          call: "adf.get-pipeline-runs"
          with:
            pipeline_name: "{{pipeline_name}}"
          outputParameters:
            - name: run_id
              type: string
              mapping: "$.value[0].runId"
            - name: status
              type: string
              mapping: "$.value[0].status"
            - name: duration
              type: string
              mapping: "$.value[0].durationInMs"
  consumes:
    - type: http
      namespace: adf
      baseUri: "https://management.azure.com/subscriptions/{{subscription_id}}/resourceGroups/cn-data-rg/providers/Microsoft.DataFactory/factories/cn-adf"
      authentication:
        type: bearer
        token: "$secrets.azure_mgmt_token"
      resources:
        - name: pipeline-runs
          path: "/queryPipelineRuns"
          operations:
            - name: get-pipeline-runs
              method: POST

Checks the latest Azure DevOps build and release pipeline status for CN's digital platform.

naftiko: "0.5"
info:
  label: "Azure DevOps CI/CD Pipeline Status"
  description: "Checks the latest Azure DevOps build and release pipeline status for CN's digital platform."
  tags:
    - devops
    - ci-cd
    - azure-devops
capability:
  exposes:
    - type: mcp
      namespace: cicd-status
      port: 8080
      tools:
        - name: get-pipeline-status
          description: "Get the latest Azure DevOps pipeline run status."
          inputParameters:
            - name: project
              in: body
              type: string
              description: "Azure DevOps project name."
            - name: pipeline_id
              in: body
              type: string
              description: "Pipeline definition ID."
          call: "azuredevops.get-pipeline-runs"
          with:
            project: "{{project}}"
            pipeline_id: "{{pipeline_id}}"
          outputParameters:
            - name: run_id
              type: integer
              mapping: "$.value[0].id"
            - name: status
              type: string
              mapping: "$.value[0].state"
            - name: result
              type: string
              mapping: "$.value[0].result"
  consumes:
    - type: http
      namespace: azuredevops
      baseUri: "https://dev.azure.com/cn-railway"
      authentication:
        type: basic
        username: ""
        password: "$secrets.azuredevops_pat"
      resources:
        - name: pipeline-runs
          path: "/{{project}}/_apis/pipelines/{{pipeline_id}}/runs"
          inputParameters:
            - name: project
              in: path
            - name: pipeline_id
              in: path
          operations:
            - name: get-pipeline-runs
              method: GET

Retrieves operational status from an Azure IoT-connected wayside detector.

naftiko: "0.5"
info:
  label: "Azure IoT Wayside Detector Status Lookup"
  description: "Retrieves operational status from an Azure IoT-connected wayside detector."
  tags:
    - operations
    - microsoft-azure
capability:
  exposes:
    - type: mcp
      namespace: wayside-iot
      port: 8080
      tools:
        - name: get-detector-status
          description: "Look up wayside detector status by device ID."
          inputParameters:
            - name: device_id
              in: body
              type: string
              description: "Azure IoT device ID."
          call: "azure-iot.get-device-twin"
          with:
            device_id: "{{device_id}}"
          outputParameters:
            - name: status
              type: string
              mapping: "$.status"
            - name: last_reading
              type: string
              mapping: "$.properties.reported.lastReading"
  consumes:
    - type: http
      namespace: azure-iot
      baseUri: "https://cn-iot-hub.azure-devices.net"
      authentication:
        type: bearer
        token: "$secrets.azure_iot_token"
      resources:
        - name: twins
          path: "/twins/{{device_id}}"
          inputParameters:
            - name: device_id
              in: path
          operations:
            - name: get-device-twin
              method: GET

Uploads regulatory filings to Box and shares them with the legal and compliance teams for Transport Canada submissions.

naftiko: "0.5"
info:
  label: "Box Regulatory Filing Manager"
  description: "Uploads regulatory filings to Box and shares them with the legal and compliance teams for Transport Canada submissions."
  tags:
    - compliance
    - document-management
    - box
capability:
  exposes:
    - type: mcp
      namespace: regulatory-filings
      port: 8080
      tools:
        - name: upload-filing
          description: "Upload a regulatory filing document to Box and set sharing permissions."
          inputParameters:
            - name: file_name
              in: body
              type: string
              description: "Document file name."
            - name: folder_id
              in: body
              type: string
              description: "Box folder ID for regulatory filings."
            - name: content
              in: body
              type: string
              description: "File content."
          call: "box.upload-file"
          with:
            folder_id: "{{folder_id}}"
            file_name: "{{file_name}}"
            content: "{{content}}"
          outputParameters:
            - name: file_id
              type: string
              mapping: "$.entries[0].id"
            - name: shared_link
              type: string
              mapping: "$.entries[0].shared_link.url"
  consumes:
    - type: http
      namespace: box
      baseUri: "https://upload.box.com/api/2.0"
      authentication:
        type: bearer
        token: "$secrets.box_token"
      resources:
        - name: files
          path: "/files/content"
          operations:
            - name: upload-file
              method: POST

Retrieves bridge inspection schedules, validates compliance, creates ServiceNow alerts.

naftiko: "0.5"
info:
  label: "Bridge Inspection Compliance Orchestrator"
  description: "Retrieves bridge inspection schedules, validates compliance, creates ServiceNow alerts."
  tags:
    - maintenance
    - sap
    - servicenow
capability:
  exposes:
    - type: mcp
      namespace: bridge-compliance
      port: 8080
      tools:
        - name: check-bridge-inspections
          description: "Check bridge compliance and create alerts."
          inputParameters:
            - name: subdivision
              in: body
              type: string
              description: "Subdivision."
          steps:
            - name: get-schedules
              type: call
              call: "sap.get-bridge-inspections"
              with:
                subdivision: "{{subdivision}}"
            - name: validate
              type: call
              call: "compliance.validate-deadlines"
              with:
                subdivision: "{{subdivision}}"
            - name: alert
              type: call
              call: "servicenow.create-incident"
              with:
                short_description: "Overdue bridge inspections on {{subdivision}}"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/PM_INSPECTION_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: inspections
          path: "/A_BridgeInspection"
          operations:
            - name: get-bridge-inspections
              method: GET
    - type: http
      namespace: compliance
      baseUri: "https://api.cn.ca/compliance/v1"
      authentication:
        type: bearer
        token: "$secrets.compliance_token"
      resources:
        - name: validation
          path: "/validate-deadlines"
          operations:
            - name: validate-deadlines
              method: POST
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: incidents
          path: "/table/incident"
          operations:
            - name: create-incident
              method: POST

Calculates SAP car hire charges, reconciles, and generates settlement invoices.

naftiko: "0.5"
info:
  label: "Car Hire Settlement Orchestrator"
  description: "Calculates SAP car hire charges, reconciles, and generates settlement invoices."
  tags:
    - finance
    - sap
    - servicenow
capability:
  exposes:
    - type: mcp
      namespace: car-hire
      port: 8080
      tools:
        - name: process-car-hire-settlement
          description: "Calculate charges and generate invoices."
          inputParameters:
            - name: partner_railroad
              in: body
              type: string
              description: "Partner railroad."
            - name: period
              in: body
              type: string
              description: "Settlement period."
          steps:
            - name: get-charges
              type: call
              call: "sap.get-car-hire-charges"
              with:
                partner: "{{partner_railroad}}"
            - name: reconcile
              type: call
              call: "sap.reconcile-charges"
              with:
                partner: "{{partner_railroad}}"
            - name: invoice
              type: call
              call: "servicenow.create-request"
              with:
                short_description: "Car hire - {{partner_railroad}} - {{period}}"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/FI_CAR_HIRE_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: charges
          path: "/A_CarHireCharge"
          operations:
            - name: get-car-hire-charges
              method: GET
            - name: reconcile-charges
              method: POST
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: requests
          path: "/table/sc_request"
          operations:
            - name: create-request
              method: POST

Manages DNS records in Cloudflare for CN's public-facing web properties and customer portals.

naftiko: "0.5"
info:
  label: "Cloudflare DNS Record Manager"
  description: "Manages DNS records in Cloudflare for CN's public-facing web properties and customer portals."
  tags:
    - infrastructure
    - dns
    - cloudflare
capability:
  exposes:
    - type: mcp
      namespace: dns-management
      port: 8080
      tools:
        - name: update-dns-record
          description: "Update a DNS record in Cloudflare."
          inputParameters:
            - name: zone_id
              in: body
              type: string
              description: "Cloudflare zone ID."
            - name: record_id
              in: body
              type: string
              description: "DNS record ID."
            - name: record_type
              in: body
              type: string
              description: "Record type (A, CNAME, TXT)."
            - name: name
              in: body
              type: string
              description: "DNS record name."
            - name: content
              in: body
              type: string
              description: "Record content (IP or value)."
          call: "cloudflare.update-record"
          with:
            zone_id: "{{zone_id}}"
            record_id: "{{record_id}}"
            type: "{{record_type}}"
            name: "{{name}}"
            content: "{{content}}"
          outputParameters:
            - name: success
              type: boolean
              mapping: "$.success"
            - name: record
              type: object
              mapping: "$.result"
  consumes:
    - type: http
      namespace: cloudflare
      baseUri: "https://api.cloudflare.com/client/v4"
      authentication:
        type: bearer
        token: "$secrets.cloudflare_token"
      resources:
        - name: dns-records
          path: "/zones/{{zone_id}}/dns_records/{{record_id}}"
          inputParameters:
            - name: zone_id
              in: path
            - name: record_id
              in: path
          operations:
            - name: update-record
              method: PUT

Checks CloudWatch alarm status for the train dispatch system.

naftiko: "0.5"
info:
  label: "CloudWatch Dispatch System Health Lookup"
  description: "Checks CloudWatch alarm status for the train dispatch system."
  tags:
    - operations
    - cloudwatch
capability:
  exposes:
    - type: mcp
      namespace: dispatch-health
      port: 8080
      tools:
        - name: get-dispatch-health
          description: "Look up CloudWatch alarm status for dispatch system."
          inputParameters:
            - name: alarm_prefix
              in: body
              type: string
              description: "CloudWatch alarm name prefix."
          call: "cloudwatch.describe-alarms"
          with:
            prefix: "{{alarm_prefix}}"
          outputParameters:
            - name: alarm_count
              type: number
              mapping: "$.MetricAlarms.length"
            - name: in_alarm
              type: number
              mapping: "$.MetricAlarms.filter.ALARM"
  consumes:
    - type: http
      namespace: cloudwatch
      baseUri: "https://monitoring.us-east-1.amazonaws.com"
      authentication:
        type: bearer
        token: "$secrets.aws_cloudwatch_token"
      resources:
        - name: alarms
          path: "/?Action=DescribeAlarms&AlarmNamePrefix={{prefix}}"
          operations:
            - name: describe-alarms
              method: GET

Monitors AWS CloudWatch metrics for CN's wayside signal systems and alerts the signal maintenance team when anomalies are detected.

naftiko: "0.5"
info:
  label: "CloudWatch Signal System Monitor"
  description: "Monitors AWS CloudWatch metrics for CN's wayside signal systems and alerts the signal maintenance team when anomalies are detected."
  tags:
    - operations
    - signals
    - cloudwatch
    - microsoft-teams
capability:
  exposes:
    - type: mcp
      namespace: signal-monitoring
      port: 8080
      tools:
        - name: check-signal-health
          description: "Query CloudWatch for signal system health and alert Teams on anomalies."
          inputParameters:
            - name: subdivision
              in: body
              type: string
              description: "Track subdivision."
            - name: threshold
              in: body
              type: number
              description: "Error rate threshold to trigger alert."
          steps:
            - name: get-metrics
              type: call
              call: "cloudwatch.get-metric"
              with:
                namespace: "CN/SignalSystems"
                metric_name: "SignalErrors"
                dimensions: "[{\"Name\": \"Subdivision\", \"Value\": \"{{subdivision}}\"}]"
                period: "3600"
            - name: alert-team
              type: call
              call: "msteams.send-message"
              with:
                channel_id: "signal_maintenance"
                text: "Signal system alert on {{subdivision}}: Error rate {{get-metrics.value}} exceeds threshold {{threshold}}. Investigate immediately."
  consumes:
    - type: http
      namespace: cloudwatch
      baseUri: "https://monitoring.us-east-1.amazonaws.com"
      authentication:
        type: aws-sig-v4
        access_key: "$secrets.aws_access_key"
        secret_key: "$secrets.aws_secret_key"
      resources:
        - name: metrics
          path: "/"
          operations:
            - name: get-metric
              method: POST
    - type: http
      namespace: msteams
      baseUri: "https://graph.microsoft.com/v1.0"
      authentication:
        type: bearer
        token: "$secrets.msgraph_token"
      resources:
        - name: channel-messages
          path: "/teams/{{channel_id}}/channels/general/messages"
          inputParameters:
            - name: channel_id
              in: path
          operations:
            - name: send-message
              method: POST

Creates or updates operating procedure pages in Confluence for rail operations and notifies affected teams.

naftiko: "0.5"
info:
  label: "Confluence Operations Manual Publisher"
  description: "Creates or updates operating procedure pages in Confluence for rail operations and notifies affected teams."
  tags:
    - knowledge-management
    - operations
    - confluence
    - microsoft-teams
capability:
  exposes:
    - type: mcp
      namespace: ops-manual
      port: 8080
      tools:
        - name: publish-operating-procedure
          description: "Create or update an operating procedure in Confluence and notify relevant teams."
          inputParameters:
            - name: space_key
              in: body
              type: string
              description: "Confluence space key."
            - name: title
              in: body
              type: string
              description: "Page title."
            - name: content
              in: body
              type: string
              description: "Page content in storage format."
            - name: notify_channel
              in: body
              type: string
              description: "Teams channel to notify."
          steps:
            - name: create-page
              type: call
              call: "confluence.create-page"
              with:
                space_key: "{{space_key}}"
                title: "{{title}}"
                body: "{{content}}"
            - name: notify-team
              type: call
              call: "msteams.send-message"
              with:
                channel_id: "{{notify_channel}}"
                text: "Updated operating procedure: {{title}}. View at {{create-page.url}}"
  consumes:
    - type: http
      namespace: confluence
      baseUri: "https://cn-railway.atlassian.net/wiki/rest/api"
      authentication:
        type: basic
        username: "$secrets.confluence_user"
        password: "$secrets.confluence_api_token"
      resources:
        - name: content
          path: "/content"
          operations:
            - name: create-page
              method: POST
    - type: http
      namespace: msteams
      baseUri: "https://graph.microsoft.com/v1.0"
      authentication:
        type: bearer
        token: "$secrets.msgraph_token"
      resources:
        - name: channel-messages
          path: "/teams/{{channel_id}}/channels/general/messages"
          inputParameters:
            - name: channel_id
              in: path
          operations:
            - name: send-message
              method: POST

Retrieves the latest safety bulletin from a Confluence space.

naftiko: "0.5"
info:
  label: "Confluence Safety Bulletin Lookup"
  description: "Retrieves the latest safety bulletin from a Confluence space."
  tags:
    - safety
    - confluence
capability:
  exposes:
    - type: mcp
      namespace: safety-info
      port: 8080
      tools:
        - name: get-latest-bulletin
          description: "Look up latest safety bulletin from Confluence."
          inputParameters:
            - name: space_key
              in: body
              type: string
              description: "Confluence space key."
          call: "confluence.get-latest-page"
          with:
            space_key: "{{space_key}}"
          outputParameters:
            - name: title
              type: string
              mapping: "$.results[0].title"
            - name: last_updated
              type: string
              mapping: "$.results[0].version.when"
  consumes:
    - type: http
      namespace: confluence
      baseUri: "https://cn.atlassian.net/wiki/rest/api"
      authentication:
        type: basic
        username: "$secrets.confluence_user"
        password: "$secrets.confluence_api_token"
      resources:
        - name: content
          path: "/content?spaceKey={{space_key}}&orderby=lastmodified+desc&limit=1"
          operations:
            - name: get-latest-page
              method: GET

Models corridor capacity with Snowflake, Alteryx, and Power BI.

naftiko: "0.5"
info:
  label: "Corridor Capacity Planning Orchestrator"
  description: "Models corridor capacity with Snowflake, Alteryx, and Power BI."
  tags:
    - operations
    - snowflake
    - alteryx
    - power-bi
capability:
  exposes:
    - type: mcp
      namespace: capacity-planning
      port: 8080
      tools:
        - name: plan-corridor-capacity
          description: "Model capacity with Snowflake, Alteryx, Power BI."
          inputParameters:
            - name: corridor_id
              in: body
              type: string
              description: "Corridor ID."
            - name: horizon
              in: body
              type: string
              description: "Planning horizon."
          steps:
            - name: get-projections
              type: call
              call: "snowflake.query-projections"
              with:
                corridor: "{{corridor_id}}"
            - name: model
              type: call
              call: "alteryx.run-workflow"
              with:
                corridor: "{{corridor_id}}"
            - name: publish
              type: call
              call: "powerbi.trigger-refresh"
              with:
                dataset_id: "corridor-capacity-ds"
  consumes:
    - type: http
      namespace: snowflake
      baseUri: "https://cn.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-analysis
              method: POST
            - name: query-revenue
              method: POST
            - name: run-safety-analysis
              method: POST
            - name: query-velocity
              method: POST
            - name: query-projections
              method: POST
            - name: query-volumes
              method: POST
            - name: query-metrics
              method: POST
            - name: run-geometry-analysis
              method: POST
    - type: http
      namespace: alteryx
      baseUri: "https://alteryx.cn.ca/api/v1"
      authentication:
        type: bearer
        token: "$secrets.alteryx_token"
      resources:
        - name: workflows
          path: "/workflows/run"
          operations:
            - name: run-workflow
              method: POST
    - type: http
      namespace: powerbi
      baseUri: "https://api.powerbi.com/v1.0/myorg"
      authentication:
        type: bearer
        token: "$secrets.powerbi_token"
      resources:
        - name: datasets
          path: "/datasets/{{dataset_id}}/refreshes"
          operations:
            - name: trigger-refresh
              method: POST

Creates a Coupa purchase requisition for rail maintenance supplies and routes for approval.

naftiko: "0.5"
info:
  label: "Coupa Procurement Requisition Creator"
  description: "Creates a Coupa purchase requisition for rail maintenance supplies and routes for approval."
  tags:
    - procurement
    - supply-chain
    - coupa
capability:
  exposes:
    - type: mcp
      namespace: procurement
      port: 8080
      tools:
        - name: create-requisition
          description: "Create a purchase requisition in Coupa for maintenance supplies."
          inputParameters:
            - name: supplier_name
              in: body
              type: string
              description: "Preferred supplier name."
            - name: items
              in: body
              type: string
              description: "JSON array of items with description, quantity, and unit price."
            - name: cost_center
              in: body
              type: string
              description: "Cost center code."
            - name: facility_code
              in: body
              type: string
              description: "Delivery facility code."
          call: "coupa.create-requisition"
          with:
            supplier: "{{supplier_name}}"
            line_items: "{{items}}"
            cost_center: "{{cost_center}}"
            ship_to: "{{facility_code}}"
          outputParameters:
            - name: requisition_id
              type: string
              mapping: "$.id"
            - name: status
              type: string
              mapping: "$.status"
            - name: total
              type: number
              mapping: "$.total"
  consumes:
    - type: http
      namespace: coupa
      baseUri: "https://cn.coupahost.com/api"
      authentication:
        type: bearer
        token: "$secrets.coupa_api_token"
      resources:
        - name: requisitions
          path: "/requisitions"
          operations:
            - name: create-requisition
              method: POST

Retrieves procurement spend data from Coupa, analyzes trends in Snowflake, and publishes savings opportunities to Confluence.

naftiko: "0.5"
info:
  label: "Coupa Procurement Spend Analysis Orchestrator"
  description: "Retrieves procurement spend data from Coupa, analyzes trends in Snowflake, and publishes savings opportunities to Confluence."
  tags:
    - procurement
    - coupa
    - snowflake
    - confluence
capability:
  exposes:
    - type: mcp
      namespace: procurement-spend
      port: 8080
      tools:
        - name: analyze-procurement-spend
          description: "Retrieve Coupa spend data, analyze in Snowflake, and publish savings to Confluence."
          inputParameters:
            - name: fiscal_quarter
              in: body
              type: string
              description: "Fiscal quarter for analysis."
            - name: category
              in: body
              type: string
              description: "Procurement category."
          steps:
            - name: get-spend-data
              type: call
              call: "coupa.get-spend-report"
              with:
                quarter: "{{fiscal_quarter}}"
                category: "{{category}}"
            - name: analyze-trends
              type: call
              call: "snowflake.run-spend-analysis"
              with:
                quarter: "{{fiscal_quarter}}"
                category: "{{category}}"
            - name: publish-findings
              type: call
              call: "confluence.create-page"
              with:
                space_key: "PROC"
                title: "Spend Analysis - {{category}} - {{fiscal_quarter}}"
                body: "Spend analysis and savings opportunities"
  consumes:
    - type: http
      namespace: coupa
      baseUri: "https://cn.coupahost.com/api"
      authentication:
        type: bearer
        token: "$secrets.coupa_token"
      resources:
        - name: spend
          path: "/spend_reports"
          operations:
            - name: get-spend-report
              method: GET
    - type: http
      namespace: snowflake
      baseUri: "https://cn.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-spend-analysis
              method: POST
    - type: http
      namespace: confluence
      baseUri: "https://cn.atlassian.net/wiki/rest/api"
      authentication:
        type: basic
        username: "$secrets.confluence_user"
        password: "$secrets.confluence_api_token"
      resources:
        - name: content
          path: "/content"
          operations:
            - name: create-page
              method: POST

Monitors crew hours from Workday, validates fatigue limits, and creates schedule adjustments.

naftiko: "0.5"
info:
  label: "Crew Fatigue Management Orchestrator"
  description: "Monitors crew hours from Workday, validates fatigue limits, and creates schedule adjustments."
  tags:
    - safety
    - workday
    - servicenow
capability:
  exposes:
    - type: mcp
      namespace: fatigue-mgmt
      port: 8080
      tools:
        - name: manage-crew-fatigue
          description: "Monitor hours, validate limits, adjust schedules."
          inputParameters:
            - name: crew_id
              in: body
              type: string
              description: "Crew member ID."
            - name: subdivision
              in: body
              type: string
              description: "Subdivision."
          steps:
            - name: get-hours
              type: call
              call: "workday.get-work-hours"
              with:
                worker_id: "{{crew_id}}"
            - name: check
              type: call
              call: "fatigue.validate-hours"
              with:
                crew_id: "{{crew_id}}"
            - name: adjust
              type: call
              call: "servicenow.create-request"
              with:
                short_description: "Fatigue adjustment for {{crew_id}}"
  consumes:
    - type: http
      namespace: workday
      baseUri: "https://wd2-impl-services1.workday.com/ccx/api/v1"
      authentication:
        type: bearer
        token: "$secrets.workday_token"
      resources:
        - name: workers
          path: "/cn/workers"
          operations:
            - name: assign-crew
              method: POST
            - name: get-available-crew
              method: GET
            - name: get-work-hours
              method: GET
            - name: add-training-record
              method: POST
            - name: get-worker
              method: GET
    - type: http
      namespace: fatigue
      baseUri: "https://api.cn.ca/fatigue-mgmt/v1"
      authentication:
        type: bearer
        token: "$secrets.fatigue_token"
      resources:
        - name: validation
          path: "/validate"
          operations:
            - name: validate-hours
              method: POST
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: requests
          path: "/table/sc_request"
          operations:
            - name: create-request
              method: POST

Generates Transport Canada regulatory reports using Crystal Reports templates with data from Snowflake.

naftiko: "0.5"
info:
  label: "Crystal Reports Regulatory Submission Generator"
  description: "Generates Transport Canada regulatory reports using Crystal Reports templates with data from Snowflake."
  tags:
    - compliance
    - reporting
    - crystal-reports
    - snowflake
capability:
  exposes:
    - type: mcp
      namespace: regulatory-reporting
      port: 8080
      tools:
        - name: generate-regulatory-report
          description: "Generate a regulatory report combining Crystal Reports templates with Snowflake data."
          inputParameters:
            - name: report_type
              in: body
              type: string
              description: "Report type (e.g., TSB_annual, FRA_form_2, Transport_Canada_quarterly)."
            - name: reporting_period
              in: body
              type: string
              description: "Reporting period."
          steps:
            - name: fetch-data
              type: call
              call: "snowflake.run-query"
              with:
                query: "SELECT * FROM regulatory_report_data WHERE report_type='{{report_type}}' AND period='{{reporting_period}}'"
            - name: generate-report
              type: call
              call: "crystal-reports.generate"
              with:
                template: "{{report_type}}"
                data: "{{fetch-data.results}}"
  consumes:
    - type: http
      namespace: snowflake
      baseUri: "https://cn-railway.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-query
              method: POST
    - type: http
      namespace: crystal-reports
      baseUri: "https://reports.cn.ca/api/v1"
      authentication:
        type: bearer
        token: "$secrets.crystal_reports_token"
      resources:
        - name: reports
          path: "/reports/generate"
          operations:
            - name: generate
              method: POST

Finds expiring Salesforce contracts, analyzes Snowflake trends, generates Confluence proposals.

naftiko: "0.5"
info:
  label: "Customer Rate Renewal Orchestrator"
  description: "Finds expiring Salesforce contracts, analyzes Snowflake trends, generates Confluence proposals."
  tags:
    - sales
    - salesforce
    - snowflake
    - confluence
capability:
  exposes:
    - type: mcp
      namespace: rate-renewal
      port: 8080
      tools:
        - name: process-rate-renewals
          description: "Find contracts, analyze trends, generate proposals."
          inputParameters:
            - name: days_to_expiry
              in: body
              type: number
              description: "Days until expiry."
          steps:
            - name: get-contracts
              type: call
              call: "salesforce.get-contracts"
              with:
                days: "{{days_to_expiry}}"
            - name: get-trends
              type: call
              call: "snowflake.query-volumes"
              with:
                days: "{{days_to_expiry}}"
            - name: create-proposals
              type: call
              call: "confluence.create-page"
              with:
                space_key: "SALES"
                title: "Rate Renewals"
  consumes:
    - type: http
      namespace: salesforce
      baseUri: "https://cn.my.salesforce.com/services/data/v58.0"
      authentication:
        type: bearer
        token: "$secrets.salesforce_token"
      resources:
        - name: objects
          path: "/sobjects"
          operations:
            - name: send-notification
              method: POST
            - name: update-case
              method: PATCH
            - name: get-account
              method: GET
            - name: get-contracts
              method: GET
    - type: http
      namespace: snowflake
      baseUri: "https://cn.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-analysis
              method: POST
            - name: query-revenue
              method: POST
            - name: run-safety-analysis
              method: POST
            - name: query-velocity
              method: POST
            - name: query-projections
              method: POST
            - name: query-volumes
              method: POST
            - name: query-metrics
              method: POST
            - name: run-geometry-analysis
              method: POST
    - type: http
      namespace: confluence
      baseUri: "https://cn.atlassian.net/wiki/rest/api"
      authentication:
        type: basic
        username: "$secrets.confluence_user"
        password: "$secrets.confluence_api_token"
      resources:
        - name: content
          path: "/content"
          operations:
            - name: create-page
              method: POST

Calculates updated ETAs, updates Salesforce, sends customer email notifications.

naftiko: "0.5"
info:
  label: "Customer Shipment ETA Update Orchestrator"
  description: "Calculates updated ETAs, updates Salesforce, sends customer email notifications."
  tags:
    - logistics
    - salesforce
    - email
capability:
  exposes:
    - type: mcp
      namespace: eta-updates
      port: 8080
      tools:
        - name: update-shipment-eta
          description: "Calculate ETAs, update Salesforce, notify customers."
          inputParameters:
            - name: shipment_id
              in: body
              type: string
              description: "Shipment ID."
          steps:
            - name: get-eta
              type: call
              call: "tracking.calculate-eta"
              with:
                shipment_id: "{{shipment_id}}"
            - name: update-sf
              type: call
              call: "salesforce.update-case"
              with:
                shipment_id: "{{shipment_id}}"
            - name: notify
              type: call
              call: "email.send-message"
              with:
                to: "customer@example.com"
                subject: "Shipment {{shipment_id}} ETA Update"
  consumes:
    - type: http
      namespace: tracking
      baseUri: "https://api.cn.ca/tracking/v2"
      authentication:
        type: bearer
        token: "$secrets.tracking_token"
      resources:
        - name: shipments
          path: "/shipments/{{shipment_id}}/eta"
          inputParameters:
            - name: shipment_id
              in: path
          operations:
            - name: calculate-eta
              method: GET
    - type: http
      namespace: salesforce
      baseUri: "https://cn.my.salesforce.com/services/data/v58.0"
      authentication:
        type: bearer
        token: "$secrets.salesforce_token"
      resources:
        - name: objects
          path: "/sobjects"
          operations:
            - name: send-notification
              method: POST
            - name: update-case
              method: PATCH
            - name: get-account
              method: GET
            - name: get-contracts
              method: GET
    - type: http
      namespace: email
      baseUri: "https://graph.microsoft.com/v1.0"
      authentication:
        type: bearer
        token: "$secrets.graph_token"
      resources:
        - name: mail
          path: "/me/sendMail"
          operations:
            - name: send-message
              method: POST

Compiles ServiceNow and SAP overnight data, distributes morning briefing via email.

naftiko: "0.5"
info:
  label: "Daily Operations Briefing Orchestrator"
  description: "Compiles ServiceNow and SAP overnight data, distributes morning briefing via email."
  tags:
    - operations
    - servicenow
    - sap
    - email
capability:
  exposes:
    - type: mcp
      namespace: daily-briefing
      port: 8080
      tools:
        - name: generate-daily-briefing
          description: "Compile overnight data and distribute briefing."
          inputParameters:
            - name: region
              in: body
              type: string
              description: "Region."
            - name: date
              in: body
              type: string
              description: "Date."
          steps:
            - name: get-incidents
              type: call
              call: "servicenow.create-incident"
              with:
                short_description: "Daily briefing query {{region}}"
            - name: get-maintenance
              type: call
              call: "sap.get-active-orders"
              with:
                region: "{{region}}"
            - name: send
              type: call
              call: "email.send-message"
              with:
                to: "ops-{{region}}@cn.ca"
                subject: "Daily Briefing - {{region}} - {{date}}"
  consumes:
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: incidents
          path: "/table/incident"
          operations:
            - name: create-incident
              method: POST
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/PM_ORDER_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: orders
          path: "/A_MaintenanceOrder"
          operations:
            - name: create-maintenance-order
              method: POST
            - name: create-order
              method: POST
            - name: get-active-orders
              method: GET
    - type: http
      namespace: email
      baseUri: "https://graph.microsoft.com/v1.0"
      authentication:
        type: bearer
        token: "$secrets.graph_token"
      resources:
        - name: mail
          path: "/me/sendMail"
          operations:
            - name: send-message
              method: POST

Validates dangerous goods compliance, logs in ServiceNow, and alerts safety team via Slack.

naftiko: "0.5"
info:
  label: "Dangerous Goods Compliance Orchestrator"
  description: "Validates dangerous goods compliance, logs in ServiceNow, and alerts safety team via Slack."
  tags:
    - safety
    - servicenow
    - slack
capability:
  exposes:
    - type: mcp
      namespace: dg-compliance
      port: 8080
      tools:
        - name: validate-dangerous-goods
          description: "Validate DG compliance, log, and alert."
          inputParameters:
            - name: shipment_id
              in: body
              type: string
              description: "Shipment ID."
            - name: un_number
              in: body
              type: string
              description: "UN number."
          steps:
            - name: check
              type: call
              call: "dg-system.validate-shipment"
              with:
                shipment_id: "{{shipment_id}}"
                un_number: "{{un_number}}"
            - name: log
              type: call
              call: "servicenow.create-incident"
              with:
                short_description: "DG check for {{shipment_id}}"
            - name: alert
              type: call
              call: "slack.post-message"
              with:
                channel: "#safety-ops"
                text: "DG check for {{shipment_id}} complete"
  consumes:
    - type: http
      namespace: dg-system
      baseUri: "https://api.cn.ca/dangerous-goods/v1"
      authentication:
        type: bearer
        token: "$secrets.dg_system_token"
      resources:
        - name: validation
          path: "/validate"
          operations:
            - name: validate-shipment
              method: POST
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: incidents
          path: "/table/incident"
          operations:
            - name: create-incident
              method: POST
    - type: http
      namespace: slack
      baseUri: "https://slack.com/api"
      authentication:
        type: bearer
        token: "$secrets.slack_bot_token"
      resources:
        - name: messages
          path: "/chat.postMessage"
          operations:
            - name: post-message
              method: POST

Runs a predictive maintenance notebook in Databricks to forecast locomotive component failures and stores predictions in Snowflake.

naftiko: "0.5"
info:
  label: "Databricks Predictive Maintenance Model"
  description: "Runs a predictive maintenance notebook in Databricks to forecast locomotive component failures and stores predictions in Snowflake."
  tags:
    - analytics
    - predictive-maintenance
    - databricks
    - snowflake
capability:
  exposes:
    - type: mcp
      namespace: predictive-maintenance
      port: 8080
      tools:
        - name: run-failure-prediction
          description: "Execute a Databricks predictive maintenance model and store results in Snowflake."
          inputParameters:
            - name: locomotive_class
              in: body
              type: string
              description: "Locomotive class to analyze."
            - name: prediction_horizon_days
              in: body
              type: integer
              description: "Days ahead to predict failures."
          steps:
            - name: run-notebook
              type: call
              call: "databricks.run-notebook"
              with:
                notebook_path: "/Shared/predictive_maintenance_v2"
                parameters: "{\"loco_class\": \"{{locomotive_class}}\", \"horizon\": {{prediction_horizon_days}}}"
            - name: load-predictions
              type: call
              call: "snowflake.run-query"
              with:
                query: "INSERT INTO maintenance_predictions SELECT * FROM staging_predictions WHERE loco_class='{{locomotive_class}}'"
  consumes:
    - type: http
      namespace: databricks
      baseUri: "https://cn-railway.cloud.databricks.com/api/2.1"
      authentication:
        type: bearer
        token: "$secrets.databricks_token"
      resources:
        - name: jobs
          path: "/jobs/runs/submit"
          operations:
            - name: run-notebook
              method: POST
    - type: http
      namespace: snowflake
      baseUri: "https://cn-railway.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-query
              method: POST

Queries Datadog for CN's IT infrastructure health metrics including server uptime, network latency, and service availability.

naftiko: "0.5"
info:
  label: "Datadog Infrastructure Monitoring"
  description: "Queries Datadog for CN's IT infrastructure health metrics including server uptime, network latency, and service availability."
  tags:
    - devops
    - monitoring
    - datadog
capability:
  exposes:
    - type: mcp
      namespace: infra-monitoring
      port: 8080
      tools:
        - name: get-infra-health
          description: "Fetch infrastructure health metrics from Datadog for CN's critical systems."
          inputParameters:
            - name: service_tag
              in: body
              type: string
              description: "Datadog service tag to query."
            - name: time_range
              in: body
              type: string
              description: "Time range (e.g., last_1h, last_24h)."
          call: "datadog.query-metrics"
          with:
            query: "avg:system.cpu.user{service:{{service_tag}}}.rollup(avg, 300)"
            from: "{{time_range}}"
          outputParameters:
            - name: avg_cpu
              type: number
              mapping: "$.series[0].pointlist[-1][1]"
            - name: metric_name
              type: string
              mapping: "$.series[0].metric"
  consumes:
    - type: http
      namespace: datadog
      baseUri: "https://api.datadoghq.com/api/v1"
      authentication:
        type: apiKey
        key: "$secrets.datadog_api_key"
      resources:
        - name: metrics
          path: "/query"
          operations:
            - name: query-metrics
              method: GET

Queries Datadog for real-time latency metrics of the centralized traffic control signal system.

naftiko: "0.5"
info:
  label: "Datadog Signal System Latency Lookup"
  description: "Queries Datadog for real-time latency metrics of the centralized traffic control signal system."
  tags:
    - operations
    - datadog
capability:
  exposes:
    - type: mcp
      namespace: signal-latency
      port: 8080
      tools:
        - name: get-signal-latency
          description: "Look up signal system latency by service tag."
          inputParameters:
            - name: service_tag
              in: body
              type: string
              description: "Datadog service tag."
          call: "datadog.query-metric"
          with:
            tags: "{{service_tag}}"
          outputParameters:
            - name: p99_latency_ms
              type: number
              mapping: "$.series[0].pointlist[-1][1]"
  consumes:
    - type: http
      namespace: datadog
      baseUri: "https://api.datadoghq.com/api/v1"
      authentication:
        type: apikey
        key: "DD-API-KEY"
        value: "$secrets.datadog_api_key"
        placement: header
      resources:
        - name: query
          path: "/query"
          operations:
            - name: query-metric
              method: GET

Creates critical incident, orders SAP track inspection, notifies investigation board.

naftiko: "0.5"
info:
  label: "Derailment Investigation Orchestrator"
  description: "Creates critical incident, orders SAP track inspection, notifies investigation board."
  tags:
    - safety
    - servicenow
    - sap
    - email
capability:
  exposes:
    - type: mcp
      namespace: derailment-inv
      port: 8080
      tools:
        - name: initiate-derailment-investigation
          description: "Create incident, order inspection, notify board."
          inputParameters:
            - name: location
              in: body
              type: string
              description: "Location."
            - name: train_id
              in: body
              type: string
              description: "Train ID."
          steps:
            - name: create-incident
              type: call
              call: "servicenow.create-incident"
              with:
                short_description: "Derailment: {{train_id}} at {{location}}"
                urgency: "1"
            - name: order-inspection
              type: call
              call: "sap.create-order"
              with:
                location: "{{location}}"
            - name: notify
              type: call
              call: "email.send-message"
              with:
                to: "investigation-board@cn.ca"
                subject: "Derailment - Train {{train_id}}"
  consumes:
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: incidents
          path: "/table/incident"
          operations:
            - name: create-incident
              method: POST
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/PM_ORDER_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: orders
          path: "/A_MaintenanceOrder"
          operations:
            - name: create-maintenance-order
              method: POST
            - name: create-order
              method: POST
            - name: get-active-orders
              method: GET
    - type: http
      namespace: email
      baseUri: "https://graph.microsoft.com/v1.0"
      authentication:
        type: bearer
        token: "$secrets.graph_token"
      resources:
        - name: mail
          path: "/me/sendMail"
          operations:
            - name: send-message
              method: POST

Queries Dynatrace for performance anomalies in CN's customer-facing web applications.

naftiko: "0.5"
info:
  label: "Dynatrace Application Performance Monitor"
  description: "Queries Dynatrace for performance anomalies in CN's customer-facing web applications."
  tags:
    - monitoring
    - performance
    - dynatrace
capability:
  exposes:
    - type: mcp
      namespace: apm
      port: 8080
      tools:
        - name: get-app-anomalies
          description: "Retrieve open performance problems from Dynatrace for CN's applications."
          inputParameters:
            - name: time_range
              in: body
              type: string
              description: "Time range (e.g., last2hours, last24hours)."
          call: "dynatrace.get-problems"
          with:
            relativeTime: "{{time_range}}"
            status: "OPEN"
          outputParameters:
            - name: problems
              type: array
              mapping: "$.result"
            - name: total_count
              type: integer
              mapping: "$.totalCount"
  consumes:
    - type: http
      namespace: dynatrace
      baseUri: "https://cn.live.dynatrace.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.dynatrace_token"
      resources:
        - name: problems
          path: "/problems"
          operations:
            - name: get-problems
              method: GET

Processes Electronic Data Interchange waybill messages from shippers, validates them against Snowflake reference data, and creates ServiceNow tickets for exceptions.

naftiko: "0.5"
info:
  label: "EDI Waybill Exchange Processor"
  description: "Processes Electronic Data Interchange waybill messages from shippers, validates them against Snowflake reference data, and creates ServiceNow tickets for exceptions."
  tags:
    - logistics
    - edi
    - snowflake
    - servicenow
capability:
  exposes:
    - type: mcp
      namespace: edi-processing
      port: 8080
      tools:
        - name: process-edi-waybill
          description: "Validate an EDI waybill against reference data and create exception tickets if needed."
          inputParameters:
            - name: edi_message_id
              in: body
              type: string
              description: "EDI message identifier."
            - name: shipper_code
              in: body
              type: string
              description: "Shipper SCAC code."
            - name: commodity_code
              in: body
              type: string
              description: "STCC commodity code."
          steps:
            - name: validate-waybill
              type: call
              call: "snowflake.run-query"
              with:
                query: "SELECT CASE WHEN EXISTS (SELECT 1 FROM reference_commodities WHERE stcc_code='{{commodity_code}}') AND EXISTS (SELECT 1 FROM reference_shippers WHERE scac='{{shipper_code}}') THEN 'VALID' ELSE 'EXCEPTION' END as validation_status"
            - name: create-exception
              type: call
              call: "servicenow.create-incident"
              with:
                short_description: "EDI Waybill Exception: {{edi_message_id}}"
                category: "edi_exception"
                description: "EDI waybill {{edi_message_id}} from shipper {{shipper_code}} failed validation. Commodity: {{commodity_code}}."
  consumes:
    - type: http
      namespace: snowflake
      baseUri: "https://cn-railway.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-query
              method: POST
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: incidents
          path: "/table/incident"
          operations:
            - name: create-incident
              method: POST

Revokes Okta access, creates ServiceNow equipment return, closes Workday record.

naftiko: "0.5"
info:
  label: "Employee Offboarding Rail Orchestrator"
  description: "Revokes Okta access, creates ServiceNow equipment return, closes Workday record."
  tags:
    - hr
    - okta
    - servicenow
    - workday
capability:
  exposes:
    - type: mcp
      namespace: offboarding-rail
      port: 8080
      tools:
        - name: process-offboarding
          description: "Revoke access, return equipment, close record."
          inputParameters:
            - name: employee_id
              in: body
              type: string
              description: "Employee ID."
          steps:
            - name: get-employee
              type: call
              call: "workday.get-worker"
              with:
                worker_id: "{{employee_id}}"
            - name: revoke
              type: call
              call: "okta.deactivate-user"
              with:
                email: "{{get-employee.work_email}}"
            - name: return-equip
              type: call
              call: "servicenow.create-request"
              with:
                short_description: "Equipment return for employee {{employee_id}}"
  consumes:
    - type: http
      namespace: workday
      baseUri: "https://wd2-impl-services1.workday.com/ccx/api/v1"
      authentication:
        type: bearer
        token: "$secrets.workday_token"
      resources:
        - name: workers
          path: "/cn/workers"
          operations:
            - name: assign-crew
              method: POST
            - name: get-available-crew
              method: GET
            - name: get-work-hours
              method: GET
            - name: add-training-record
              method: POST
            - name: get-worker
              method: GET
    - type: http
      namespace: okta
      baseUri: "https://cn.okta.com/api/v1"
      authentication:
        type: apikey
        key: "Authorization"
        value: "$secrets.okta_api_token"
        placement: header
      resources:
        - name: users
          path: "/users"
          operations:
            - name: deactivate-user
              method: POST
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: requests
          path: "/table/sc_request"
          operations:
            - name: create-request
              method: POST

Creates ServiceNow incident, alerts response team via Slack, logs in SAP EHS.

naftiko: "0.5"
info:
  label: "Environmental Spill Response Orchestrator"
  description: "Creates ServiceNow incident, alerts response team via Slack, logs in SAP EHS."
  tags:
    - safety
    - servicenow
    - slack
    - sap
capability:
  exposes:
    - type: mcp
      namespace: spill-response
      port: 8080
      tools:
        - name: respond-to-spill
          description: "Respond to spill across ServiceNow, Slack, and SAP."
          inputParameters:
            - name: location
              in: body
              type: string
              description: "Location."
            - name: material_type
              in: body
              type: string
              description: "Material."
          steps:
            - name: create-incident
              type: call
              call: "servicenow.create-incident"
              with:
                short_description: "Spill: {{material_type}} at {{location}}"
                urgency: "1"
            - name: alert
              type: call
              call: "slack.post-message"
              with:
                channel: "#env-response"
                text: "Spill at {{location}}. Incident: {{create-incident.number}}"
            - name: log-ehs
              type: call
              call: "sap.create-ehs-event"
              with:
                location: "{{location}}"
  consumes:
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: incidents
          path: "/table/incident"
          operations:
            - name: create-incident
              method: POST
    - type: http
      namespace: slack
      baseUri: "https://slack.com/api"
      authentication:
        type: bearer
        token: "$secrets.slack_bot_token"
      resources:
        - name: messages
          path: "/chat.postMessage"
          operations:
            - name: post-message
              method: POST
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/EHS_EVENT_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: events
          path: "/A_EHSEvent"
          operations:
            - name: create-ehs-event
              method: POST

Queries F5 Networks load balancer pools to verify health of CN's critical web services.

naftiko: "0.5"
info:
  label: "F5 Networks Load Balancer Health Check"
  description: "Queries F5 Networks load balancer pools to verify health of CN's critical web services."
  tags:
    - infrastructure
    - networking
    - f5-networks
capability:
  exposes:
    - type: mcp
      namespace: network-health
      port: 8080
      tools:
        - name: check-lb-health
          description: "Check F5 load balancer pool member health status."
          inputParameters:
            - name: pool_name
              in: body
              type: string
              description: "F5 pool name."
          call: "f5.get-pool-members"
          with:
            pool_name: "{{pool_name}}"
          outputParameters:
            - name: members
              type: array
              mapping: "$.items"
            - name: available_count
              type: integer
              mapping: "$.available_count"
            - name: total_count
              type: integer
              mapping: "$.total_count"
  consumes:
    - type: http
      namespace: f5
      baseUri: "https://f5.cn.ca/mgmt/tm/ltm"
      authentication:
        type: basic
        username: "$secrets.f5_user"
        password: "$secrets.f5_password"
      resources:
        - name: pool-members
          path: "/pool/{{pool_name}}/members"
          inputParameters:
            - name: pool_name
              in: path
          operations:
            - name: get-pool-members
              method: GET

Reconciles SAP and Snowflake revenue, creates Jira tickets for discrepancies.

naftiko: "0.5"
info:
  label: "Freight Revenue Reconciliation Orchestrator"
  description: "Reconciles SAP and Snowflake revenue, creates Jira tickets for discrepancies."
  tags:
    - finance
    - sap
    - snowflake
    - jira
capability:
  exposes:
    - type: mcp
      namespace: revenue-recon
      port: 8080
      tools:
        - name: reconcile-freight-revenue
          description: "Reconcile revenue and create Jira tickets."
          inputParameters:
            - name: billing_period
              in: body
              type: string
              description: "Billing period."
          steps:
            - name: get-sap
              type: call
              call: "sap.get-billing-summary"
              with:
                period: "{{billing_period}}"
            - name: get-analytics
              type: call
              call: "snowflake.query-revenue"
              with:
                period: "{{billing_period}}"
            - name: create-ticket
              type: call
              call: "jira.create-issue"
              with:
                project: "FIN"
                summary: "Revenue discrepancy for {{billing_period}}"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/FI_BILLING_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: billing
          path: "/A_BillingSummary"
          operations:
            - name: get-billing-summary
              method: GET
    - type: http
      namespace: snowflake
      baseUri: "https://cn.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-analysis
              method: POST
            - name: query-revenue
              method: POST
            - name: run-safety-analysis
              method: POST
            - name: query-velocity
              method: POST
            - name: query-projections
              method: POST
            - name: query-volumes
              method: POST
            - name: query-metrics
              method: POST
            - name: run-geometry-analysis
              method: POST
    - type: http
      namespace: jira
      baseUri: "https://cn.atlassian.net/rest/api/3"
      authentication:
        type: basic
        username: "$secrets.jira_user"
        password: "$secrets.jira_api_token"
      resources:
        - name: issues
          path: "/issue"
          operations:
            - name: create-issue
              method: POST

Analyzes SAP fuel consumption, compares market prices, publishes Confluence recommendations.

naftiko: "0.5"
info:
  label: "Fuel Procurement Optimization Orchestrator"
  description: "Analyzes SAP fuel consumption, compares market prices, publishes Confluence recommendations."
  tags:
    - procurement
    - sap
    - confluence
capability:
  exposes:
    - type: mcp
      namespace: fuel-procurement
      port: 8080
      tools:
        - name: optimize-fuel-procurement
          description: "Analyze consumption, compare prices, publish recommendations."
          inputParameters:
            - name: forecast_months
              in: body
              type: number
              description: "Months to forecast."
          steps:
            - name: get-consumption
              type: call
              call: "sap.get-fuel-consumption"
              with:
                months: "{{forecast_months}}"
            - name: get-prices
              type: call
              call: "bloomberg.get-fuel-prices"
              with:
                commodity: "diesel"
            - name: publish
              type: call
              call: "confluence.create-page"
              with:
                space_key: "PROC"
                title: "Fuel Procurement Recommendations"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/MM_FUEL_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: fuel
          path: "/A_FuelConsumption"
          operations:
            - name: get-fuel-consumption
              method: GET
    - type: http
      namespace: bloomberg
      baseUri: "https://api.bloomberg.com/eap/v1"
      authentication:
        type: bearer
        token: "$secrets.bloomberg_token"
      resources:
        - name: prices
          path: "/data/commodities"
          operations:
            - name: get-fuel-prices
              method: GET
    - type: http
      namespace: confluence
      baseUri: "https://cn.atlassian.net/wiki/rest/api"
      authentication:
        type: basic
        username: "$secrets.confluence_user"
        password: "$secrets.confluence_api_token"
      resources:
        - name: content
          path: "/content"
          operations:
            - name: create-page
              method: POST

Triggers a GitHub Actions workflow for deploying infrastructure changes and reports the result to Teams.

naftiko: "0.5"
info:
  label: "GitHub Actions Infrastructure Deployment"
  description: "Triggers a GitHub Actions workflow for deploying infrastructure changes and reports the result to Teams."
  tags:
    - devops
    - infrastructure
    - github-actions
    - microsoft-teams
capability:
  exposes:
    - type: mcp
      namespace: infra-deployment
      port: 8080
      tools:
        - name: trigger-infra-deploy
          description: "Trigger a GitHub Actions workflow to deploy infrastructure changes and notify Teams."
          inputParameters:
            - name: repo
              in: body
              type: string
              description: "GitHub repository (org/repo)."
            - name: workflow_id
              in: body
              type: string
              description: "Workflow file name."
            - name: environment
              in: body
              type: string
              description: "Target environment."
          steps:
            - name: dispatch-workflow
              type: call
              call: "github.dispatch-workflow"
              with:
                owner_repo: "{{repo}}"
                workflow_id: "{{workflow_id}}"
                ref: "main"
                inputs: "{\"environment\": \"{{environment}}\"}"
            - name: notify-team
              type: call
              call: "msteams.send-message"
              with:
                channel_id: "infra_deployments"
                text: "Infrastructure deployment triggered: {{repo}} to {{environment}}."
  consumes:
    - type: http
      namespace: github
      baseUri: "https://api.github.com"
      authentication:
        type: bearer
        token: "$secrets.github_token"
      resources:
        - name: workflow-dispatches
          path: "/repos/{{owner_repo}}/actions/workflows/{{workflow_id}}/dispatches"
          inputParameters:
            - name: owner_repo
              in: path
            - name: workflow_id
              in: path
          operations:
            - name: dispatch-workflow
              method: POST
    - type: http
      namespace: msteams
      baseUri: "https://graph.microsoft.com/v1.0"
      authentication:
        type: bearer
        token: "$secrets.msgraph_token"
      resources:
        - name: channel-messages
          path: "/teams/{{channel_id}}/channels/general/messages"
          inputParameters:
            - name: channel_id
              in: path
          operations:
            - name: send-message
              method: POST

Retrieves the latest commit and CI status for a CN infrastructure repository.

naftiko: "0.5"
info:
  label: "GitHub Infrastructure Repo Status Lookup"
  description: "Retrieves the latest commit and CI status for a CN infrastructure repository."
  tags:
    - cicd
    - github
capability:
  exposes:
    - type: mcp
      namespace: infra-repos
      port: 8080
      tools:
        - name: get-repo-status
          description: "Look up latest commit and CI status for a GitHub repo."
          inputParameters:
            - name: repo_name
              in: body
              type: string
              description: "GitHub repository name."
          call: "github.get-branch-status"
          with:
            repo: "{{repo_name}}"
          outputParameters:
            - name: last_commit
              type: string
              mapping: "$.commit.sha"
            - name: ci_status
              type: string
              mapping: "$.commit.commit.verification.verified"
  consumes:
    - type: http
      namespace: github
      baseUri: "https://api.github.com"
      authentication:
        type: bearer
        token: "$secrets.github_token"
      resources:
        - name: repos
          path: "/repos/cn-rail/{{repo}}/branches/main"
          inputParameters:
            - name: repo
              in: path
          operations:
            - name: get-branch-status
              method: GET

Generates a Google Maps visualization of a train route between origin and destination for customer-facing shipment tracking.

naftiko: "0.5"
info:
  label: "Google Maps Route Visualization"
  description: "Generates a Google Maps visualization of a train route between origin and destination for customer-facing shipment tracking."
  tags:
    - operations
    - visualization
    - google-maps
capability:
  exposes:
    - type: mcp
      namespace: route-visualization
      port: 8080
      tools:
        - name: generate-route-map
          description: "Generate a Google Maps static map showing a train route between two points."
          inputParameters:
            - name: origin_lat
              in: body
              type: number
              description: "Origin latitude."
            - name: origin_lng
              in: body
              type: number
              description: "Origin longitude."
            - name: dest_lat
              in: body
              type: number
              description: "Destination latitude."
            - name: dest_lng
              in: body
              type: number
              description: "Destination longitude."
          call: "googlemaps.get-static-map"
          with:
            markers: "color:green|{{origin_lat}},{{origin_lng}}&markers=color:red|{{dest_lat}},{{dest_lng}}"
            size: "600x400"
            maptype: "roadmap"
          outputParameters:
            - name: map_url
              type: string
              mapping: "$.url"
  consumes:
    - type: http
      namespace: googlemaps
      baseUri: "https://maps.googleapis.com/maps/api"
      authentication:
        type: apiKey
        key: "$secrets.google_maps_api_key"
      resources:
        - name: static-map
          path: "/staticmap"
          operations:
            - name: get-static-map
              method: GET

Exports weekly rail operations metrics from Snowflake to a Google Sheet for executive stakeholder review.

naftiko: "0.5"
info:
  label: "Google Sheets Weekly Operations Summary"
  description: "Exports weekly rail operations metrics from Snowflake to a Google Sheet for executive stakeholder review."
  tags:
    - operations
    - reporting
    - snowflake
    - google-sheets
capability:
  exposes:
    - type: mcp
      namespace: ops-reporting
      port: 8080
      tools:
        - name: export-weekly-summary
          description: "Query Snowflake for weekly KPIs and write results to a Google Sheet."
          inputParameters:
            - name: week_ending
              in: body
              type: string
              description: "Week ending date in YYYY-MM-DD."
            - name: spreadsheet_id
              in: body
              type: string
              description: "Google Sheets spreadsheet ID."
          steps:
            - name: fetch-kpis
              type: call
              call: "snowflake.run-query"
              with:
                query: "SELECT kpi_name, actual_value, target_value, variance_pct FROM weekly_operations_kpis WHERE week_ending='{{week_ending}}' ORDER BY kpi_name"
            - name: write-sheet
              type: call
              call: "google-sheets.update-values"
              with:
                spreadsheet_id: "{{spreadsheet_id}}"
                range: "WeeklyOps!A1"
                values: "{{fetch-kpis.results}}"
  consumes:
    - type: http
      namespace: snowflake
      baseUri: "https://cn-railway.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-query
              method: POST
    - type: http
      namespace: google-sheets
      baseUri: "https://sheets.googleapis.com/v4/spreadsheets"
      authentication:
        type: bearer
        token: "$secrets.google_sheets_token"
      resources:
        - name: values
          path: "/{{spreadsheet_id}}/values/{{range}}"
          inputParameters:
            - name: spreadsheet_id
              in: path
            - name: range
              in: path
          operations:
            - name: update-values
              method: PUT

Validates SAP capacity, creates waybill, confirms with customer via Salesforce.

naftiko: "0.5"
info:
  label: "Grain Shipment Booking Orchestrator"
  description: "Validates SAP capacity, creates waybill, confirms with customer via Salesforce."
  tags:
    - logistics
    - sap
    - salesforce
capability:
  exposes:
    - type: mcp
      namespace: grain-booking
      port: 8080
      tools:
        - name: process-grain-booking
          description: "Process grain booking across SAP and Salesforce."
          inputParameters:
            - name: customer_id
              in: body
              type: string
              description: "Customer ID."
            - name: origin_station
              in: body
              type: string
              description: "Origin station."
            - name: cars_requested
              in: body
              type: number
              description: "Cars requested."
          steps:
            - name: check
              type: call
              call: "sap.check-availability"
              with:
                station: "{{origin_station}}"
            - name: create-waybill
              type: call
              call: "edi.create-waybill"
              with:
                customer: "{{customer_id}}"
            - name: confirm
              type: call
              call: "salesforce.update-case"
              with:
                customer_id: "{{customer_id}}"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/TM_CAR_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: cars
          path: "/A_CarAvailability"
          operations:
            - name: check-availability
              method: GET
    - type: http
      namespace: edi
      baseUri: "https://api.cn.ca/edi/v1"
      authentication:
        type: bearer
        token: "$secrets.edi_token"
      resources:
        - name: waybills
          path: "/waybills"
          operations:
            - name: create-waybill
              method: POST
    - type: http
      namespace: salesforce
      baseUri: "https://cn.my.salesforce.com/services/data/v58.0"
      authentication:
        type: bearer
        token: "$secrets.salesforce_token"
      resources:
        - name: objects
          path: "/sobjects"
          operations:
            - name: send-notification
              method: POST
            - name: update-case
              method: PATCH
            - name: get-account
              method: GET
            - name: get-contracts
              method: GET

Validates a hazardous materials shipment against Transport Canada regulations, checking UN numbers, proper shipping names, and container specifications.

naftiko: "0.5"
info:
  label: "Hazmat Shipment Compliance Checker"
  description: "Validates a hazardous materials shipment against Transport Canada regulations, checking UN numbers, proper shipping names, and container specifications."
  tags:
    - safety
    - hazmat
    - compliance
    - snowflake
capability:
  exposes:
    - type: mcp
      namespace: hazmat-compliance
      port: 8080
      tools:
        - name: validate-hazmat-shipment
          description: "Validate a hazmat shipment's compliance with regulatory requirements."
          inputParameters:
            - name: waybill_number
              in: body
              type: string
              description: "Waybill number for the shipment."
            - name: un_number
              in: body
              type: string
              description: "UN identification number for the hazardous material."
          call: "snowflake.run-query"
          with:
            query: "SELECT w.waybill_number, w.commodity, r.un_number, r.proper_shipping_name, r.packaging_group, CASE WHEN w.container_spec = r.required_container THEN 'COMPLIANT' ELSE 'NON_COMPLIANT' END as compliance_status FROM waybills w JOIN hazmat_regulations r ON w.un_number = r.un_number WHERE w.waybill_number = '{{waybill_number}}'"
          outputParameters:
            - name: compliance_status
              type: string
              mapping: "$.data[0][5]"
            - name: proper_shipping_name
              type: string
              mapping: "$.data[0][3]"
            - name: packaging_group
              type: string
              mapping: "$.data[0][4]"
  consumes:
    - type: http
      namespace: snowflake
      baseUri: "https://cn-railway.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-query
              method: POST

Manages customer communications through HubSpot for service disruption notifications and rate change updates.

naftiko: "0.5"
info:
  label: "HubSpot Customer Communications Manager"
  description: "Manages customer communications through HubSpot for service disruption notifications and rate change updates."
  tags:
    - customer-communications
    - crm
    - hubspot
capability:
  exposes:
    - type: mcp
      namespace: customer-comms
      port: 8080
      tools:
        - name: send-service-notification
          description: "Send a service notification email to affected customers via HubSpot."
          inputParameters:
            - name: list_id
              in: body
              type: string
              description: "HubSpot contact list ID for affected customers."
            - name: subject
              in: body
              type: string
              description: "Email subject."
            - name: body_html
              in: body
              type: string
              description: "Email body in HTML."
          call: "hubspot.send-email"
          with:
            list_id: "{{list_id}}"
            subject: "{{subject}}"
            body: "{{body_html}}"
          outputParameters:
            - name: email_id
              type: string
              mapping: "$.id"
            - name: status
              type: string
              mapping: "$.status"
  consumes:
    - type: http
      namespace: hubspot
      baseUri: "https://api.hubapi.com"
      authentication:
        type: bearer
        token: "$secrets.hubspot_token"
      resources:
        - name: emails
          path: "/marketing/v3/emails"
          operations:
            - name: send-email
              method: POST

Tracks SAP capital projects, syncs Jira milestones, refreshes Power BI.

naftiko: "0.5"
info:
  label: "Infrastructure Capital Project Tracker Orchestrator"
  description: "Tracks SAP capital projects, syncs Jira milestones, refreshes Power BI."
  tags:
    - operations
    - sap
    - jira
    - power-bi
capability:
  exposes:
    - type: mcp
      namespace: capital-projects
      port: 8080
      tools:
        - name: track-capital-projects
          description: "Track projects, sync milestones, refresh dashboard."
          inputParameters:
            - name: project_id
              in: body
              type: string
              description: "SAP project ID."
          steps:
            - name: get-status
              type: call
              call: "sap.get-project-status"
              with:
                project_id: "{{project_id}}"
            - name: sync
              type: call
              call: "jira.create-issue"
              with:
                project: "INFRA"
                summary: "Capital project: {{project_id}}"
            - name: refresh
              type: call
              call: "powerbi.trigger-refresh"
              with:
                dataset_id: "capital-projects-ds"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/PS_PROJECT_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: projects
          path: "/A_Project('{{project_id}}')"
          inputParameters:
            - name: project_id
              in: path
          operations:
            - name: get-project-status
              method: GET
    - type: http
      namespace: jira
      baseUri: "https://cn.atlassian.net/rest/api/3"
      authentication:
        type: basic
        username: "$secrets.jira_user"
        password: "$secrets.jira_api_token"
      resources:
        - name: issues
          path: "/issue"
          operations:
            - name: create-issue
              method: POST
    - type: http
      namespace: powerbi
      baseUri: "https://api.powerbi.com/v1.0/myorg"
      authentication:
        type: bearer
        token: "$secrets.powerbi_token"
      resources:
        - name: datasets
          path: "/datasets/{{dataset_id}}/refreshes"
          operations:
            - name: trigger-refresh
              method: POST

Tracks an intermodal container from port to destination, combining GPS data with terminal gate events, and updates the customer portal in Salesforce.

naftiko: "0.5"
info:
  label: "Intermodal Container Tracking Pipeline"
  description: "Tracks an intermodal container from port to destination, combining GPS data with terminal gate events, and updates the customer portal in Salesforce."
  tags:
    - intermodal
    - tracking
    - salesforce
    - microsoft-teams
capability:
  exposes:
    - type: mcp
      namespace: intermodal-tracking
      port: 8080
      tools:
        - name: track-container
          description: "Retrieve intermodal container tracking data and update the customer record in Salesforce."
          inputParameters:
            - name: container_id
              in: body
              type: string
              description: "Container number."
            - name: customer_account
              in: body
              type: string
              description: "Salesforce customer account ID."
          steps:
            - name: get-position
              type: call
              call: "tracking.get-position"
              with:
                equipment_id: "{{container_id}}"
            - name: update-salesforce
              type: call
              call: "salesforce.update-shipment"
              with:
                account_id: "{{customer_account}}"
                container_id: "{{container_id}}"
                latitude: "{{get-position.latitude}}"
                longitude: "{{get-position.longitude}}"
                eta: "{{get-position.estimated_arrival}}"
            - name: notify-customer-team
              type: call
              call: "msteams.send-message"
              with:
                channel_id: "intermodal_ops"
                text: "Container {{container_id}} update: Position ({{get-position.latitude}}, {{get-position.longitude}}). ETA: {{get-position.estimated_arrival}}. Customer: {{customer_account}}."
  consumes:
    - type: http
      namespace: tracking
      baseUri: "https://tracking-api.cn.ca/v2"
      authentication:
        type: bearer
        token: "$secrets.cn_tracking_token"
      resources:
        - name: positions
          path: "/equipment/{{equipment_id}}/position"
          inputParameters:
            - name: equipment_id
              in: path
          operations:
            - name: get-position
              method: GET
    - type: http
      namespace: salesforce
      baseUri: "https://cn.my.salesforce.com/services/data/v59.0"
      authentication:
        type: bearer
        token: "$secrets.salesforce_token"
      resources:
        - name: shipments
          path: "/sobjects/Shipment__c/{{account_id}}"
          inputParameters:
            - name: account_id
              in: path
          operations:
            - name: update-shipment
              method: PATCH
    - type: http
      namespace: msteams
      baseUri: "https://graph.microsoft.com/v1.0"
      authentication:
        type: bearer
        token: "$secrets.msgraph_token"
      resources:
        - name: channel-messages
          path: "/teams/{{channel_id}}/channels/general/messages"
          inputParameters:
            - name: channel_id
              in: path
          operations:
            - name: send-message
              method: POST

Collects SAP terminal throughput, analyzes in Snowflake, publishes to Power BI.

naftiko: "0.5"
info:
  label: "Intermodal Terminal Throughput Orchestrator"
  description: "Collects SAP terminal throughput, analyzes in Snowflake, publishes to Power BI."
  tags:
    - operations
    - sap
    - snowflake
    - power-bi
capability:
  exposes:
    - type: mcp
      namespace: terminal-throughput
      port: 8080
      tools:
        - name: generate-throughput-report
          description: "Collect SAP data, analyze, publish to Power BI."
          inputParameters:
            - name: terminal_code
              in: body
              type: string
              description: "Terminal code."
            - name: week_number
              in: body
              type: number
              description: "Week number."
          steps:
            - name: get-data
              type: call
              call: "sap.get-terminal-metrics"
              with:
                terminal: "{{terminal_code}}"
            - name: analyze
              type: call
              call: "snowflake.run-analysis"
              with:
                terminal: "{{terminal_code}}"
            - name: refresh
              type: call
              call: "powerbi.trigger-refresh"
              with:
                dataset_id: "terminal-ds"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/TM_TERMINAL_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: metrics
          path: "/A_TerminalMetrics"
          operations:
            - name: get-terminal-metrics
              method: GET
    - type: http
      namespace: snowflake
      baseUri: "https://cn.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-analysis
              method: POST
            - name: query-revenue
              method: POST
            - name: run-safety-analysis
              method: POST
            - name: query-velocity
              method: POST
            - name: query-projections
              method: POST
            - name: query-volumes
              method: POST
            - name: query-metrics
              method: POST
            - name: run-geometry-analysis
              method: POST
    - type: http
      namespace: powerbi
      baseUri: "https://api.powerbi.com/v1.0/myorg"
      authentication:
        type: bearer
        token: "$secrets.powerbi_token"
      resources:
        - name: datasets
          path: "/datasets/{{dataset_id}}/refreshes"
          operations:
            - name: trigger-refresh
              method: POST

Retrieves sprint progress from the Jira track maintenance project and returns open task counts and completion metrics.

naftiko: "0.5"
info:
  label: "Jira Track Maintenance Project Tracker"
  description: "Retrieves sprint progress from the Jira track maintenance project and returns open task counts and completion metrics."
  tags:
    - project-management
    - maintenance
    - jira
capability:
  exposes:
    - type: mcp
      namespace: maintenance-tracking
      port: 8080
      tools:
        - name: get-maintenance-sprint
          description: "Fetch current sprint progress from the Jira track maintenance board."
          inputParameters:
            - name: board_id
              in: body
              type: string
              description: "Jira board ID for track maintenance."
          call: "jira.get-active-sprint"
          with:
            board_id: "{{board_id}}"
          outputParameters:
            - name: sprint_name
              type: string
              mapping: "$.values[0].name"
            - name: start_date
              type: string
              mapping: "$.values[0].startDate"
            - name: end_date
              type: string
              mapping: "$.values[0].endDate"
  consumes:
    - type: http
      namespace: jira
      baseUri: "https://cn-railway.atlassian.net/rest/agile/1.0"
      authentication:
        type: basic
        username: "$secrets.jira_user"
        password: "$secrets.jira_api_token"
      resources:
        - name: sprints
          path: "/board/{{board_id}}/sprint"
          inputParameters:
            - name: board_id
              in: path
          operations:
            - name: get-active-sprint
              method: GET

Publishes investor relations content on CN's LinkedIn company page for earnings releases and corporate updates.

naftiko: "0.5"
info:
  label: "LinkedIn Investor Relations Publisher"
  description: "Publishes investor relations content on CN's LinkedIn company page for earnings releases and corporate updates."
  tags:
    - investor-relations
    - communications
    - linkedin
capability:
  exposes:
    - type: mcp
      namespace: investor-comms
      port: 8080
      tools:
        - name: publish-ir-post
          description: "Post investor relations content to the CN LinkedIn company page."
          inputParameters:
            - name: text
              in: body
              type: string
              description: "Post content text."
            - name: link_url
              in: body
              type: string
              description: "Link to the investor relations page."
          call: "linkedin.create-post"
          with:
            author: "urn:li:organization:{{cn_org_id}}"
            text: "{{text}}"
            link: "{{link_url}}"
          outputParameters:
            - name: post_id
              type: string
              mapping: "$.id"
  consumes:
    - type: http
      namespace: linkedin
      baseUri: "https://api.linkedin.com/v2"
      authentication:
        type: bearer
        token: "$secrets.linkedin_token"
      resources:
        - name: ugcPosts
          path: "/ugcPosts"
          operations:
            - name: create-post
              method: POST

Collects SAP emission data, validates against EPA standards, files compliance reports.

naftiko: "0.5"
info:
  label: "Locomotive Emission Compliance Orchestrator"
  description: "Collects SAP emission data, validates against EPA standards, files compliance reports."
  tags:
    - compliance
    - sap
    - servicenow
capability:
  exposes:
    - type: mcp
      namespace: emission-compliance
      port: 8080
      tools:
        - name: check-emission-compliance
          description: "Collect emissions, validate, file reports."
          inputParameters:
            - name: locomotive_id
              in: body
              type: string
              description: "Locomotive ID."
            - name: quarter
              in: body
              type: string
              description: "Quarter."
          steps:
            - name: get-emissions
              type: call
              call: "sap.get-emission-data"
              with:
                equipment: "{{locomotive_id}}"
            - name: validate
              type: call
              call: "compliance.validate-epa"
              with:
                locomotive_id: "{{locomotive_id}}"
            - name: file
              type: call
              call: "servicenow.create-request"
              with:
                short_description: "Emission report - {{locomotive_id}}"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/EHS_EMISSION_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: emissions
          path: "/A_EmissionData"
          operations:
            - name: get-emission-data
              method: GET
    - type: http
      namespace: compliance
      baseUri: "https://api.cn.ca/compliance/v1"
      authentication:
        type: bearer
        token: "$secrets.compliance_token"
      resources:
        - name: validation
          path: "/epa-validate"
          operations:
            - name: validate-epa
              method: POST
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: requests
          path: "/table/sc_request"
          operations:
            - name: create-request
              method: POST

Analyzes locomotive telemetry from Databricks, creates SAP work order, and schedules crew via Workday.

naftiko: "0.5"
info:
  label: "Locomotive Predictive Maintenance Orchestrator"
  description: "Analyzes locomotive telemetry from Databricks, creates SAP work order, and schedules crew via Workday."
  tags:
    - maintenance
    - databricks
    - sap
    - workday
capability:
  exposes:
    - type: mcp
      namespace: loco-maint
      port: 8080
      tools:
        - name: trigger-predictive-maintenance
          description: "Analyze telemetry, create SAP order, schedule crew."
          inputParameters:
            - name: locomotive_id
              in: body
              type: string
              description: "Locomotive ID."
            - name: anomaly_type
              in: body
              type: string
              description: "Anomaly type."
          steps:
            - name: analyze
              type: call
              call: "databricks.run-model"
              with:
                locomotive_id: "{{locomotive_id}}"
            - name: create-order
              type: call
              call: "sap.create-maintenance-order"
              with:
                equipment: "{{locomotive_id}}"
            - name: schedule
              type: call
              call: "workday.assign-crew"
              with:
                order: "{{create-order.order_number}}"
  consumes:
    - type: http
      namespace: databricks
      baseUri: "https://cn-databricks.cloud.databricks.com/api/2.0"
      authentication:
        type: bearer
        token: "$secrets.databricks_token"
      resources:
        - name: jobs
          path: "/jobs/run-now"
          operations:
            - name: run-model
              method: POST
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/PM_ORDER_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: orders
          path: "/A_MaintenanceOrder"
          operations:
            - name: create-maintenance-order
              method: POST
            - name: create-order
              method: POST
            - name: get-active-orders
              method: GET
    - type: http
      namespace: workday
      baseUri: "https://wd2-impl-services1.workday.com/ccx/api/v1"
      authentication:
        type: bearer
        token: "$secrets.workday_token"
      resources:
        - name: workers
          path: "/cn/workers"
          operations:
            - name: assign-crew
              method: POST
            - name: get-available-crew
              method: GET
            - name: get-work-hours
              method: GET
            - name: add-training-record
              method: POST
            - name: get-worker
              method: GET

Sends community relations newsletters to residents near CN rail corridors about safety awareness and construction updates.

naftiko: "0.5"
info:
  label: "MailChimp Community Newsletter Sender"
  description: "Sends community relations newsletters to residents near CN rail corridors about safety awareness and construction updates."
  tags:
    - communications
    - community-relations
    - mailchimp
capability:
  exposes:
    - type: mcp
      namespace: community-comms
      port: 8080
      tools:
        - name: send-community-newsletter
          description: "Create and send a community newsletter via MailChimp."
          inputParameters:
            - name: list_id
              in: body
              type: string
              description: "MailChimp list ID for the community segment."
            - name: subject
              in: body
              type: string
              description: "Newsletter subject line."
            - name: template_id
              in: body
              type: string
              description: "MailChimp template ID."
          call: "mailchimp.create-campaign"
          with:
            type: "regular"
            recipients_list_id: "{{list_id}}"
            subject_line: "{{subject}}"
            template_id: "{{template_id}}"
            from_name: "Canadian National Railway"
          outputParameters:
            - name: campaign_id
              type: string
              mapping: "$.id"
            - name: status
              type: string
              mapping: "$.status"
  consumes:
    - type: http
      namespace: mailchimp
      baseUri: "https://us1.api.mailchimp.com/3.0"
      authentication:
        type: basic
        username: "anystring"
        password: "$secrets.mailchimp_api_key"
      resources:
        - name: campaigns
          path: "/campaigns"
          operations:
            - name: create-campaign
              method: POST

Queries yard performance metrics from Snowflake and exports them to a Microsoft Excel template on SharePoint for regional operations review.

naftiko: "0.5"
info:
  label: "Microsoft Excel Yard Performance Exporter"
  description: "Queries yard performance metrics from Snowflake and exports them to a Microsoft Excel template on SharePoint for regional operations review."
  tags:
    - operations
    - reporting
    - snowflake
    - sharepoint
capability:
  exposes:
    - type: mcp
      namespace: yard-reporting
      port: 8080
      tools:
        - name: export-yard-metrics
          description: "Pull yard performance data from Snowflake and upload to SharePoint as an Excel report."
          inputParameters:
            - name: yard_code
              in: body
              type: string
              description: "Yard location code."
            - name: month
              in: body
              type: string
              description: "Report month in YYYY-MM."
          steps:
            - name: fetch-metrics
              type: call
              call: "snowflake.run-query"
              with:
                query: "SELECT metric_name, metric_value, target_value, CASE WHEN metric_value >= target_value THEN 'MET' ELSE 'MISSED' END as status FROM yard_kpis WHERE yard_code='{{yard_code}}' AND report_month='{{month}}'"
            - name: upload-report
              type: call
              call: "sharepoint.upload-file"
              with:
                site_id: "cn_operations"
                folder_path: "YardReports/{{yard_code}}/{{month}}"
                file_name: "yard_performance_{{yard_code}}_{{month}}.xlsx"
                content: "{{fetch-metrics.results}}"
  consumes:
    - type: http
      namespace: snowflake
      baseUri: "https://cn-railway.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-query
              method: POST
    - type: http
      namespace: sharepoint
      baseUri: "https://graph.microsoft.com/v1.0/sites"
      authentication:
        type: bearer
        token: "$secrets.msgraph_token"
      resources:
        - name: drive-items
          path: "/{{site_id}}/drive/root:/{{folder_path}}/{{file_name}}:/content"
          inputParameters:
            - name: site_id
              in: path
            - name: folder_path
              in: path
            - name: file_name
              in: path
          operations:
            - name: upload-file
              method: PUT

Analyzes Snowflake velocity metrics, creates Jira initiatives, publishes to Confluence.

naftiko: "0.5"
info:
  label: "Network Velocity Improvement Orchestrator"
  description: "Analyzes Snowflake velocity metrics, creates Jira initiatives, publishes to Confluence."
  tags:
    - operations
    - snowflake
    - jira
    - confluence
capability:
  exposes:
    - type: mcp
      namespace: network-velocity
      port: 8080
      tools:
        - name: improve-network-velocity
          description: "Analyze velocity, create initiatives, publish."
          inputParameters:
            - name: corridor
              in: body
              type: string
              description: "Corridor."
            - name: period
              in: body
              type: string
              description: "Period."
          steps:
            - name: get-data
              type: call
              call: "snowflake.query-velocity"
              with:
                corridor: "{{corridor}}"
            - name: create-initiative
              type: call
              call: "jira.create-issue"
              with:
                project: "OPS"
                summary: "Velocity - {{corridor}}"
            - name: publish
              type: call
              call: "confluence.create-page"
              with:
                space_key: "OPS"
                title: "Velocity - {{corridor}} - {{period}}"
  consumes:
    - type: http
      namespace: snowflake
      baseUri: "https://cn.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-analysis
              method: POST
            - name: query-revenue
              method: POST
            - name: run-safety-analysis
              method: POST
            - name: query-velocity
              method: POST
            - name: query-projections
              method: POST
            - name: query-volumes
              method: POST
            - name: query-metrics
              method: POST
            - name: run-geometry-analysis
              method: POST
    - type: http
      namespace: jira
      baseUri: "https://cn.atlassian.net/rest/api/3"
      authentication:
        type: basic
        username: "$secrets.jira_user"
        password: "$secrets.jira_api_token"
      resources:
        - name: issues
          path: "/issue"
          operations:
            - name: create-issue
              method: POST
    - type: http
      namespace: confluence
      baseUri: "https://cn.atlassian.net/wiki/rest/api"
      authentication:
        type: basic
        username: "$secrets.confluence_user"
        password: "$secrets.confluence_api_token"
      resources:
        - name: content
          path: "/content"
          operations:
            - name: create-page
              method: POST

Enrolls new hires in Pluralsight safety training, records in Workday, notifies via Slack.

naftiko: "0.5"
info:
  label: "New Employee Safety Training Orchestrator"
  description: "Enrolls new hires in Pluralsight safety training, records in Workday, notifies via Slack."
  tags:
    - hr
    - pluralsight
    - workday
    - slack
capability:
  exposes:
    - type: mcp
      namespace: safety-training
      port: 8080
      tools:
        - name: enroll-safety-training
          description: "Enroll in training, record, notify supervisors."
          inputParameters:
            - name: employee_id
              in: body
              type: string
              description: "Employee ID."
            - name: department
              in: body
              type: string
              description: "Department."
          steps:
            - name: enroll
              type: call
              call: "pluralsight.assign-course"
              with:
                user_id: "{{employee_id}}"
                course: "rail-safety"
            - name: record
              type: call
              call: "workday.add-training-record"
              with:
                worker_id: "{{employee_id}}"
            - name: notify
              type: call
              call: "slack.post-message"
              with:
                channel: "#{{department}}-ops"
                text: "New hire {{employee_id}} enrolled in safety training"
  consumes:
    - type: http
      namespace: pluralsight
      baseUri: "https://api.pluralsight.com/v1"
      authentication:
        type: bearer
        token: "$secrets.pluralsight_token"
      resources:
        - name: assignments
          path: "/assignments"
          operations:
            - name: assign-course
              method: POST
    - type: http
      namespace: workday
      baseUri: "https://wd2-impl-services1.workday.com/ccx/api/v1"
      authentication:
        type: bearer
        token: "$secrets.workday_token"
      resources:
        - name: workers
          path: "/cn/workers"
          operations:
            - name: assign-crew
              method: POST
            - name: get-available-crew
              method: GET
            - name: get-work-hours
              method: GET
            - name: add-training-record
              method: POST
            - name: get-worker
              method: GET
    - type: http
      namespace: slack
      baseUri: "https://slack.com/api"
      authentication:
        type: bearer
        token: "$secrets.slack_bot_token"
      resources:
        - name: messages
          path: "/chat.postMessage"
          operations:
            - name: post-message
              method: POST

Fetches application performance metrics from New Relic for CN's critical rail dispatch and customer portal services.

naftiko: "0.5"
info:
  label: "New Relic Service Health Dashboard"
  description: "Fetches application performance metrics from New Relic for CN's critical rail dispatch and customer portal services."
  tags:
    - monitoring
    - devops
    - new-relic
capability:
  exposes:
    - type: mcp
      namespace: service-health
      port: 8080
      tools:
        - name: get-service-health
          description: "Retrieve application health metrics from New Relic."
          inputParameters:
            - name: app_name
              in: body
              type: string
              description: "New Relic application name."
          call: "newrelic.get-app-metrics"
          with:
            app_name: "{{app_name}}"
          outputParameters:
            - name: error_rate
              type: number
              mapping: "$.application.application_summary.error_rate"
            - name: response_time
              type: number
              mapping: "$.application.application_summary.response_time"
            - name: throughput
              type: number
              mapping: "$.application.application_summary.throughput"
  consumes:
    - type: http
      namespace: newrelic
      baseUri: "https://api.newrelic.com/v2"
      authentication:
        type: apiKey
        key: "$secrets.newrelic_api_key"
      resources:
        - name: applications
          path: "/applications.json"
          operations:
            - name: get-app-metrics
              method: GET

Retrieves freight billing data from Oracle E-Business Suite and generates customer invoices for intermodal and carload shipments.

naftiko: "0.5"
info:
  label: "Oracle EBS Freight Billing Processor"
  description: "Retrieves freight billing data from Oracle E-Business Suite and generates customer invoices for intermodal and carload shipments."
  tags:
    - finance
    - billing
    - oracle-ebs
capability:
  exposes:
    - type: mcp
      namespace: freight-billing
      port: 8080
      tools:
        - name: get-freight-invoices
          description: "Look up freight billing details from Oracle E-Business Suite for a customer."
          inputParameters:
            - name: customer_id
              in: body
              type: string
              description: "Oracle customer account ID."
            - name: billing_period
              in: body
              type: string
              description: "Billing period in YYYY-MM format."
          call: "oracle-ebs.get-invoices"
          with:
            customer_id: "{{customer_id}}"
            period: "{{billing_period}}"
          outputParameters:
            - name: invoices
              type: array
              mapping: "$.items"
            - name: total_amount
              type: number
              mapping: "$.total_revenue"
            - name: invoice_count
              type: integer
              mapping: "$.count"
  consumes:
    - type: http
      namespace: oracle-ebs
      baseUri: "https://erp.cn.ca/webservices/rest/freight_billing"
      authentication:
        type: basic
        username: "$secrets.oracle_ebs_user"
        password: "$secrets.oracle_ebs_password"
      resources:
        - name: invoices
          path: "/v1/invoices"
          operations:
            - name: get-invoices
              method: GET

Retrieves freight billing details from Oracle E-Business Suite by waybill number.

naftiko: "0.5"
info:
  label: "Oracle Freight Billing Lookup"
  description: "Retrieves freight billing details from Oracle E-Business Suite by waybill number."
  tags:
    - finance
    - oracle
capability:
  exposes:
    - type: mcp
      namespace: freight-billing
      port: 8080
      tools:
        - name: get-freight-bill
          description: "Look up freight billing by waybill number."
          inputParameters:
            - name: waybill_number
              in: body
              type: string
              description: "Waybill number."
          call: "oracle.get-bill"
          with:
            waybill: "{{waybill_number}}"
          outputParameters:
            - name: total_charges
              type: number
              mapping: "$.BillingAmount"
            - name: currency
              type: string
              mapping: "$.Currency"
  consumes:
    - type: http
      namespace: oracle
      baseUri: "https://oracle-ebs.cn.ca/ords/freight/v1"
      authentication:
        type: basic
        username: "$secrets.oracle_user"
        password: "$secrets.oracle_password"
      resources:
        - name: bills
          path: "/billing/{{waybill}}"
          inputParameters:
            - name: waybill
              in: path
          operations:
            - name: get-bill
              method: GET

Retrieves firewall security policies from Palo Alto Networks Panorama for CN's network perimeter compliance review.

naftiko: "0.5"
info:
  label: "Palo Alto Networks Security Audit"
  description: "Retrieves firewall security policies from Palo Alto Networks Panorama for CN's network perimeter compliance review."
  tags:
    - security
    - compliance
    - palo-alto-networks
capability:
  exposes:
    - type: mcp
      namespace: network-security
      port: 8080
      tools:
        - name: audit-firewall-rules
          description: "Fetch current firewall rules from Palo Alto Panorama for security audit."
          inputParameters:
            - name: device_group
              in: body
              type: string
              description: "Palo Alto device group."
          call: "paloalto.get-security-rules"
          with:
            device_group: "{{device_group}}"
          outputParameters:
            - name: rules
              type: array
              mapping: "$.result.entry"
            - name: total_rules
              type: integer
              mapping: "$.result.@count"
  consumes:
    - type: http
      namespace: paloalto
      baseUri: "https://panorama.cn.ca/restapi/v10.2"
      authentication:
        type: apiKey
        key: "$secrets.paloalto_api_key"
      resources:
        - name: security-rules
          path: "/Policies/SecurityRules"
          operations:
            - name: get-security-rules
              method: GET

Assigns mandatory rail safety training courses in Pluralsight to new crew members and tracks completion.

naftiko: "0.5"
info:
  label: "Pluralsight Safety Training Assigner"
  description: "Assigns mandatory rail safety training courses in Pluralsight to new crew members and tracks completion."
  tags:
    - training
    - safety
    - pluralsight
capability:
  exposes:
    - type: mcp
      namespace: safety-training
      port: 8080
      tools:
        - name: assign-safety-training
          description: "Assign Pluralsight safety training courses to a crew member."
          inputParameters:
            - name: user_email
              in: body
              type: string
              description: "Employee email."
            - name: course_id
              in: body
              type: string
              description: "Pluralsight course ID."
            - name: due_date
              in: body
              type: string
              description: "Completion due date."
          call: "pluralsight.assign-course"
          with:
            email: "{{user_email}}"
            course_id: "{{course_id}}"
            due_date: "{{due_date}}"
          outputParameters:
            - name: assignment_id
              type: string
              mapping: "$.id"
            - name: status
              type: string
              mapping: "$.status"
  consumes:
    - type: http
      namespace: pluralsight
      baseUri: "https://api.pluralsight.com/api/v1"
      authentication:
        type: bearer
        token: "$secrets.pluralsight_token"
      resources:
        - name: assignments
          path: "/courses/{{course_id}}/assignments"
          inputParameters:
            - name: course_id
              in: path
          operations:
            - name: assign-course
              method: POST

Monitors PTC health via Datadog, creates ServiceNow incidents, notifies via Slack.

naftiko: "0.5"
info:
  label: "Positive Train Control Health Orchestrator"
  description: "Monitors PTC health via Datadog, creates ServiceNow incidents, notifies via Slack."
  tags:
    - operations
    - datadog
    - servicenow
    - slack
capability:
  exposes:
    - type: mcp
      namespace: ptc-health
      port: 8080
      tools:
        - name: check-ptc-health
          description: "Monitor PTC, create incidents, notify engineering."
          inputParameters:
            - name: territory
              in: body
              type: string
              description: "PTC territory."
          steps:
            - name: check
              type: call
              call: "datadog.get-ptc-monitors"
              with:
                territory: "{{territory}}"
            - name: create-incident
              type: call
              call: "servicenow.create-incident"
              with:
                short_description: "PTC alert in {{territory}}"
            - name: notify
              type: call
              call: "slack.post-message"
              with:
                channel: "#ptc-engineering"
                text: "PTC alert in {{territory}}"
  consumes:
    - type: http
      namespace: datadog
      baseUri: "https://api.datadoghq.com/api/v1"
      authentication:
        type: apikey
        key: "DD-API-KEY"
        value: "$secrets.datadog_api_key"
        placement: header
      resources:
        - name: monitors
          path: "/monitor"
          operations:
            - name: get-ptc-monitors
              method: GET
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: incidents
          path: "/table/incident"
          operations:
            - name: create-incident
              method: POST
    - type: http
      namespace: slack
      baseUri: "https://slack.com/api"
      authentication:
        type: bearer
        token: "$secrets.slack_bot_token"
      resources:
        - name: messages
          path: "/chat.postMessage"
          operations:
            - name: post-message
              method: POST

Runs Postman API test collections to validate CN's customer-facing rail tracking and waybill APIs.

naftiko: "0.5"
info:
  label: "Postman Rail API Test Suite"
  description: "Runs Postman API test collections to validate CN's customer-facing rail tracking and waybill APIs."
  tags:
    - qa
    - api-testing
    - postman
capability:
  exposes:
    - type: mcp
      namespace: api-testing
      port: 8080
      tools:
        - name: run-api-tests
          description: "Execute a Postman collection test run for CN's rail APIs."
          inputParameters:
            - name: collection_id
              in: body
              type: string
              description: "Postman collection UID."
            - name: environment_id
              in: body
              type: string
              description: "Postman environment UID."
          call: "postman.run-collection"
          with:
            collection: "{{collection_id}}"
            environment: "{{environment_id}}"
          outputParameters:
            - name: run_id
              type: string
              mapping: "$.run.id"
            - name: status
              type: string
              mapping: "$.run.status"
            - name: total_tests
              type: integer
              mapping: "$.run.stats.tests.total"
            - name: failed_tests
              type: integer
              mapping: "$.run.stats.tests.failed"
  consumes:
    - type: http
      namespace: postman
      baseUri: "https://api.getpostman.com"
      authentication:
        type: apiKey
        key: "$secrets.postman_api_key"
      resources:
        - name: collection-runs
          path: "/monitors/{{collection_id}}/run"
          inputParameters:
            - name: collection_id
              in: path
          operations:
            - name: run-collection
              method: POST

Refreshes the Power BI dataset containing CN network performance KPIs including velocity, dwell time, and on-time delivery.

naftiko: "0.5"
info:
  label: "Power BI Network Performance Dashboard"
  description: "Refreshes the Power BI dataset containing CN network performance KPIs including velocity, dwell time, and on-time delivery."
  tags:
    - analytics
    - network-performance
    - power-bi
capability:
  exposes:
    - type: mcp
      namespace: network-analytics
      port: 8080
      tools:
        - name: refresh-network-dashboard
          description: "Trigger a refresh of the CN network performance Power BI dataset."
          inputParameters:
            - name: dataset_id
              in: body
              type: string
              description: "Power BI dataset ID."
          call: "powerbi.trigger-refresh"
          with:
            dataset_id: "{{dataset_id}}"
          outputParameters:
            - name: request_id
              type: string
              mapping: "$.requestId"
            - name: status
              type: string
              mapping: "$.status"
  consumes:
    - type: http
      namespace: powerbi
      baseUri: "https://api.powerbi.com/v1.0/myorg"
      authentication:
        type: bearer
        token: "$secrets.powerbi_token"
      resources:
        - name: refreshes
          path: "/datasets/{{dataset_id}}/refreshes"
          inputParameters:
            - name: dataset_id
              in: path
          operations:
            - name: trigger-refresh
              method: POST

Retrieves on-time performance metrics from Power BI for a given corridor.

naftiko: "0.5"
info:
  label: "Power BI On-Time Performance Lookup"
  description: "Retrieves on-time performance metrics from Power BI for a given corridor."
  tags:
    - analytics
    - power-bi
capability:
  exposes:
    - type: mcp
      namespace: rail-analytics
      port: 8080
      tools:
        - name: get-otp-metrics
          description: "Look up on-time performance for a rail corridor."
          inputParameters:
            - name: corridor_id
              in: body
              type: string
              description: "Rail corridor identifier."
          call: "powerbi.get-dataset-value"
          with:
            corridor_id: "{{corridor_id}}"
          outputParameters:
            - name: on_time_pct
              type: number
              mapping: "$.value[0].on_time_percentage"
            - name: avg_delay_hrs
              type: number
              mapping: "$.value[0].average_delay_hours"
  consumes:
    - type: http
      namespace: powerbi
      baseUri: "https://api.powerbi.com/v1.0/myorg"
      authentication:
        type: bearer
        token: "$secrets.powerbi_token"
      resources:
        - name: datasets
          path: "/datasets/{{dataset_id}}/executeQueries"
          operations:
            - name: get-dataset-value
              method: POST

Triggers a reload of the Qlik Sense fleet utilization app showing locomotive and railcar availability metrics.

naftiko: "0.5"
info:
  label: "Qlik Sense Fleet Utilization Dashboard"
  description: "Triggers a reload of the Qlik Sense fleet utilization app showing locomotive and railcar availability metrics."
  tags:
    - analytics
    - fleet-management
    - qlik-sense
capability:
  exposes:
    - type: mcp
      namespace: fleet-analytics
      port: 8080
      tools:
        - name: reload-fleet-dashboard
          description: "Trigger a Qlik Sense app reload for fleet utilization dashboards."
          inputParameters:
            - name: app_id
              in: body
              type: string
              description: "Qlik Sense app ID."
          call: "qlik.reload-app"
          with:
            app_id: "{{app_id}}"
          outputParameters:
            - name: reload_id
              type: string
              mapping: "$.id"
            - name: status
              type: string
              mapping: "$.status"
  consumes:
    - type: http
      namespace: qlik
      baseUri: "https://cn.us.qlikcloud.com/api/v1"
      authentication:
        type: bearer
        token: "$secrets.qlik_api_key"
      resources:
        - name: reloads
          path: "/reloads"
          operations:
            - name: reload-app
              method: POST

Aggregates ServiceNow safety data, analyzes in Snowflake, publishes to Confluence.

naftiko: "0.5"
info:
  label: "Quarterly Safety Report Orchestrator"
  description: "Aggregates ServiceNow safety data, analyzes in Snowflake, publishes to Confluence."
  tags:
    - safety
    - servicenow
    - snowflake
    - confluence
capability:
  exposes:
    - type: mcp
      namespace: safety-report
      port: 8080
      tools:
        - name: generate-safety-report
          description: "Aggregate data, analyze trends, publish report."
          inputParameters:
            - name: quarter
              in: body
              type: string
              description: "Quarter."
            - name: region
              in: body
              type: string
              description: "Region."
          steps:
            - name: get-incidents
              type: call
              call: "servicenow.create-incident"
              with:
                short_description: "Safety report query {{quarter}}"
            - name: analyze
              type: call
              call: "snowflake.run-safety-analysis"
              with:
                quarter: "{{quarter}}"
            - name: publish
              type: call
              call: "confluence.create-page"
              with:
                space_key: "SAFETY"
                title: "Safety Report - {{quarter}} - {{region}}"
  consumes:
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: incidents
          path: "/table/incident"
          operations:
            - name: create-incident
              method: POST
    - type: http
      namespace: snowflake
      baseUri: "https://cn.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-analysis
              method: POST
            - name: query-revenue
              method: POST
            - name: run-safety-analysis
              method: POST
            - name: query-velocity
              method: POST
            - name: query-projections
              method: POST
            - name: query-volumes
              method: POST
            - name: query-metrics
              method: POST
            - name: run-geometry-analysis
              method: POST
    - type: http
      namespace: confluence
      baseUri: "https://cn.atlassian.net/wiki/rest/api"
      authentication:
        type: basic
        username: "$secrets.confluence_user"
        password: "$secrets.confluence_api_token"
      resources:
        - name: content
          path: "/content"
          operations:
            - name: create-page
              method: POST

Analyzes SAP car utilization, runs Databricks optimization, publishes to Confluence.

naftiko: "0.5"
info:
  label: "Rail Car Fleet Optimization Orchestrator"
  description: "Analyzes SAP car utilization, runs Databricks optimization, publishes to Confluence."
  tags:
    - operations
    - sap
    - databricks
    - confluence
capability:
  exposes:
    - type: mcp
      namespace: fleet-optimization
      port: 8080
      tools:
        - name: optimize-fleet-deployment
          description: "Analyze, optimize, publish recommendations."
          inputParameters:
            - name: fleet_type
              in: body
              type: string
              description: "Fleet type."
            - name: period
              in: body
              type: string
              description: "Planning period."
          steps:
            - name: get-util
              type: call
              call: "sap.get-fleet-utilization"
              with:
                fleet_type: "{{fleet_type}}"
            - name: optimize
              type: call
              call: "databricks.run-model"
              with:
                fleet_type: "{{fleet_type}}"
            - name: publish
              type: call
              call: "confluence.create-page"
              with:
                space_key: "FLEET"
                title: "Fleet Optimization - {{fleet_type}}"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/TM_FLEET_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: fleet
          path: "/A_FleetUtilization"
          operations:
            - name: get-fleet-utilization
              method: GET
    - type: http
      namespace: databricks
      baseUri: "https://cn-databricks.cloud.databricks.com/api/2.0"
      authentication:
        type: bearer
        token: "$secrets.databricks_token"
      resources:
        - name: jobs
          path: "/jobs/run-now"
          operations:
            - name: run-model
              method: POST
    - type: http
      namespace: confluence
      baseUri: "https://cn.atlassian.net/wiki/rest/api"
      authentication:
        type: basic
        username: "$secrets.confluence_user"
        password: "$secrets.confluence_api_token"
      resources:
        - name: content
          path: "/content"
          operations:
            - name: create-page
              method: POST

Creates ServiceNow incident, dispatches via Slack, files regulatory report.

naftiko: "0.5"
info:
  label: "Rail Crossing Incident Response Orchestrator"
  description: "Creates ServiceNow incident, dispatches via Slack, files regulatory report."
  tags:
    - safety
    - servicenow
    - slack
capability:
  exposes:
    - type: mcp
      namespace: crossing-incident
      port: 8080
      tools:
        - name: respond-to-crossing-incident
          description: "Respond to crossing incident with ServiceNow, Slack, regulatory."
          inputParameters:
            - name: crossing_id
              in: body
              type: string
              description: "Crossing ID."
            - name: incident_type
              in: body
              type: string
              description: "Incident type."
          steps:
            - name: create-incident
              type: call
              call: "servicenow.create-incident"
              with:
                short_description: "Crossing incident at {{crossing_id}}: {{incident_type}}"
                urgency: "1"
            - name: dispatch
              type: call
              call: "slack.post-message"
              with:
                channel: "#emergency-response"
                text: "Crossing incident at {{crossing_id}}"
            - name: file
              type: call
              call: "regulatory.submit-report"
              with:
                crossing_id: "{{crossing_id}}"
  consumes:
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: incidents
          path: "/table/incident"
          operations:
            - name: create-incident
              method: POST
    - type: http
      namespace: slack
      baseUri: "https://slack.com/api"
      authentication:
        type: bearer
        token: "$secrets.slack_bot_token"
      resources:
        - name: messages
          path: "/chat.postMessage"
          operations:
            - name: post-message
              method: POST
    - type: http
      namespace: regulatory
      baseUri: "https://api.cn.ca/regulatory/v1"
      authentication:
        type: bearer
        token: "$secrets.regulatory_token"
      resources:
        - name: reports
          path: "/crossing-reports"
          operations:
            - name: submit-report
              method: POST

Retrieves real-time railcar positions from the GPS tracking system and returns location, speed, and ETA data.

naftiko: "0.5"
info:
  label: "Railcar GPS Position Tracker"
  description: "Retrieves real-time railcar positions from the GPS tracking system and returns location, speed, and ETA data."
  tags:
    - operations
    - tracking
    - gps
    - google-maps
capability:
  exposes:
    - type: mcp
      namespace: railcar-tracking
      port: 8080
      tools:
        - name: get-railcar-position
          description: "Look up the current GPS position, speed, and estimated arrival for a railcar."
          inputParameters:
            - name: railcar_id
              in: body
              type: string
              description: "Railcar reporting mark and number."
          call: "tracking.get-position"
          with:
            equipment_id: "{{railcar_id}}"
          outputParameters:
            - name: latitude
              type: number
              mapping: "$.position.lat"
            - name: longitude
              type: number
              mapping: "$.position.lng"
            - name: speed_mph
              type: number
              mapping: "$.speed"
            - name: eta
              type: string
              mapping: "$.estimated_arrival"
            - name: last_reported
              type: string
              mapping: "$.timestamp"
  consumes:
    - type: http
      namespace: tracking
      baseUri: "https://tracking-api.cn.ca/v2"
      authentication:
        type: bearer
        token: "$secrets.cn_tracking_token"
      resources:
        - name: positions
          path: "/equipment/{{equipment_id}}/position"
          inputParameters:
            - name: equipment_id
              in: path
          operations:
            - name: get-position
              method: GET

Compiles SAP and Snowflake data, generates Crystal Reports, submits filings.

naftiko: "0.5"
info:
  label: "Regulatory Submission Orchestrator"
  description: "Compiles SAP and Snowflake data, generates Crystal Reports, submits filings."
  tags:
    - compliance
    - sap
    - snowflake
    - crystal-reports
capability:
  exposes:
    - type: mcp
      namespace: regulatory-filing
      port: 8080
      tools:
        - name: submit-regulatory-report
          description: "Compile data, generate reports, submit filings."
          inputParameters:
            - name: report_type
              in: body
              type: string
              description: "Report type."
            - name: period
              in: body
              type: string
              description: "Filing period."
          steps:
            - name: get-data
              type: call
              call: "sap.get-regulatory-data"
              with:
                report_type: "{{report_type}}"
            - name: get-analytics
              type: call
              call: "snowflake.query-metrics"
              with:
                report_type: "{{report_type}}"
            - name: generate
              type: call
              call: "crystal.generate-report"
              with:
                template: "{{report_type}}"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/REGULATORY_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: data
          path: "/A_RegulatoryData"
          operations:
            - name: get-regulatory-data
              method: GET
    - type: http
      namespace: snowflake
      baseUri: "https://cn.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-analysis
              method: POST
            - name: query-revenue
              method: POST
            - name: run-safety-analysis
              method: POST
            - name: query-velocity
              method: POST
            - name: query-projections
              method: POST
            - name: query-volumes
              method: POST
            - name: query-metrics
              method: POST
            - name: run-geometry-analysis
              method: POST
    - type: http
      namespace: crystal
      baseUri: "https://crystal-reports.cn.ca/api/v1"
      authentication:
        type: bearer
        token: "$secrets.crystal_token"
      resources:
        - name: reports
          path: "/generate"
          operations:
            - name: generate-report
              method: POST

When a safety incident occurs, creates a ServiceNow incident, notifies the safety team via Teams, and logs the event in Snowflake for regulatory reporting.

naftiko: "0.5"
info:
  label: "Safety Incident Reporting Pipeline"
  description: "When a safety incident occurs, creates a ServiceNow incident, notifies the safety team via Teams, and logs the event in Snowflake for regulatory reporting."
  tags:
    - safety
    - compliance
    - servicenow
    - microsoft-teams
    - snowflake
capability:
  exposes:
    - type: mcp
      namespace: safety-reporting
      port: 8080
      tools:
        - name: report-safety-incident
          description: "Log a rail safety incident across ServiceNow, Teams, and Snowflake for regulatory compliance."
          inputParameters:
            - name: location_code
              in: body
              type: string
              description: "Location mile post or yard code."
            - name: incident_type
              in: body
              type: string
              description: "Type (derailment, crossing_incident, hazmat_release, personal_injury)."
            - name: severity
              in: body
              type: string
              description: "Severity (class_1, class_2, class_3)."
            - name: description
              in: body
              type: string
              description: "Detailed description of the incident."
          steps:
            - name: create-incident
              type: call
              call: "servicenow.create-incident"
              with:
                short_description: "Safety: {{incident_type}} at {{location_code}}"
                category: "safety"
                urgency: "{{severity}}"
                description: "{{description}}"
            - name: notify-safety-team
              type: call
              call: "msteams.send-message"
              with:
                channel_id: "safety_operations"
                text: "SAFETY INCIDENT [{{severity}}] at {{location_code}}: {{incident_type}}. ServiceNow: {{create-incident.number}}. {{description}}"
            - name: log-to-warehouse
              type: call
              call: "snowflake.run-query"
              with:
                query: "INSERT INTO safety_incidents (location, incident_type, severity, snow_number, description, reported_at) VALUES ('{{location_code}}', '{{incident_type}}', '{{severity}}', '{{create-incident.number}}', '{{description}}', CURRENT_TIMESTAMP())"
  consumes:
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: incidents
          path: "/table/incident"
          operations:
            - name: create-incident
              method: POST
    - type: http
      namespace: msteams
      baseUri: "https://graph.microsoft.com/v1.0"
      authentication:
        type: bearer
        token: "$secrets.msgraph_token"
      resources:
        - name: channel-messages
          path: "/teams/{{channel_id}}/channels/general/messages"
          inputParameters:
            - name: channel_id
              in: path
          operations:
            - name: send-message
              method: POST
    - type: http
      namespace: snowflake
      baseUri: "https://cn-railway.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-query
              method: POST

Retrieves a customer's shipment history from Salesforce for account review and relationship management.

naftiko: "0.5"
info:
  label: "Salesforce Customer Shipment History"
  description: "Retrieves a customer's shipment history from Salesforce for account review and relationship management."
  tags:
    - sales
    - customer-management
    - salesforce
capability:
  exposes:
    - type: mcp
      namespace: customer-management
      port: 8080
      tools:
        - name: get-shipment-history
          description: "Query Salesforce for a customer's recent shipment history."
          inputParameters:
            - name: account_id
              in: body
              type: string
              description: "Salesforce account ID."
            - name: months_back
              in: body
              type: integer
              description: "Number of months to look back."
          call: "salesforce.query"
          with:
            q: "SELECT Shipment_Number__c, Origin__c, Destination__c, Commodity__c, Revenue__c, Ship_Date__c FROM Shipment__c WHERE Account__c = '{{account_id}}' AND Ship_Date__c >= LAST_N_MONTHS:{{months_back}} ORDER BY Ship_Date__c DESC"
          outputParameters:
            - name: shipments
              type: array
              mapping: "$.records"
            - name: total_records
              type: integer
              mapping: "$.totalSize"
  consumes:
    - type: http
      namespace: salesforce
      baseUri: "https://cn.my.salesforce.com/services/data/v59.0"
      authentication:
        type: bearer
        token: "$secrets.salesforce_token"
      resources:
        - name: query
          path: "/query"
          operations:
            - name: query
              method: GET

Retrieves locomotive fuel consumption data from SAP for fleet efficiency analysis and environmental reporting.

naftiko: "0.5"
info:
  label: "SAP Fuel Consumption Report"
  description: "Retrieves locomotive fuel consumption data from SAP for fleet efficiency analysis and environmental reporting."
  tags:
    - sustainability
    - fleet
    - sap
capability:
  exposes:
    - type: mcp
      namespace: fuel-analytics
      port: 8080
      tools:
        - name: get-fuel-consumption
          description: "Fetch locomotive fuel consumption data from SAP for a specified period."
          inputParameters:
            - name: locomotive_class
              in: body
              type: string
              description: "Locomotive class (e.g., ES44AC, C44-9W)."
            - name: period
              in: body
              type: string
              description: "Reporting period in YYYY-MM format."
          call: "sap.get-fuel-data"
          with:
            equipment_class: "{{locomotive_class}}"
            period: "{{period}}"
          outputParameters:
            - name: total_gallons
              type: number
              mapping: "$.fuel_consumed_gallons"
            - name: miles_operated
              type: number
              mapping: "$.total_miles"
            - name: gallons_per_mile
              type: number
              mapping: "$.efficiency_gpm"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/API_EQUIPMENT_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: fuel-data
          path: "/EquipmentFuelConsumption"
          operations:
            - name: get-fuel-data
              method: GET

Retrieves intermodal container inventory count by terminal from SAP.

naftiko: "0.5"
info:
  label: "SAP Intermodal Container Inventory Lookup"
  description: "Retrieves intermodal container inventory count by terminal from SAP."
  tags:
    - operations
    - sap
capability:
  exposes:
    - type: mcp
      namespace: container-inventory
      port: 8080
      tools:
        - name: get-container-count
          description: "Look up intermodal container inventory by terminal."
          inputParameters:
            - name: terminal_code
              in: body
              type: string
              description: "SAP terminal plant code."
          call: "sap.get-container-inv"
          with:
            terminal: "{{terminal_code}}"
          outputParameters:
            - name: total_containers
              type: number
              mapping: "$.d.TotalCount"
            - name: available
              type: number
              mapping: "$.d.AvailableCount"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/MM_INVENTORY_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: inventory
          path: "/A_ContainerStock(Plant='{{terminal}}')"
          inputParameters:
            - name: terminal
              in: path
          operations:
            - name: get-container-inv
              method: GET

Retrieves current fuel level for a locomotive from SAP.

naftiko: "0.5"
info:
  label: "SAP Locomotive Fuel Level Lookup"
  description: "Retrieves current fuel level for a locomotive from SAP."
  tags:
    - operations
    - sap
capability:
  exposes:
    - type: mcp
      namespace: fuel-monitoring
      port: 8080
      tools:
        - name: get-fuel-level
          description: "Look up locomotive fuel level by equipment number."
          inputParameters:
            - name: equipment_number
              in: body
              type: string
              description: "SAP equipment number."
          call: "sap.get-fuel-level"
          with:
            equipment_number: "{{equipment_number}}"
          outputParameters:
            - name: fuel_level_pct
              type: number
              mapping: "$.d.FuelLevelPercent"
            - name: fuel_volume_gal
              type: number
              mapping: "$.d.FuelVolumeGallons"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/PM_EQUIPMENT_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: fuel
          path: "/A_Equipment('{{equipment_number}}')/FuelLevel"
          inputParameters:
            - name: equipment_number
              in: path
          operations:
            - name: get-fuel-level
              method: GET

Creates a maintenance work order in SAP for a locomotive unit, assigns to the nearest maintenance facility, and notifies the mechanical team via Teams.

naftiko: "0.5"
info:
  label: "SAP Locomotive Maintenance Work Order"
  description: "Creates a maintenance work order in SAP for a locomotive unit, assigns to the nearest maintenance facility, and notifies the mechanical team via Teams."
  tags:
    - maintenance
    - locomotive
    - sap
    - microsoft-teams
capability:
  exposes:
    - type: mcp
      namespace: locomotive-maintenance
      port: 8080
      tools:
        - name: create-maintenance-order
          description: "Create a SAP maintenance work order for a locomotive and notify the mechanical team."
          inputParameters:
            - name: locomotive_id
              in: body
              type: string
              description: "Locomotive unit number."
            - name: defect_type
              in: body
              type: string
              description: "Type of defect (e.g., engine, brakes, electrical, hvac)."
            - name: priority
              in: body
              type: string
              description: "Priority level (emergency, urgent, routine)."
            - name: facility_code
              in: body
              type: string
              description: "Maintenance facility code."
          steps:
            - name: create-order
              type: call
              call: "sap.create-work-order"
              with:
                equipment_id: "{{locomotive_id}}"
                order_type: "PM01"
                priority: "{{priority}}"
                description: "{{defect_type}} defect on locomotive {{locomotive_id}}"
                plant: "{{facility_code}}"
            - name: notify-mechanics
              type: call
              call: "msteams.send-message"
              with:
                channel_id: "mechanical_{{facility_code}}"
                text: "New maintenance order: {{create-order.order_number}} for Locomotive {{locomotive_id}}. Defect: {{defect_type}}. Priority: {{priority}}. Assigned to facility {{facility_code}}."
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/API_MAINTENANCEORDER_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: maintenance-orders
          path: "/MaintenanceOrder"
          operations:
            - name: create-work-order
              method: POST
    - type: http
      namespace: msteams
      baseUri: "https://graph.microsoft.com/v1.0"
      authentication:
        type: bearer
        token: "$secrets.msgraph_token"
      resources:
        - name: channel-messages
          path: "/teams/{{channel_id}}/channels/general/messages"
          inputParameters:
            - name: channel_id
              in: path
          operations:
            - name: send-message
              method: POST

Retrieves the next scheduled maintenance window for a track segment from SAP.

naftiko: "0.5"
info:
  label: "SAP Track Maintenance Schedule Lookup"
  description: "Retrieves the next scheduled maintenance window for a track segment from SAP."
  tags:
    - maintenance
    - sap
capability:
  exposes:
    - type: mcp
      namespace: track-maintenance
      port: 8080
      tools:
        - name: get-maintenance-schedule
          description: "Look up next maintenance window for a track segment."
          inputParameters:
            - name: segment_id
              in: body
              type: string
              description: "Track segment identifier."
          call: "sap.get-schedule"
          with:
            segment_id: "{{segment_id}}"
          outputParameters:
            - name: next_date
              type: string
              mapping: "$.d.NextMaintenanceDate"
            - name: work_type
              type: string
              mapping: "$.d.WorkType"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/PM_MAINTENANCE_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: schedules
          path: "/A_MaintenancePlan(Segment='{{segment_id}}')"
          inputParameters:
            - name: segment_id
              in: path
          operations:
            - name: get-schedule
              method: GET

Retrieves average railcar dwell time at a classification yard from SAP.

naftiko: "0.5"
info:
  label: "SAP Yard Dwell Time Lookup"
  description: "Retrieves average railcar dwell time at a classification yard from SAP."
  tags:
    - operations
    - sap
capability:
  exposes:
    - type: mcp
      namespace: yard-ops
      port: 8080
      tools:
        - name: get-dwell-time
          description: "Look up average dwell time at a classification yard."
          inputParameters:
            - name: yard_code
              in: body
              type: string
              description: "SAP yard plant code."
          call: "sap.get-dwell-metrics"
          with:
            yard: "{{yard_code}}"
          outputParameters:
            - name: avg_dwell_hours
              type: number
              mapping: "$.d.AverageDwellHours"
            - name: cars_on_hand
              type: number
              mapping: "$.d.CarsOnHand"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/TM_YARD_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: yards
          path: "/A_YardMetrics(Yard='{{yard}}')"
          inputParameters:
            - name: yard
              in: path
          operations:
            - name: get-dwell-metrics
              method: GET

Creates a ServiceNow change request for scheduled track maintenance work, coordinating with train dispatch for track possession windows.

naftiko: "0.5"
info:
  label: "ServiceNow Change Request for Track Work"
  description: "Creates a ServiceNow change request for scheduled track maintenance work, coordinating with train dispatch for track possession windows."
  tags:
    - operations
    - change-management
    - servicenow
capability:
  exposes:
    - type: mcp
      namespace: track-changes
      port: 8080
      tools:
        - name: create-track-work-change
          description: "Create a ServiceNow change request for scheduled track maintenance."
          inputParameters:
            - name: subdivision
              in: body
              type: string
              description: "Track subdivision name."
            - name: milepost_start
              in: body
              type: string
              description: "Starting milepost."
            - name: milepost_end
              in: body
              type: string
              description: "Ending milepost."
            - name: work_type
              in: body
              type: string
              description: "Type of track work (rail_replacement, tie_replacement, surfacing, switch_maintenance)."
            - name: requested_date
              in: body
              type: string
              description: "Requested date for track possession."
          call: "servicenow.create-change"
          with:
            short_description: "Track work: {{work_type}} on {{subdivision}} MP {{milepost_start}}-{{milepost_end}}"
            category: "track_maintenance"
            type: "standard"
            start_date: "{{requested_date}}"
            description: "{{work_type}} between milepost {{milepost_start}} and {{milepost_end}} on {{subdivision}} subdivision."
          outputParameters:
            - name: change_number
              type: string
              mapping: "$.result.number"
            - name: state
              type: string
              mapping: "$.result.state"
  consumes:
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: change-requests
          path: "/table/change_request"
          operations:
            - name: create-change
              method: POST

Retrieves the status of a track work order from ServiceNow.

naftiko: "0.5"
info:
  label: "ServiceNow Track Work Order Status Lookup"
  description: "Retrieves the status of a track work order from ServiceNow."
  tags:
    - maintenance
    - servicenow
capability:
  exposes:
    - type: mcp
      namespace: track-orders
      port: 8080
      tools:
        - name: get-work-order-status
          description: "Look up track work order status."
          inputParameters:
            - name: work_order_id
              in: body
              type: string
              description: "ServiceNow work order sys_id."
          call: "servicenow.get-work-order"
          with:
            sys_id: "{{work_order_id}}"
          outputParameters:
            - name: state
              type: string
              mapping: "$.result.state"
            - name: assigned_to
              type: string
              mapping: "$.result.assigned_to.display_value"
  consumes:
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: work-orders
          path: "/table/wm_order/{{sys_id}}"
          inputParameters:
            - name: sys_id
              in: path
          operations:
            - name: get-work-order
              method: GET

Creates P1 incident, dispatches maintainers via Slack, implements SAP speed restrictions.

naftiko: "0.5"
info:
  label: "Signal System Failure Response Orchestrator"
  description: "Creates P1 incident, dispatches maintainers via Slack, implements SAP speed restrictions."
  tags:
    - operations
    - servicenow
    - slack
    - sap
capability:
  exposes:
    - type: mcp
      namespace: signal-failure
      port: 8080
      tools:
        - name: respond-to-signal-failure
          description: "Respond to signal failure with incident, dispatch, restrictions."
          inputParameters:
            - name: signal_id
              in: body
              type: string
              description: "Signal ID."
            - name: mile_post
              in: body
              type: string
              description: "Mile post."
          steps:
            - name: create-incident
              type: call
              call: "servicenow.create-incident"
              with:
                short_description: "Signal failure at {{signal_id}} MP {{mile_post}}"
                urgency: "1"
            - name: dispatch
              type: call
              call: "slack.post-message"
              with:
                channel: "#signal-maintenance"
                text: "Signal failure at {{signal_id}}"
            - name: restrict
              type: call
              call: "sap-tm.create-speed-restriction"
              with:
                mile_post: "{{mile_post}}"
  consumes:
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: incidents
          path: "/table/incident"
          operations:
            - name: create-incident
              method: POST
    - type: http
      namespace: slack
      baseUri: "https://slack.com/api"
      authentication:
        type: bearer
        token: "$secrets.slack_bot_token"
      resources:
        - name: messages
          path: "/chat.postMessage"
          operations:
            - name: post-message
              method: POST
    - type: http
      namespace: sap-tm
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/TM_RESTRICTION_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: restrictions
          path: "/A_SpeedRestriction"
          operations:
            - name: create-speed-restriction
              method: POST

Queries Snowflake for rail traffic volumes by corridor and returns carload statistics for capacity planning.

naftiko: "0.5"
info:
  label: "Snowflake Rail Traffic Analytics"
  description: "Queries Snowflake for rail traffic volumes by corridor and returns carload statistics for capacity planning."
  tags:
    - analytics
    - traffic
    - snowflake
capability:
  exposes:
    - type: mcp
      namespace: traffic-analytics
      port: 8080
      tools:
        - name: get-corridor-traffic
          description: "Fetch rail traffic volume data from Snowflake for a specific corridor and time period."
          inputParameters:
            - name: corridor
              in: body
              type: string
              description: "Rail corridor code (e.g., MTL-TOR, CHI-WIN)."
            - name: start_date
              in: body
              type: string
              description: "Start date in YYYY-MM-DD."
            - name: end_date
              in: body
              type: string
              description: "End date in YYYY-MM-DD."
          call: "snowflake.run-query"
          with:
            query: "SELECT corridor, commodity_type, SUM(carloads) as total_carloads, AVG(transit_days) as avg_transit FROM rail_traffic WHERE corridor='{{corridor}}' AND movement_date BETWEEN '{{start_date}}' AND '{{end_date}}' GROUP BY corridor, commodity_type ORDER BY total_carloads DESC"
          outputParameters:
            - name: results
              type: array
              mapping: "$.data"
            - name: row_count
              type: integer
              mapping: "$.resultSetMetaData.numRows"
  consumes:
    - type: http
      namespace: snowflake
      baseUri: "https://cn-railway.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-query
              method: POST

Queries Snowflake for daily rail traffic volume on a given subdivision.

naftiko: "0.5"
info:
  label: "Snowflake Rail Traffic Volume Lookup"
  description: "Queries Snowflake for daily rail traffic volume on a given subdivision."
  tags:
    - analytics
    - snowflake
capability:
  exposes:
    - type: mcp
      namespace: traffic-data
      port: 8080
      tools:
        - name: get-traffic-volume
          description: "Look up daily rail traffic volume by subdivision."
          inputParameters:
            - name: subdivision
              in: body
              type: string
              description: "Rail subdivision name."
          call: "snowflake.query-volume"
          with:
            subdivision: "{{subdivision}}"
          outputParameters:
            - name: total_trains
              type: number
              mapping: "$.data[0][0]"
            - name: total_carloads
              type: number
              mapping: "$.data[0][1]"
  consumes:
    - type: http
      namespace: snowflake
      baseUri: "https://cn.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: query-volume
              method: POST

Queries SolarWinds for network performance metrics across CN's wide area network connecting yards and dispatch centers.

naftiko: "0.5"
info:
  label: "SolarWinds Network Performance Monitor"
  description: "Queries SolarWinds for network performance metrics across CN's wide area network connecting yards and dispatch centers."
  tags:
    - infrastructure
    - networking
    - solarwinds
capability:
  exposes:
    - type: mcp
      namespace: wan-monitoring
      port: 8080
      tools:
        - name: get-network-health
          description: "Retrieve network performance data from SolarWinds for CN's WAN."
          inputParameters:
            - name: node_name
              in: body
              type: string
              description: "SolarWinds node name."
          call: "solarwinds.get-node-stats"
          with:
            node: "{{node_name}}"
          outputParameters:
            - name: availability
              type: number
              mapping: "$.availability_pct"
            - name: avg_latency
              type: number
              mapping: "$.avg_response_time_ms"
  consumes:
    - type: http
      namespace: solarwinds
      baseUri: "https://solarwinds.cn.ca/SolarWinds/InformationService/v3/Json"
      authentication:
        type: basic
        username: "$secrets.solarwinds_user"
        password: "$secrets.solarwinds_password"
      resources:
        - name: query
          path: "/Query"
          operations:
            - name: get-node-stats
              method: POST

Aggregates tracking data, enriches with Salesforce, publishes to Google Sheets.

naftiko: "0.5"
info:
  label: "Supply Chain Visibility Orchestrator"
  description: "Aggregates tracking data, enriches with Salesforce, publishes to Google Sheets."
  tags:
    - logistics
    - salesforce
    - google-sheets
capability:
  exposes:
    - type: mcp
      namespace: supply-chain-viz
      port: 8080
      tools:
        - name: generate-supply-chain-view
          description: "Aggregate tracking, enrich, publish."
          inputParameters:
            - name: customer_id
              in: body
              type: string
              description: "Customer ID."
          steps:
            - name: get-shipments
              type: call
              call: "tracking.get-customer-shipments"
              with:
                customer_id: "{{customer_id}}"
            - name: get-account
              type: call
              call: "salesforce.get-account"
              with:
                account_id: "{{customer_id}}"
            - name: update-sheet
              type: call
              call: "sheets.update-spreadsheet"
              with:
                spreadsheet_id: "supply-chain-viz"
  consumes:
    - type: http
      namespace: tracking
      baseUri: "https://api.cn.ca/tracking/v2"
      authentication:
        type: bearer
        token: "$secrets.tracking_token"
      resources:
        - name: shipments
          path: "/shipments"
          operations:
            - name: get-customer-shipments
              method: GET
    - type: http
      namespace: salesforce
      baseUri: "https://cn.my.salesforce.com/services/data/v58.0"
      authentication:
        type: bearer
        token: "$secrets.salesforce_token"
      resources:
        - name: objects
          path: "/sobjects"
          operations:
            - name: send-notification
              method: POST
            - name: update-case
              method: PATCH
            - name: get-account
              method: GET
            - name: get-contracts
              method: GET
    - type: http
      namespace: sheets
      baseUri: "https://sheets.googleapis.com/v4"
      authentication:
        type: bearer
        token: "$secrets.google_sheets_token"
      resources:
        - name: spreadsheets
          path: "/spreadsheets/{{spreadsheet_id}}/values:batchUpdate"
          operations:
            - name: update-spreadsheet
              method: POST

Retrieves fleet utilization dashboard data from Tableau.

naftiko: "0.5"
info:
  label: "Tableau Fleet Utilization Lookup"
  description: "Retrieves fleet utilization dashboard data from Tableau."
  tags:
    - analytics
    - tableau
capability:
  exposes:
    - type: mcp
      namespace: fleet-analytics
      port: 8080
      tools:
        - name: get-fleet-utilization
          description: "Look up fleet utilization metrics from Tableau."
          inputParameters:
            - name: view_id
              in: body
              type: string
              description: "Tableau view ID."
          call: "tableau.get-view-data"
          with:
            view_id: "{{view_id}}"
          outputParameters:
            - name: utilization_pct
              type: number
              mapping: "$.data[0].utilization"
            - name: idle_count
              type: number
              mapping: "$.data[0].idle_units"
  consumes:
    - type: http
      namespace: tableau
      baseUri: "https://tableau.cn.ca/api/3.19"
      authentication:
        type: bearer
        token: "$secrets.tableau_token"
      resources:
        - name: views
          path: "/sites/{{site_id}}/views/{{view_id}}/data"
          inputParameters:
            - name: view_id
              in: path
          operations:
            - name: get-view-data
              method: GET

Generates a trusted ticket for embedding the CN network velocity Tableau dashboard in the operations portal.

naftiko: "0.5"
info:
  label: "Tableau Network Velocity Dashboard"
  description: "Generates a trusted ticket for embedding the CN network velocity Tableau dashboard in the operations portal."
  tags:
    - analytics
    - visualization
    - tableau
capability:
  exposes:
    - type: mcp
      namespace: data-visualization
      port: 8080
      tools:
        - name: get-velocity-dashboard
          description: "Generate a Tableau trusted ticket for the network velocity dashboard."
          inputParameters:
            - name: username
              in: body
              type: string
              description: "Tableau server username."
          call: "tableau.get-trusted-ticket"
          with:
            username: "{{username}}"
          outputParameters:
            - name: ticket
              type: string
              mapping: "$"
            - name: embed_url
              type: string
              mapping: "$.embed_url"
  consumes:
    - type: http
      namespace: tableau
      baseUri: "https://tableau.cn.ca"
      authentication:
        type: basic
        username: "$secrets.tableau_admin_user"
        password: "$secrets.tableau_admin_password"
      resources:
        - name: trusted
          path: "/trusted"
          operations:
            - name: get-trusted-ticket
              method: POST

Runs revenue analytics queries against CN's Teradata data warehouse for freight revenue by commodity and corridor.

naftiko: "0.5"
info:
  label: "Teradata Revenue Analytics Query"
  description: "Runs revenue analytics queries against CN's Teradata data warehouse for freight revenue by commodity and corridor."
  tags:
    - finance
    - analytics
    - teradata
capability:
  exposes:
    - type: mcp
      namespace: revenue-analytics
      port: 8080
      tools:
        - name: query-revenue
          description: "Query Teradata for freight revenue data by commodity type and corridor."
          inputParameters:
            - name: corridor
              in: body
              type: string
              description: "Rail corridor code."
            - name: fiscal_quarter
              in: body
              type: string
              description: "Fiscal quarter (e.g., Q1-2026)."
          call: "teradata.run-query"
          with:
            query: "SELECT commodity_group, corridor, SUM(freight_revenue) as revenue, COUNT(waybills) as shipments FROM revenue_detail WHERE corridor='{{corridor}}' AND fiscal_quarter='{{fiscal_quarter}}' GROUP BY commodity_group, corridor"
          outputParameters:
            - name: results
              type: array
              mapping: "$.results"
            - name: total_revenue
              type: number
              mapping: "$.summary.total_revenue"
  consumes:
    - type: http
      namespace: teradata
      baseUri: "https://teradata.cn.ca/api/query/v1"
      authentication:
        type: basic
        username: "$secrets.teradata_user"
        password: "$secrets.teradata_password"
      resources:
        - name: queries
          path: "/tdrest/systems/cn_edw/queries"
          operations:
            - name: run-query
              method: POST

Processes S3 geometry data, analyzes in Snowflake, creates SAP orders.

naftiko: "0.5"
info:
  label: "Track Geometry Analysis Orchestrator"
  description: "Processes S3 geometry data, analyzes in Snowflake, creates SAP orders."
  tags:
    - maintenance
    - aws-s3
    - snowflake
    - sap
capability:
  exposes:
    - type: mcp
      namespace: track-geometry
      port: 8080
      tools:
        - name: analyze-track-geometry
          description: "Process geometry data, analyze, create orders."
          inputParameters:
            - name: survey_date
              in: body
              type: string
              description: "Survey date."
            - name: subdivision
              in: body
              type: string
              description: "Subdivision."
          steps:
            - name: get-data
              type: call
              call: "s3.get-object"
              with:
                bucket: "cn-track-geometry"
                key: "{{subdivision}}/{{survey_date}}.csv"
            - name: analyze
              type: call
              call: "snowflake.run-geometry-analysis"
              with:
                subdivision: "{{subdivision}}"
            - name: create-orders
              type: call
              call: "sap.create-order"
              with:
                subdivision: "{{subdivision}}"
  consumes:
    - type: http
      namespace: s3
      baseUri: "https://s3.amazonaws.com"
      authentication:
        type: bearer
        token: "$secrets.aws_s3_token"
      resources:
        - name: objects
          path: "/{{bucket}}/{{key}}"
          operations:
            - name: get-object
              method: GET
    - type: http
      namespace: snowflake
      baseUri: "https://cn.snowflakecomputing.com/api/v2"
      authentication:
        type: bearer
        token: "$secrets.snowflake_token"
      resources:
        - name: statements
          path: "/statements"
          operations:
            - name: run-analysis
              method: POST
            - name: query-revenue
              method: POST
            - name: run-safety-analysis
              method: POST
            - name: query-velocity
              method: POST
            - name: query-projections
              method: POST
            - name: query-volumes
              method: POST
            - name: query-metrics
              method: POST
            - name: run-geometry-analysis
              method: POST
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/PM_ORDER_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: orders
          path: "/A_MaintenanceOrder"
          operations:
            - name: create-maintenance-order
              method: POST
            - name: create-order
              method: POST
            - name: get-active-orders
              method: GET

Processes findings, creates SAP orders, and alerts managers via email.

naftiko: "0.5"
info:
  label: "Track Inspection Findings Orchestrator"
  description: "Processes findings, creates SAP orders, and alerts managers via email."
  tags:
    - maintenance
    - sap
    - servicenow
    - email
capability:
  exposes:
    - type: mcp
      namespace: track-inspection
      port: 8080
      tools:
        - name: process-inspection-findings
          description: "Process findings, create orders, alert managers."
          inputParameters:
            - name: inspection_id
              in: body
              type: string
              description: "Inspection ID."
            - name: segment_id
              in: body
              type: string
              description: "Segment ID."
          steps:
            - name: get-findings
              type: call
              call: "inspection.get-report"
              with:
                inspection_id: "{{inspection_id}}"
            - name: create-order
              type: call
              call: "sap.create-order"
              with:
                segment: "{{segment_id}}"
            - name: notify
              type: call
              call: "email.send-message"
              with:
                to: "track-managers@cn.ca"
                subject: "Inspection Alert - {{segment_id}}"
  consumes:
    - type: http
      namespace: inspection
      baseUri: "https://api.cn.ca/inspections/v1"
      authentication:
        type: bearer
        token: "$secrets.inspection_token"
      resources:
        - name: reports
          path: "/reports/{{inspection_id}}"
          inputParameters:
            - name: inspection_id
              in: path
          operations:
            - name: get-report
              method: GET
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/PM_ORDER_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: orders
          path: "/A_MaintenanceOrder"
          operations:
            - name: create-maintenance-order
              method: POST
            - name: create-order
              method: POST
            - name: get-active-orders
              method: GET
    - type: http
      namespace: email
      baseUri: "https://graph.microsoft.com/v1.0"
      authentication:
        type: bearer
        token: "$secrets.graph_token"
      resources:
        - name: mail
          path: "/me/sendMail"
          operations:
            - name: send-message
              method: POST

Validates SAP train consist rules and reports violations via ServiceNow.

naftiko: "0.5"
info:
  label: "Train Consist Validation Orchestrator"
  description: "Validates SAP train consist rules and reports violations via ServiceNow."
  tags:
    - operations
    - sap
    - servicenow
capability:
  exposes:
    - type: mcp
      namespace: consist-validation
      port: 8080
      tools:
        - name: validate-train-consist
          description: "Validate consist and report violations."
          inputParameters:
            - name: train_id
              in: body
              type: string
              description: "Train ID."
            - name: station
              in: body
              type: string
              description: "Station."
          steps:
            - name: get-consist
              type: call
              call: "sap.get-train-consist"
              with:
                train_id: "{{train_id}}"
            - name: validate
              type: call
              call: "rules.validate-consist"
              with:
                train_id: "{{train_id}}"
            - name: report
              type: call
              call: "servicenow.create-incident"
              with:
                short_description: "Consist violation for {{train_id}}"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/TM_TRAIN_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: trains
          path: "/A_TrainConsist"
          operations:
            - name: get-train-consist
              method: GET
    - type: http
      namespace: rules
      baseUri: "https://api.cn.ca/rules/v1"
      authentication:
        type: bearer
        token: "$secrets.rules_token"
      resources:
        - name: validation
          path: "/consist-validate"
          operations:
            - name: validate-consist
              method: POST
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: incidents
          path: "/table/incident"
          operations:
            - name: create-incident
              method: POST

On new crew assignment in Workday, opens a ServiceNow dispatch ticket, provisions a SharePoint folder for run documentation, and sends a Microsoft Teams notification to the yard supervisor.

naftiko: "0.5"
info:
  label: "Train Crew Scheduling Orchestrator"
  description: "On new crew assignment in Workday, opens a ServiceNow dispatch ticket, provisions a SharePoint folder for run documentation, and sends a Microsoft Teams notification to the yard supervisor."
  tags:
    - operations
    - crew-scheduling
    - workday
    - servicenow
    - sharepoint
    - microsoft-teams
capability:
  exposes:
    - type: mcp
      namespace: crew-scheduling
      port: 8080
      tools:
        - name: trigger-crew-dispatch
          description: "Given a Workday employee ID and train assignment, orchestrate crew dispatch across ServiceNow, SharePoint, and Microsoft Teams."
          inputParameters:
            - name: workday_employee_id
              in: body
              type: string
              description: "The Workday worker ID for the crew member."
            - name: train_number
              in: body
              type: string
              description: "The train number for the assignment."
            - name: departure_date
              in: body
              type: string
              description: "Departure date in YYYY-MM-DD format."
            - name: origin_yard
              in: body
              type: string
              description: "Origin yard code."
          steps:
            - name: get-employee
              type: call
              call: "workday.get-worker"
              with:
                worker_id: "{{workday_employee_id}}"
            - name: open-ticket
              type: call
              call: "servicenow.create-incident"
              with:
                short_description: "Crew dispatch: {{get-employee.full_name}} - Train {{train_number}}"
                category: "crew_dispatch"
                assigned_group: "Yard_Operations_{{origin_yard}}"
                description: "Crew dispatch for {{get-employee.full_name}} on Train {{train_number}} departing {{departure_date}} from {{origin_yard}}."
            - name: provision-folder
              type: call
              call: "sharepoint.create-folder"
              with:
                site_id: "cn_operations_site"
                folder_path: "TrainRuns/{{train_number}}_{{departure_date}}"
            - name: notify-supervisor
              type: call
              call: "msteams.send-message"
              with:
                channel_id: "yard_{{origin_yard}}"
                text: "Crew assigned: {{get-employee.full_name}} for Train {{train_number}} departing {{departure_date}}. Dispatch ticket: {{open-ticket.number}}. Run docs: {{provision-folder.url}}."
  consumes:
    - type: http
      namespace: workday
      baseUri: "https://wd2-impl-services1.workday.com/ccx/api/v1"
      authentication:
        type: bearer
        token: "$secrets.workday_token"
      resources:
        - name: workers
          path: "/workers/{{worker_id}}"
          inputParameters:
            - name: worker_id
              in: path
          operations:
            - name: get-worker
              method: GET
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: incidents
          path: "/table/incident"
          operations:
            - name: create-incident
              method: POST
    - type: http
      namespace: sharepoint
      baseUri: "https://graph.microsoft.com/v1.0/sites"
      authentication:
        type: bearer
        token: "$secrets.msgraph_token"
      resources:
        - name: drive-items
          path: "/{{site_id}}/drive/root:/{{folder_path}}"
          inputParameters:
            - name: site_id
              in: path
            - name: folder_path
              in: path
          operations:
            - name: create-folder
              method: POST
    - type: http
      namespace: msteams
      baseUri: "https://graph.microsoft.com/v1.0"
      authentication:
        type: bearer
        token: "$secrets.msgraph_token"
      resources:
        - name: channel-messages
          path: "/teams/{{channel_id}}/channels/general/messages"
          inputParameters:
            - name: channel_id
              in: path
          operations:
            - name: send-message
              method: POST

When a train falls behind schedule, retrieves delay details, creates a ServiceNow incident, and notifies customers via Salesforce.

naftiko: "0.5"
info:
  label: "Train Delay Notification Orchestrator"
  description: "When a train falls behind schedule, retrieves delay details, creates a ServiceNow incident, and notifies customers via Salesforce."
  tags:
    - operations
    - servicenow
    - salesforce
capability:
  exposes:
    - type: mcp
      namespace: delay-notify
      port: 8080
      tools:
        - name: handle-train-delay
          description: "Handle train delay with incident and customer notification."
          inputParameters:
            - name: train_id
              in: body
              type: string
              description: "Train identifier."
            - name: delay_minutes
              in: body
              type: number
              description: "Minutes of delay."
          steps:
            - name: get-train
              type: call
              call: "dispatch.get-train-status"
              with:
                train_id: "{{train_id}}"
            - name: create-incident
              type: call
              call: "servicenow.create-incident"
              with:
                short_description: "Train {{train_id}} delayed {{delay_minutes}} min"
                urgency: "2"
            - name: notify
              type: call
              call: "salesforce.send-notification"
              with:
                train_id: "{{train_id}}"
  consumes:
    - type: http
      namespace: dispatch
      baseUri: "https://api.cn.ca/dispatch/v1"
      authentication:
        type: bearer
        token: "$secrets.dispatch_token"
      resources:
        - name: trains
          path: "/trains/{{train_id}}/status"
          inputParameters:
            - name: train_id
              in: path
          operations:
            - name: get-train-status
              method: GET
            - name: reroute-traffic
              method: POST
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: incidents
          path: "/table/incident"
          operations:
            - name: create-incident
              method: POST
    - type: http
      namespace: salesforce
      baseUri: "https://cn.my.salesforce.com/services/data/v58.0"
      authentication:
        type: bearer
        token: "$secrets.salesforce_token"
      resources:
        - name: objects
          path: "/sobjects"
          operations:
            - name: send-notification
              method: POST
            - name: update-case
              method: PATCH
            - name: get-account
              method: GET
            - name: get-contracts
              method: GET

Performs three-way matching in SAP and routes exceptions to ServiceNow.

naftiko: "0.5"
info:
  label: "Vendor Invoice Three-Way Match Orchestrator"
  description: "Performs three-way matching in SAP and routes exceptions to ServiceNow."
  tags:
    - finance
    - sap
    - servicenow
capability:
  exposes:
    - type: mcp
      namespace: invoice-match
      port: 8080
      tools:
        - name: run-three-way-match
          description: "Match invoices and route exceptions."
          inputParameters:
            - name: vendor_id
              in: body
              type: string
              description: "Vendor ID."
            - name: date
              in: body
              type: string
              description: "Invoice date."
          steps:
            - name: get-invoices
              type: call
              call: "sap.get-invoices"
              with:
                vendor: "{{vendor_id}}"
            - name: match
              type: call
              call: "sap.run-matching"
              with:
                vendor: "{{vendor_id}}"
            - name: route
              type: call
              call: "servicenow.create-request"
              with:
                short_description: "Invoice exceptions for {{vendor_id}}"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/FI_INVOICE_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: invoices
          path: "/A_VendorInvoice"
          operations:
            - name: get-invoices
              method: GET
            - name: run-matching
              method: POST
    - type: http
      namespace: servicenow
      baseUri: "https://cn.service-now.com/api/now"
      authentication:
        type: basic
        username: "$secrets.servicenow_user"
        password: "$secrets.servicenow_password"
      resources:
        - name: requests
          path: "/table/sc_request"
          operations:
            - name: create-request
              method: POST

Retrieves weather forecasts, creates SAP speed restrictions, and notifies dispatchers via Slack.

naftiko: "0.5"
info:
  label: "Weather Impact Assessment Orchestrator"
  description: "Retrieves weather forecasts, creates SAP speed restrictions, and notifies dispatchers via Slack."
  tags:
    - operations
    - sap
    - slack
capability:
  exposes:
    - type: mcp
      namespace: weather-ops
      port: 8080
      tools:
        - name: assess-weather-impact
          description: "Assess weather, create restrictions, notify dispatchers."
          inputParameters:
            - name: region
              in: body
              type: string
              description: "Region."
            - name: forecast_hours
              in: body
              type: number
              description: "Hours ahead."
          steps:
            - name: get-forecast
              type: call
              call: "weather.get-forecast"
              with:
                region: "{{region}}"
            - name: restrict
              type: call
              call: "sap-tm.create-speed-restriction"
              with:
                region: "{{region}}"
            - name: notify
              type: call
              call: "slack.post-message"
              with:
                channel: "#dispatch-ops"
                text: "Weather alert for {{region}}"
  consumes:
    - type: http
      namespace: weather
      baseUri: "https://weather-api.cn.ca/v1"
      authentication:
        type: bearer
        token: "$secrets.weather_api_token"
      resources:
        - name: forecast
          path: "/forecast"
          operations:
            - name: get-forecast
              method: GET
    - type: http
      namespace: sap-tm
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/TM_RESTRICTION_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: restrictions
          path: "/A_SpeedRestriction"
          operations:
            - name: create-speed-restriction
              method: POST
    - type: http
      namespace: slack
      baseUri: "https://slack.com/api"
      authentication:
        type: bearer
        token: "$secrets.slack_bot_token"
      resources:
        - name: messages
          path: "/chat.postMessage"
          operations:
            - name: post-message
              method: POST

Monitors the health of CN's WebSphere application servers running legacy dispatch and billing systems.

naftiko: "0.5"
info:
  label: "WebSphere Application Server Health Check"
  description: "Monitors the health of CN's WebSphere application servers running legacy dispatch and billing systems."
  tags:
    - infrastructure
    - middleware
    - websphere
capability:
  exposes:
    - type: mcp
      namespace: app-server-health
      port: 8080
      tools:
        - name: check-websphere-health
          description: "Query WebSphere admin console for application server health status."
          inputParameters:
            - name: server_name
              in: body
              type: string
              description: "WebSphere server name."
          call: "websphere.get-server-status"
          with:
            server: "{{server_name}}"
          outputParameters:
            - name: status
              type: string
              mapping: "$.state"
            - name: heap_usage_pct
              type: number
              mapping: "$.jvm.heap_usage_pct"
            - name: active_threads
              type: integer
              mapping: "$.thread_pool.active"
  consumes:
    - type: http
      namespace: websphere
      baseUri: "https://websphere-admin.cn.ca/IBMJMXConnectorREST"
      authentication:
        type: basic
        username: "$secrets.websphere_admin_user"
        password: "$secrets.websphere_admin_password"
      resources:
        - name: servers
          path: "/mbeans/WebSphere:type=Server,name={{server}}"
          inputParameters:
            - name: server
              in: path
          operations:
            - name: get-server-status
              method: GET

Checks SAP equipment, validates Workday crew availability, publishes Confluence report.

naftiko: "0.5"
info:
  label: "Winter Operations Readiness Orchestrator"
  description: "Checks SAP equipment, validates Workday crew availability, publishes Confluence report."
  tags:
    - operations
    - sap
    - workday
    - confluence
capability:
  exposes:
    - type: mcp
      namespace: winter-ops
      port: 8080
      tools:
        - name: check-winter-readiness
          description: "Check winter readiness across SAP, Workday, Confluence."
          inputParameters:
            - name: region
              in: body
              type: string
              description: "Region."
            - name: season_year
              in: body
              type: string
              description: "Season year."
          steps:
            - name: check-equip
              type: call
              call: "sap.get-winter-equipment"
              with:
                region: "{{region}}"
            - name: check-crew
              type: call
              call: "workday.get-available-crew"
              with:
                region: "{{region}}"
            - name: publish
              type: call
              call: "confluence.create-page"
              with:
                space_key: "OPS"
                title: "Winter Readiness - {{region}}"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/PM_EQUIPMENT_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: equipment
          path: "/A_Equipment"
          operations:
            - name: get-winter-equipment
              method: GET
    - type: http
      namespace: workday
      baseUri: "https://wd2-impl-services1.workday.com/ccx/api/v1"
      authentication:
        type: bearer
        token: "$secrets.workday_token"
      resources:
        - name: workers
          path: "/cn/workers"
          operations:
            - name: assign-crew
              method: POST
            - name: get-available-crew
              method: GET
            - name: get-work-hours
              method: GET
            - name: add-training-record
              method: POST
            - name: get-worker
              method: GET
    - type: http
      namespace: confluence
      baseUri: "https://cn.atlassian.net/wiki/rest/api"
      authentication:
        type: basic
        username: "$secrets.confluence_user"
        password: "$secrets.confluence_api_token"
      resources:
        - name: content
          path: "/content"
          operations:
            - name: create-page
              method: POST

Checks certification status for a rail crew member in Workday.

naftiko: "0.5"
info:
  label: "Workday Crew Certification Status Lookup"
  description: "Checks certification status for a rail crew member in Workday."
  tags:
    - hr
    - workday
capability:
  exposes:
    - type: mcp
      namespace: crew-certs
      port: 8080
      tools:
        - name: get-crew-certifications
          description: "Look up crew member certification status."
          inputParameters:
            - name: employee_id
              in: body
              type: string
              description: "Workday employee ID."
          call: "workday.get-certifications"
          with:
            worker_id: "{{employee_id}}"
          outputParameters:
            - name: certs_valid
              type: string
              mapping: "$.certifications.allValid"
            - name: next_expiry
              type: string
              mapping: "$.certifications.nextExpiry"
  consumes:
    - type: http
      namespace: workday
      baseUri: "https://wd2-impl-services1.workday.com/ccx/api/v1"
      authentication:
        type: bearer
        token: "$secrets.workday_token"
      resources:
        - name: workers
          path: "/cn/workers/{{worker_id}}/certifications"
          inputParameters:
            - name: worker_id
              in: path
          operations:
            - name: get-certifications
              method: GET

Checks crew member certifications in Workday to ensure compliance with Transport Canada regulations.

naftiko: "0.5"
info:
  label: "Workday Employee Certification Tracker"
  description: "Checks crew member certifications in Workday to ensure compliance with Transport Canada regulations."
  tags:
    - hr
    - compliance
    - certifications
    - workday
capability:
  exposes:
    - type: mcp
      namespace: crew-certifications
      port: 8080
      tools:
        - name: check-certifications
          description: "Retrieve an employee's active certifications from Workday and flag any that are expiring."
          inputParameters:
            - name: employee_id
              in: body
              type: string
              description: "Workday employee ID."
          call: "workday.get-certifications"
          with:
            worker_id: "{{employee_id}}"
          outputParameters:
            - name: certifications
              type: array
              mapping: "$.certifications"
            - name: expiring_count
              type: integer
              mapping: "$.expiring_within_90_days"
  consumes:
    - type: http
      namespace: workday
      baseUri: "https://wd2-impl-services1.workday.com/ccx/api/v1"
      authentication:
        type: bearer
        token: "$secrets.workday_token"
      resources:
        - name: certifications
          path: "/workers/{{worker_id}}/certifications"
          inputParameters:
            - name: worker_id
              in: path
          operations:
            - name: get-certifications
              method: GET

Searches the Workday employee directory for CN rail operations and corporate staff.

naftiko: "0.5"
info:
  label: "Workday Employee Directory"
  description: "Searches the Workday employee directory for CN rail operations and corporate staff."
  tags:
    - hr
    - directory
    - workday
capability:
  exposes:
    - type: mcp
      namespace: hr-directory
      port: 8080
      tools:
        - name: search-employees
          description: "Search Workday for employees by name or department."
          inputParameters:
            - name: search_term
              in: body
              type: string
              description: "Search term."
          call: "workday.search-workers"
          with:
            search: "{{search_term}}"
          outputParameters:
            - name: employees
              type: array
              mapping: "$.workers"
            - name: total_count
              type: integer
              mapping: "$.total"
  consumes:
    - type: http
      namespace: workday
      baseUri: "https://wd2-impl-services1.workday.com/ccx/api/v1"
      authentication:
        type: bearer
        token: "$secrets.workday_token"
      resources:
        - name: workers
          path: "/workers"
          operations:
            - name: search-workers
              method: GET

Extracts payroll data from Workday for crew members and generates regional payroll summaries for finance.

naftiko: "0.5"
info:
  label: "Workday Payroll Report Generator"
  description: "Extracts payroll data from Workday for crew members and generates regional payroll summaries for finance."
  tags:
    - hr
    - payroll
    - workday
capability:
  exposes:
    - type: mcp
      namespace: payroll-reporting
      port: 8080
      tools:
        - name: get-payroll-summary
          description: "Retrieve payroll summary from Workday for a pay period and region."
          inputParameters:
            - name: pay_period
              in: body
              type: string
              description: "Pay period identifier."
            - name: region
              in: body
              type: string
              description: "Regional division."
          call: "workday.get-payroll"
          with:
            period: "{{pay_period}}"
            supervisory_org: "{{region}}_Operations"
          outputParameters:
            - name: total_gross
              type: number
              mapping: "$.summary.total_gross_pay"
            - name: headcount
              type: integer
              mapping: "$.summary.employee_count"
  consumes:
    - type: http
      namespace: workday
      baseUri: "https://wd2-impl-services1.workday.com/ccx/api/v1"
      authentication:
        type: bearer
        token: "$secrets.workday_token"
      resources:
        - name: payroll
          path: "/payroll/summaries"
          operations:
            - name: get-payroll
              method: GET

Monitors SAP yard congestion, triggers rerouting, notifies dispatchers via Slack.

naftiko: "0.5"
info:
  label: "Yard Congestion Management Orchestrator"
  description: "Monitors SAP yard congestion, triggers rerouting, notifies dispatchers via Slack."
  tags:
    - operations
    - sap
    - slack
capability:
  exposes:
    - type: mcp
      namespace: yard-congestion
      port: 8080
      tools:
        - name: manage-yard-congestion
          description: "Monitor congestion, reroute, notify."
          inputParameters:
            - name: yard_code
              in: body
              type: string
              description: "Yard code."
          steps:
            - name: get-status
              type: call
              call: "sap.get-yard-status"
              with:
                yard: "{{yard_code}}"
            - name: reroute
              type: call
              call: "dispatch.reroute-traffic"
              with:
                yard: "{{yard_code}}"
            - name: notify
              type: call
              call: "slack.post-message"
              with:
                channel: "#dispatch-ops"
                text: "Yard {{yard_code}} congestion alert"
  consumes:
    - type: http
      namespace: sap
      baseUri: "https://cn-s4.sap.com/sap/opu/odata/sap/TM_YARD_SRV"
      authentication:
        type: basic
        username: "$secrets.sap_user"
        password: "$secrets.sap_password"
      resources:
        - name: yards
          path: "/A_YardStatus"
          operations:
            - name: get-yard-status
              method: GET
    - type: http
      namespace: dispatch
      baseUri: "https://api.cn.ca/dispatch/v1"
      authentication:
        type: bearer
        token: "$secrets.dispatch_token"
      resources:
        - name: trains
          path: "/trains/{{train_id}}/status"
          inputParameters:
            - name: train_id
              in: path
          operations:
            - name: get-train-status
              method: GET
            - name: reroute-traffic
              method: POST
    - type: http
      namespace: slack
      baseUri: "https://slack.com/api"
      authentication:
        type: bearer
        token: "$secrets.slack_bot_token"
      resources:
        - name: messages
          path: "/chat.postMessage"
          operations:
            - name: post-message
              method: POST

Creates a Zoom webinar for CN town hall meetings and distributes calendar invites to employees via Microsoft Outlook.

naftiko: "0.5"
info:
  label: "Zoom Town Hall Meeting Scheduler"
  description: "Creates a Zoom webinar for CN town hall meetings and distributes calendar invites to employees via Microsoft Outlook."
  tags:
    - communications
    - meetings
    - zoom
    - microsoft-outlook
capability:
  exposes:
    - type: mcp
      namespace: corporate-comms
      port: 8080
      tools:
        - name: schedule-town-hall
          description: "Create a Zoom webinar for a corporate town hall and send Outlook invites."
          inputParameters:
            - name: topic
              in: body
              type: string
              description: "Town hall topic."
            - name: date_time
              in: body
              type: string
              description: "Date and time in ISO 8601."
            - name: duration
              in: body
              type: integer
              description: "Duration in minutes."
            - name: attendee_group
              in: body
              type: string
              description: "Distribution list email."
          steps:
            - name: create-webinar
              type: call
              call: "zoom.create-webinar"
              with:
                topic: "{{topic}}"
                start_time: "{{date_time}}"
                duration: "{{duration}}"
                type: 5
            - name: send-invite
              type: call
              call: "outlook.create-event"
              with:
                subject: "CN Town Hall: {{topic}}"
                start_time: "{{date_time}}"
                body: "Join the town hall via Zoom: {{create-webinar.join_url}}"
                attendees: "{{attendee_group}}"
  consumes:
    - type: http
      namespace: zoom
      baseUri: "https://api.zoom.us/v2"
      authentication:
        type: bearer
        token: "$secrets.zoom_token"
      resources:
        - name: webinars
          path: "/users/me/webinars"
          operations:
            - name: create-webinar
              method: POST
    - type: http
      namespace: outlook
      baseUri: "https://graph.microsoft.com/v1.0"
      authentication:
        type: bearer
        token: "$secrets.msgraph_token"
      resources:
        - name: events
          path: "/me/events"
          operations:
            - name: create-event
              method: POST