Skip to main content
Glama
elizagarate

Things MCP Server

by elizagarate

get_recent

Retrieve recently created tasks and projects from Things 3 by specifying a time period such as 3 days, 1 week, or 2 months.

Instructions

Get recently created items

Args: period: Time period (e.g., '3d', '1w', '2m', '1y')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler for get_recent tool. Queries Things for recently created items using the `things.last()` library, formats each with format_todo helper, and returns them separated by newlines.
    @mcp.tool
    async def get_recent(period: str) -> str:
        """Get recently created items
    
        Args:
            period: Time period (e.g., '3d', '1w', '2m', '1y')
        """
        todos = things.last(period, include_items=True)
        if not todos:
            return f"No items found in the last {period}"
    
        formatted_todos = [format_todo(todo) for todo in todos]
        return "\n\n---\n\n".join(formatted_todos)
  • Registration of get_recent as an MCP tool via @mcp.tool decorator on the FastMCP instance.
    @mcp.tool
    async def get_recent(period: str) -> str:
  • Schema/input definition: takes a single string parameter 'period' (e.g., '3d', '1w', '2m', '1y') and returns a string.
    @mcp.tool
    async def get_recent(period: str) -> str:
        """Get recently created items
    
        Args:
            period: Time period (e.g., '3d', '1w', '2m', '1y')
        """
        todos = things.last(period, include_items=True)
        if not todos:
            return f"No items found in the last {period}"
    
        formatted_todos = [format_todo(todo) for todo in todos]
        return "\n\n---\n\n".join(formatted_todos)
  • Helper used by get_recent to format each todo dict into a readable string with title, UUID, type, status, dates, notes, project, tags, checklist, etc.
    def format_todo(todo: dict) -> str:
        """Helper function to format a single todo into a readable string."""
        logger.debug(f"Formatting todo: {todo}")
        todo_text = f"Title: {todo['title']}"
    
        # Add UUID for reference
        todo_text += f"\nUUID: {todo['uuid']}"
    
        # Add type
        todo_text += f"\nType: {todo['type']}"
    
        # Add status if present
        if todo.get('status'):
            todo_text += f"\nStatus: {todo['status']}"
    
        # Look up parent project once (used for both List status and Project display)
        # For heading-level tasks without a project field, resolve heading -> project
        parent_project = None
        if todo.get('project'):
            try:
                parent_project = things.get(todo['project'])
            except Exception:
                pass
        elif todo.get('heading'):
            try:
                heading_obj = things.get(todo['heading'])
                if heading_obj and heading_obj.get('project'):
                    parent_project = things.get(heading_obj['project'])
            except Exception:
                pass
    
        # Add start/list location with Someday inheritance
        if todo.get('start'):
            effective_start = todo['start']
            if effective_start != 'Someday' and parent_project and parent_project.get('start') == 'Someday':
                effective_start = 'Someday'
                todo_text += f"\nList: {effective_start} (inherited from project)"
            else:
                todo_text += f"\nList: {effective_start}"
    
        # Add dates
        if todo.get('start_date'):
            todo_text += f"\nStart Date: {todo['start_date']}"
        if todo.get('deadline'):
            todo_text += f"\nDeadline: {todo['deadline']}"
        if todo.get('stop_date'):  # Completion date
            todo_text += f"\nCompleted: {todo['stop_date']}"
    
        # Add creation and modification dates
        if todo.get('created'):
            todo_text += f"\nCreated: {todo['created']}"
            # Calculate age since creation
            try:
                age_text = _calculate_age(todo['created'])
                todo_text += f"\nAge: {age_text}"
            except (ValueError, TypeError):
                pass
    
        if todo.get('modified'):
            todo_text += f"\nModified: {todo['modified']}"
            # Calculate time since last modification
            try:
                modified_age = _calculate_age(todo['modified'])
                todo_text += f"\nLast modified: {modified_age}"
            except (ValueError, TypeError):
                pass
    
        # Add notes if present
        if todo.get('notes'):
            todo_text += f"\nNotes: {todo['notes']}"
    
        # Add project info if present
        if parent_project:
            todo_text += f"\nProject: {parent_project['title']}"
    
        # Add heading info if present
        if todo.get('heading'):
            try:
                heading = things.get(todo['heading'])
                if heading:
                    todo_text += f"\nHeading: {heading['title']}"
            except Exception:
                pass
    
        # Add area info if present
        if todo.get('area'):
            try:
                area = things.get(todo['area'])
                if area:
                    todo_text += f"\nArea: {area['title']}"
            except Exception:
                pass
    
        # Add tags if present
        if todo.get('tags'):
            todo_text += f"\nTags: {', '.join(todo['tags'])}"
    
        # Add checklist if present and contains items
        if isinstance(todo.get('checklist'), list):
            todo_text += "\nChecklist:"
            for item in todo['checklist']:
                checkbox = "✓" if item.get('status') == 'completed' else "☐"
                todo_text += f"\n  {checkbox} {item['title']}"
    
        return todo_text
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description is the sole source of behavioral information. It does not mention read-only nature, performance implications, or any side effects. The behavioral context is minimal beyond the obvious retrieval operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise, consisting of a brief purpose line and a single-line parameter explanation. It is front-loaded with the core action, and every word contributes value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema, the description need not detail return values, but it omits the type of items returned (projects, todos, etc.) and any limitations. For a simple parameterization, it is adequate but lacks completeness about the domain of items.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The sole parameter 'period' is described as 'Time period (e.g., '3d', '1w', '2m', '1y')', providing concrete examples that clarify the format beyond the schema's bare 'string' type. This compensates for the 0% schema description coverage, though additional documentation of accepted values would improve it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get recently created items' clearly indicates the tool retrieves recently created items. The name 'get_recent' aligns with this purpose. However, it does not explicitly differentiate from siblings like get_upcoming or get_today, which could also involve time-based retrieval, but the period parameter clarifies its focus on recent past items.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as get_today, get_upcoming, or get_inbox. There are no explicit when-to-use or when-not-to-use instructions, and no mention of prerequisites or context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/elizagarate/things-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server