naftiko: 1.0.0-alpha2 info: label: METACRAN CranLogs API — Top Packages description: 'METACRAN CranLogs API — Top Packages. 1 operations. Lead operation: Get Top Downloaded Packages. Self-contained Naftiko capability covering one R business surface.' tags: - R - Top Packages created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: R_API_KEY: R_API_KEY capability: consumes: - type: http namespace: metacran-cranlogs-top-packages baseUri: https://cranlogs.r-pkg.org description: METACRAN CranLogs API — Top Packages business capability. Self-contained, no shared references. resources: - name: top-period-count path: /top/{period}/{count} operations: - name: gettoppackages method: GET description: Get Top Downloaded Packages outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: period in: path type: string description: Time period for ranking (last-day, last-week, last-month) required: true - name: count in: path type: integer description: Number of top packages to return (max 100) required: true exposes: - type: rest namespace: metacran-cranlogs-top-packages-rest port: 8080 description: REST adapter for METACRAN CranLogs API — Top Packages. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/top/{period}/{count} name: top-period-count description: REST surface for top-period-count. operations: - method: GET name: gettoppackages description: Get Top Downloaded Packages call: metacran-cranlogs-top-packages.gettoppackages with: period: rest.period count: rest.count outputParameters: - type: object mapping: $. - type: mcp namespace: metacran-cranlogs-top-packages-mcp port: 9090 transport: http description: MCP adapter for METACRAN CranLogs API — Top Packages. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: get-top-downloaded-packages description: Get Top Downloaded Packages hints: readOnly: true destructive: false idempotent: true call: metacran-cranlogs-top-packages.gettoppackages with: period: tools.period count: tools.count outputParameters: - type: object mapping: $.