Skip to main content
Glama

get_planning_history

Analyze backlog trend by retrieving deltas for top-10 RICE-ranked snapshots, surfacing churn and score changes to show improvement.

Instructions

Return trend deltas (current vs ~7 days ago / vs window_days ago) for the top-10 RICE-ranked backlog snapshots archived by rank_backlog. Surfaces churn (entries added/dropped) plus the average score of the current top-10. Use when a user asks 'are we improving' / 'show me the trend' / 'is the same idea always at the top'. Returns {snapshots_count, trend_7d, trend_30d, summary}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
window_daysNo

Implementation Reference

  • The core handler function get_planning_history_tool that reads snapshots and computes trend deltas (7d/window_days) for the top-10 RICE-ranked backlog.
    def get_planning_history_tool(arguments: dict) -> dict[str, Any]:
        """Return trend deltas (current vs ~7 days ago / vs ~30 days ago) for the
        top-10 RICE-ranked backlog. Surfaces churn (entries added/dropped) plus
        the average score of the current top-10.
    
        Args:
            window_days: int, default 30 — outer trend window. The 7d window is
            always computed in addition to window_days regardless of the value.
        """
        window_days = int(arguments.get("window_days", 30))
        all_snapshots = _read_snapshots()
        if not all_snapshots:
            return {
                "snapshots_count": 0,
                "trend_7d": {"avg_top10_score": 0.0, "new_top10_entries": [], "churned_top10_entries": []},
                "trend_30d": {"avg_top10_score": 0.0, "new_top10_entries": [], "churned_top10_entries": []},
                "summary": "No snapshots yet — call rank_backlog to start tracking.",
            }
    
        snaps_7d = _read_snapshots(window_days=7)
        snaps_window = _read_snapshots(window_days=window_days)
    
        trend_7d = _trend_block(snaps_7d or all_snapshots[-1:])
        trend_window = _trend_block(snaps_window or all_snapshots[-1:])
    
        latest = all_snapshots[-1]
        churn = len(trend_7d.get("new_top10_entries") or []) + len(trend_7d.get("churned_top10_entries") or [])
        parts = [
            f"{len(all_snapshots)} snapshot(s) archived; latest {latest.get('timestamp', '?')}.",
            f"Top-10 list churned by {churn} entries in last 7 days.",
        ]
        new_entries = trend_7d.get("new_top10_entries") or []
        if new_entries:
            parts.append(f"New into top-10 (7d): {', '.join(new_entries[:3])}.")
    
        return {
            "snapshots_count": len(all_snapshots),
            "window_days": window_days,
            "trend_7d": trend_7d,
            "trend_30d": trend_window,
            "summary": " ".join(parts),
        }
  • Input schema for get_planning_history: accepts optional window_days (integer, default 30).
    inputSchema={
        "type": "object",
        "properties": {
            "window_days": {"type": "integer", "default": 30},
        },
    },
  • Registration of 'get_planning_history' mapping to history_tools.get_planning_history_tool in the TOOL_HANDLERS dict.
    "get_planning_history": history_tools.get_planning_history_tool,
  • Tool registration with description and inputSchema via the MCP Tool object.
    Tool(
        name="get_planning_history",
        description=(
            "Return trend deltas (current vs ~7 days ago / vs window_days ago) "
            "for the top-10 RICE-ranked backlog snapshots archived by "
            "rank_backlog. Surfaces churn (entries added/dropped) plus the "
            "average score of the current top-10. Use when a user asks 'are we "
            "improving' / 'show me the trend' / 'is the same idea always at "
            "the top'. Returns {snapshots_count, trend_7d, trend_30d, summary}."
        ),
        inputSchema={
            "type": "object",
            "properties": {
                "window_days": {"type": "integer", "default": 30},
            },
        },
    ),
  • Helper _trend_block that computes avg_top10_score, new/churned top-10 entries from snapshots; also _read_snapshots, _top10_ids, _avg_top10_score helpers used by the handler.
    def _trend_block(snapshots: list[dict]) -> dict:
        if not snapshots:
            return {"avg_top10_score": 0.0, "new_top10_entries": [], "churned_top10_entries": []}
        latest = snapshots[-1]
        earliest = snapshots[0]
        latest_ids = _top10_ids(latest)
        earliest_ids = _top10_ids(earliest)
        return {
            "avg_top10_score": _avg_top10_score(latest),
            "new_top10_entries": sorted(latest_ids - earliest_ids),
            "churned_top10_entries": sorted(earliest_ids - latest_ids),
            "snapshots_in_window": len(snapshots),
        }
Behavior4/5

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

With no annotations, the description carries full burden. It explains that the tool compares current snapshots to those from ~7 days ago or a configurable window_days ago, and surfaces churn and average scores. It does not detail permissions or side effects but adequately describes behavioral traits.

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 concise, front-loaded with the core function, and includes examples and return structure. Every sentence adds value without unnecessary words.

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

Completeness5/5

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

Given the tool has no output schema, the description provides the return fields (snapshots_count, trend_7d, trend_30d, summary) and context about data sources (rank_backlog snapshots) and ranking method (RICE). It is sufficiently complete for a simple tool with one parameter.

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 only parameter, window_days, is implied in the description ('vs window_days ago') and its default is given. Though schema coverage is 0%, the description adds meaning by connecting it to the trend periods. It could be more explicit but is sufficient for a single parameter.

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 specifies a clear verb (Return), resource (trend deltas for top-10 RICE-ranked backlog snapshots), and what it provides (snapshots_count, trend_7d, trend_30d, summary). It distinguishes from siblings by referencing rank_backlog and trend analysis.

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

Usage Guidelines4/5

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

The description explicitly gives example user queries that indicate when to use this tool ('are we improving?', 'show me the trend', 'is the same idea always at the top'). It does not mention when not to use or alternatives, but the examples are clear enough.

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/kao273183/mk-plan-master'

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