get_stats
Retrieve statistics about arXiv papers in the local database, including total count, date range, daily breakdown, and top categories.
Instructions
Get statistics about papers stored in the local database.
Returns total count, date range, per-date breakdown, and top categories.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/arxiv_mcp_server/server.py:211-220 (handler)The get_stats function is registered as an MCP tool using the @mcp.tool() decorator. It interacts with the local database to retrieve statistics and returns them as a JSON-formatted string.
@mcp.tool() def get_stats() -> str: """Get statistics about papers stored in the local database. Returns total count, date range, per-date breakdown, and top categories. """ logger.info("Getting stats") db = _get_db() stats = db.get_enhanced_stats() return json.dumps(stats.model_dump(), ensure_ascii=False, indent=2)