Skip to main content
Glama
taylorleese

mcp-toolz

todo_search

Search todo snapshots by content or context to find specific tasks across project sessions using content-based queries.

Instructions

Search todo snapshots by content or context description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
project_pathNoFilter by project path
limitNoMaximum number of results

Implementation Reference

  • MCP tool handler for 'todo_search' that extracts parameters, calls storage.search_todo_snapshots, formats results using _format_todo_snapshots_response, and returns TextContent.
    if name == "todo_search":
        query = arguments["query"]
        project_path = arguments.get("project_path")
        limit = arguments.get("limit", 10)
        snapshots = self.storage.search_todo_snapshots(query, project_path=project_path, limit=limit)
        result = self._format_todo_snapshots_response(snapshots)
        return [TextContent(type="text", text=result)]
  • Input schema defining parameters for the todo_search tool: query (required), project_path (optional filter), limit (default 10).
    inputSchema={
        "type": "object",
        "properties": {
            "query": {"type": "string", "description": "Search query"},
            "project_path": {
                "type": "string",
                "description": "Filter by project path",
            },
            "limit": {
                "type": "integer",
                "description": "Maximum number of results",
                "default": 10,
            },
        },
        "required": ["query"],
    },
  • Registration of the 'todo_search' tool in the list_tools() method's return list, including name, description, and schema.
    Tool(
        name="todo_search",
        description="Search todo snapshots by content or context description",
        inputSchema={
            "type": "object",
            "properties": {
                "query": {"type": "string", "description": "Search query"},
                "project_path": {
                    "type": "string",
                    "description": "Filter by project path",
                },
                "limit": {
                    "type": "integer",
                    "description": "Maximum number of results",
                    "default": 10,
                },
            },
            "required": ["query"],
        },
    ),
  • Core helper method implementing the search logic: SQL query with LIKE on 'todos' JSON field and 'context' field, optional project_path filter, ordered by timestamp DESC, limited results, converts rows to TodoListSnapshot objects.
    def search_todo_snapshots(
        self,
        query: str,
        project_path: str | None = None,
        limit: int = 10,
    ) -> list[TodoListSnapshot]:
        """Search todo snapshots by content or context description."""
        sql_query = """
            SELECT * FROM todo_snapshots
            WHERE (
                todos LIKE ? OR
                context LIKE ?
            )
        """
        params: list[Any] = [f"%{query}%", f"%{query}%"]
    
        if project_path:
            sql_query += " AND project_path = ?"
            params.append(project_path)
    
        sql_query += " ORDER BY timestamp DESC LIMIT ?"
        params.append(limit)
    
        with closing(sqlite3.connect(self.db_path)) as conn:
            conn.row_factory = sqlite3.Row
            cursor = conn.execute(sql_query, params)
            return [self._row_to_todo_snapshot(row) for row in cursor.fetchall()]
  • Helper function to format the list of todo snapshots into a readable string response, showing active status, progress, project, ID, timestamp, and context.
    def _format_todo_snapshots_response(self, snapshots: list[Any]) -> str:
        """Format a list of todo snapshots for response."""
        from models import TodoListSnapshot
    
        if not snapshots:
            return "No todo snapshots found."
    
        lines = [f"Found {len(snapshots)} todo snapshots:\n"]
        for snapshot in snapshots:
            if isinstance(snapshot, TodoListSnapshot):
                active_icon = "★" if snapshot.is_active else "○"
                completed = sum(1 for t in snapshot.todos if t.status == "completed")
                total = len(snapshot.todos)
                context_str = f" - {snapshot.context}" if snapshot.context else ""
    
                lines.append(
                    f"{active_icon} {snapshot.timestamp.isoformat()}\n"
                    f"   ID: {snapshot.id}\n"
                    f"   Project: {snapshot.project_path}\n"
                    f"   Progress: {completed}/{total} completed{context_str}\n"
                )
        return "\n".join(lines)
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions searching 'snapshots' but doesn't disclose behavioral traits like whether this is read-only (implied but not stated), pagination behavior, performance characteristics, error conditions, or what 'snapshots' entails. For a search tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

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 a single, efficient sentence with zero waste—it directly states the tool's function without fluff. It's appropriately sized and front-loaded, making it easy to parse quickly. Every word earns its place in conveying the core purpose.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for a search tool. It doesn't explain return values, result format, or error handling, and behavioral transparency is lacking. While schema coverage is high, the overall context (complexity of search operations) requires more disclosure about how the tool behaves and what to expect from outputs.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all parameters (query, project_path, limit) with descriptions. The description adds no additional meaning beyond implying search scope ('content or context description'), which aligns with the 'query' parameter but doesn't enhance schema info. Baseline 3 is appropriate when schema does the heavy lifting.

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 clearly states the action ('Search') and target resource ('todo snapshots'), specifying searchable fields ('content or context description'). It distinguishes from siblings like todo_list (list all) and todo_get (retrieve specific), though not explicitly named. The purpose is specific but lacks explicit sibling differentiation for a perfect score.

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

Usage Guidelines3/5

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

The description implies usage for searching by content/context, but provides no explicit guidance on when to use this vs. alternatives like todo_list (for unfiltered listing) or context_search (for broader context). No prerequisites, exclusions, or comparative advice are stated, leaving usage context inferred rather than clearly defined.

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/taylorleese/mcp-toolz'

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