MBTA · Capability

MBTA V3 API — Routes

MBTA V3 API — Routes. 2 operations. Lead operation: List routes. Self-contained Naftiko capability covering one Mbta business surface.

Run with Naftiko MbtaRoutes

What You Can Do

GET
Listroutes — List routes
/v1/routes
GET
Getroute — Get route
/v1/routes/{id}

MCP Tools

list-routes

List routes

read-only idempotent
get-route

Get route

read-only idempotent

Capability Spec

mbta-v3-routes.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: MBTA V3 API — Routes
  description: 'MBTA V3 API — Routes. 2 operations. Lead operation: List routes. Self-contained Naftiko capability covering
    one Mbta business surface.'
  tags:
  - Mbta
  - Routes
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    MBTA_API_KEY: MBTA_API_KEY
capability:
  consumes:
  - type: http
    namespace: mbta-v3-routes
    baseUri: https://api-v3.mbta.com
    description: MBTA V3 API — Routes business capability. Self-contained, no shared references.
    resources:
    - name: routes
      path: /routes
      operations:
      - name: listroutes
        method: GET
        description: List routes
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: filter[stop]
          in: query
          type: string
        - name: filter[type]
          in: query
          type: string
        - name: filter[direction_id]
          in: query
          type: integer
        - name: filter[date]
          in: query
          type: string
    - name: routes-id
      path: /routes/{id}
      operations:
      - name: getroute
        method: GET
        description: Get route
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    authentication:
      type: apikey
      key: x-api-key
      value: '{{env.MBTA_API_KEY}}'
      placement: header
  exposes:
  - type: rest
    namespace: mbta-v3-routes-rest
    port: 8080
    description: REST adapter for MBTA V3 API — Routes. One Spectral-compliant resource per consumed operation, prefixed with
      /v1.
    resources:
    - path: /v1/routes
      name: routes
      description: REST surface for routes.
      operations:
      - method: GET
        name: listroutes
        description: List routes
        call: mbta-v3-routes.listroutes
        with:
          filter[stop]: rest.filter[stop]
          filter[type]: rest.filter[type]
          filter[direction_id]: rest.filter[direction_id]
          filter[date]: rest.filter[date]
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/routes/{id}
      name: routes-id
      description: REST surface for routes-id.
      operations:
      - method: GET
        name: getroute
        description: Get route
        call: mbta-v3-routes.getroute
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: mbta-v3-routes-mcp
    port: 9090
    transport: http
    description: MCP adapter for MBTA V3 API — Routes. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: list-routes
      description: List routes
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: mbta-v3-routes.listroutes
      with:
        filter[stop]: tools.filter[stop]
        filter[type]: tools.filter[type]
        filter[direction_id]: tools.filter[direction_id]
        filter[date]: tools.filter[date]
      outputParameters:
      - type: object
        mapping: $.
    - name: get-route
      description: Get route
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: mbta-v3-routes.getroute
      outputParameters:
      - type: object
        mapping: $.