Skip to main content
Glama

batch_assign_timeframes

Assign timeframes to multiple todos in bulk for weekly planning. Use JSON input to specify todo-timeframe pairs and receive update summaries.

Instructions

Bulk assign timeframes to multiple todos (for weekly planning).

Args: assignments_json: JSON array of {todo_id, timeframe} objects

Example:

[
    {"todo_id": 10, "timeframe": "this_week"},
    {"todo_id": 15, "timeframe": "next_sprint"},
    {"todo_id": 20, "timeframe": "someday"}
]

Returns: Summary of updates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assignments_jsonYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `batch_assign_timeframes` tool handler implementation. It validates input JSON, checks against allowed timeframes, and updates the database.
    @mcp.tool()
    async def batch_assign_timeframes(assignments_json: str) -> str:
        """Bulk assign timeframes to multiple todos (for weekly planning).
    
        Args:
            assignments_json: JSON array of {todo_id, timeframe} objects
    
        Example:
        ```
        [
            {"todo_id": 10, "timeframe": "this_week"},
            {"todo_id": 15, "timeframe": "next_sprint"},
            {"todo_id": 20, "timeframe": "someday"}
        ]
        ```
    
        Returns:
            Summary of updates
        """
        db = await storage.get_db()
    
        try:
            assignments = json.loads(assignments_json)
        except json.JSONDecodeError as e:
            return f"Error: Invalid JSON: {e}"
    
        valid_timeframes = ["this_week", "next_sprint", "this_month", "this_quarter", "someday"]
        updated = 0
        errors = []
    
        for assignment in assignments:
            todo_id = assignment.get("todo_id")
            timeframe = assignment.get("timeframe")
    
            if not todo_id or not timeframe:
                errors.append(f"Missing todo_id or timeframe in: {assignment}")
                continue
    
            if timeframe not in valid_timeframes:
                errors.append(f"Invalid timeframe '{timeframe}' for todo #{todo_id}")
                continue
    
            await db.execute(
                "UPDATE todos SET timeframe = ? WHERE id = ?",
                (timeframe, todo_id),
            )
            updated += 1
    
        await db.commit()
    
        response = f"✓ Updated {updated} todos with timeframes"
        if errors:
            response += f"\n\n⚠️ {len(errors)} errors:\n"
            for error in errors[:5]:
                response += f"  • {error}\n"
    
        return response
Behavior3/5

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

With no annotations provided, the description carries the full disclosure burden. It mentions the return value ('Summary of updates') and shows input format via the example, but omits critical behavioral details such as error handling (partial vs atomic failures), overwrite behavior, or required permissions.

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 excellently structured with clear sections (purpose, Args, Example, Returns) and zero wasted words. Information is front-loaded with the core purpose, followed immediately by the parameter specification and illustrative example.

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

Completeness4/5

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

Given the single complex parameter and existence of an output schema, the description provides sufficient context through the JSON example to enable correct invocation. However, it lacks enumeration of valid timeframe strings or error behavior details that would make it fully complete for a batch mutation operation.

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?

Schema description coverage is 0%, requiring the description to compensate. It successfully documents the JSON structure through the Args section and concrete example, clarifying that assignments_json contains objects with todo_id and timeframe keys. It does not enumerate valid timeframe values, preventing a perfect score.

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

Purpose5/5

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

The description clearly states 'Bulk assign timeframes to multiple todos' with the specific context '(for weekly planning)'. The term 'Bulk' effectively distinguishes this from the sibling tool 'set_todo_timeframe', indicating this handles multiple items in one operation.

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 provides contextual usage via '(for weekly planning)', but does not explicitly state when to use this versus the singular 'set_todo_timeframe' or mention prerequisites like valid todo_id requirements. The guidance remains implied rather than explicit.

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/94aharris/coach-ai'

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