@@ -338,6 +338,154 @@ List your own showcase submissions. **Requires authentication.** Returns all you
338338
339339## Rate Limits
340340
341- - ** Read operations** (documentation, search): 60 requests per minute
341+ - ** Read operations** (documentation, search, stats ): 60 requests per minute
342342- ** Write operations** (submit, update, delete): 10 requests per hour
343343- ** Pending submission limit** : Maximum 5 pending submissions per user
344+
345+ ---
346+
347+ ## NPM Stats Tools
348+
349+ These tools provide access to NPM download statistics for package analysis and comparison.
350+
351+ ### get_npm_stats
352+
353+ Get aggregated NPM download statistics for the TanStack org or a specific library.
354+
355+ #### Parameters
356+
357+ | Parameter | Type | Required | Description |
358+ | --------- | ------ | -------- | ----------------------------------------------------------------------------- |
359+ | ` library ` | string | No | Filter to specific library (e.g., ` query ` , ` router ` ). Omit for org-wide stats |
360+
361+ #### Response
362+
363+ For org-wide stats:
364+
365+ - ` org ` - Organization name ("tanstack")
366+ - ` totalDownloads ` - Total downloads across all packages
367+ - ` ratePerDay ` - Current download rate per day
368+ - ` updatedAt ` - When stats were last updated
369+ - ` libraries ` - Breakdown by library with ` id ` , ` totalDownloads ` , ` packageCount `
370+
371+ For library-specific stats:
372+
373+ - ` library ` - Library ID
374+ - ` totalDownloads ` - Total downloads for this library
375+ - ` ratePerDay ` - Current download rate per day
376+ - ` packageCount ` - Number of packages in this library
377+ - ` packages ` - Array of packages with ` name ` , ` downloads ` , ` ratePerDay `
378+
379+ #### Example
380+
381+ ``` json
382+ {
383+ "name" : " get_npm_stats" ,
384+ "arguments" : {
385+ "library" : " query"
386+ }
387+ }
388+ ```
389+
390+ ---
391+
392+ ### list_npm_comparisons
393+
394+ List available preset package comparisons for common categories like Data Fetching, State Management, Routing, etc.
395+
396+ #### Parameters
397+
398+ | Parameter | Type | Required | Description |
399+ | ---------- | ------ | -------- | -------------------------------------------------------- |
400+ | ` category ` | string | No | Filter by category name (case-insensitive partial match) |
401+
402+ #### Response
403+
404+ - ` comparisons ` - Array of comparisons with ` id ` , ` name ` , ` packages `
405+ - ` total ` - Number of comparisons returned
406+
407+ #### Available Categories
408+
409+ Data Fetching, State Management, Routing (React), Data Grids, Virtualization, Frameworks, Styling, Build Tools, Testing, Forms, UI Components, Animation, Date & Time, Validation, Documentation, All TanStack Packages
410+
411+ #### Example
412+
413+ ``` json
414+ {
415+ "name" : " list_npm_comparisons" ,
416+ "arguments" : {
417+ "category" : " state"
418+ }
419+ }
420+ ```
421+
422+ ---
423+
424+ ### compare_npm_packages
425+
426+ Compare NPM download statistics for multiple packages over a time range. Returns binned download data for analysis.
427+
428+ #### Parameters
429+
430+ | Parameter | Type | Required | Description |
431+ | ---------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------- |
432+ | ` packages ` | string[ ] | Yes | Package names to compare (max 10) |
433+ | ` range ` | string | No | Time range: ` 7-days ` , ` 30-days ` , ` 90-days ` , ` 180-days ` , ` 365-days ` , ` 730-days ` , ` all-time ` . Default: ` 30-days ` |
434+ | ` binType ` | string | No | Aggregation: ` daily ` , ` weekly ` , ` monthly ` . Default: ` weekly ` |
435+
436+ #### Response
437+
438+ - ` packages ` - Array of package data with:
439+ - ` name ` - Package name
440+ - ` totalDownloads ` - Total downloads in range
441+ - ` averagePerDay ` - Average downloads per day
442+ - ` data ` - Array of ` { date, downloads } ` binned by ` binType `
443+ - ` range ` - Object with ` start ` and ` end ` dates
444+ - ` binType ` - The aggregation level used
445+
446+ #### Example
447+
448+ ``` json
449+ {
450+ "name" : " compare_npm_packages" ,
451+ "arguments" : {
452+ "packages" : [" @tanstack/react-query" , " swr" , " @apollo/client" ],
453+ "range" : " 90-days" ,
454+ "binType" : " weekly"
455+ }
456+ }
457+ ```
458+
459+ ---
460+
461+ ### get_npm_package_downloads
462+
463+ Get detailed historical download data for a single NPM package.
464+
465+ #### Parameters
466+
467+ | Parameter | Type | Required | Description |
468+ | --------- | ------ | -------- | ------------------------------------------------------- |
469+ | ` package ` | string | Yes | Package name (e.g., ` @tanstack/react-query ` ) |
470+ | ` year ` | string | No | Year in YYYY format or ` current ` . Default: current year |
471+
472+ #### Response
473+
474+ - ` package ` - Package name
475+ - ` year ` - The year requested
476+ - ` totalDownloads ` - Total downloads for the year
477+ - ` dayCount ` - Number of days with data
478+ - ` averagePerDay ` - Average downloads per day
479+ - ` data ` - Array of daily downloads with ` { day, downloads } `
480+
481+ #### Example
482+
483+ ``` json
484+ {
485+ "name" : " get_npm_package_downloads" ,
486+ "arguments" : {
487+ "package" : " @tanstack/react-query" ,
488+ "year" : " 2024"
489+ }
490+ }
491+ ```
0 commit comments