get_logbook
Retrieve completed todos from the Logbook within a specified time period. Customize the lookback range and limit the number of entries for efficient task tracking and review.
Instructions
Get completed todos from Logbook, defaults to last 7 days
Args: period: Time period to look back (e.g., '3d', '1w', '2m', '1y'). Defaults to '7d' limit: Maximum number of entries to return. Defaults to 50
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| period | No | 7d |
Implementation Reference
- things_server.py:61-75 (handler)The @mcp.tool decorated function that implements the get_logbook tool. It retrieves completed todos from the last specified period using things.last(), limits the results, formats them with format_todo, and joins them with separators.@mcp.tool async def get_logbook(period: str = "7d", limit: int = 50) -> str: """Get completed todos from Logbook, defaults to last 7 days Args: period: Time period to look back (e.g., '3d', '1w', '2m', '1y'). Defaults to '7d' limit: Maximum number of entries to return. Defaults to 50 """ todos = things.last(period, status='completed', include_items=True) if todos and len(todos) > limit: todos = todos[:limit] if not todos: return "No items found" formatted_todos = [format_todo(todo) for todo in todos] return "\n\n---\n\n".join(formatted_todos)
- things_server.py:61-61 (registration)The @mcp.tool decorator registers the get_logbook function as an MCP tool.@mcp.tool
- things_server.py:62-68 (schema)Function signature and docstring define the input schema (period: str, limit: int) and output (str).async def get_logbook(period: str = "7d", limit: int = 50) -> str: """Get completed todos from Logbook, defaults to last 7 days Args: period: Time period to look back (e.g., '3d', '1w', '2m', '1y'). Defaults to '7d' limit: Maximum number of entries to return. Defaults to 50 """