search_todos
Find todos by matching a query against titles and notes.
Instructions
Search todos by title or notes
Args: query: Search term to look for in todo titles and notes
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/things_mcp/server.py:272-283 (handler)The actual handler function for the 'search_todos' tool. It is decorated with @mcp.tool, takes a query string parameter, calls things.search(query, include_items=True), formats the results using format_todo, and returns them as a string.
async def search_todos(query: str) -> str: """Search todos by title or notes Args: query: Search term to look for in todo titles and notes """ todos = things.search(query, include_items=True) if not todos: return f"No todos found matching '{query}'" formatted_todos = [format_todo(todo) for todo in todos] return "\n\n---\n\n".join(formatted_todos) - src/things_mcp/server.py:271-271 (registration)The @mcp.tool decorator registers 'search_todos' as an MCP tool on the FastMCP server instance.
@mcp.tool - src/things_mcp/server.py:6-6 (helper)The format_todo helper is imported from formatters and used inside search_todos to format each todo result.
from .formatters import format_todo, format_project, format_area, format_tag, format_heading - src/things_mcp/server.py:273-276 (schema)The docstring serves as the schema/description for the tool, defining query as the only parameter for searching todos by title or notes.
"""Search todos by title or notes Args: query: Search term to look for in todo titles and notes