Skip to main content
Glama

loadPlan

Load or replace the current plan in MCPlanManager by providing a complete plan object with meta, state, and tasks data.

Instructions

通过一个完整的计划对象加载或替换当前计划。 这个工具会直接覆盖内存中的整个计划,请谨慎使用。

Args: plan_data (dict): 一个包含完整计划数据的字典对象,通常由 dumpPlan 工具导出。 它应包含 'meta', 'state', 和 'tasks' 三个顶级键。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
plan_dataYes

Implementation Reference

  • MCP tool handler for 'loadPlan', decorated with @mcp.tool(). Validates input via type hints and docstring, delegates execution to PlanManager.loadPlan() and wraps in ToolResponse.
    @mcp.tool()
    def loadPlan(plan_data: dict) -> ToolResponse:
        """
        通过一个完整的计划对象加载或替换当前计划。
        这个工具会直接覆盖内存中的整个计划,请谨慎使用。
    
        Args:
            plan_data (dict): 一个包含完整计划数据的字典对象,通常由 dumpPlan 工具导出。
                              它应包含 'meta', 'state', 和 'tasks' 三个顶级键。
        """
        return plan_manager.loadPlan(plan_data)
  • Core implementation of loadPlan in PlanManager class. Performs structural validation on plan_data, deepcopies it to self.plan_data, updates timestamp, and returns success response.
    def loadPlan(self, plan_data: Dict) -> Dict:
        """
        直接加载一个完整的计划对象,替换现有计划。
    
        Args:
            plan_data (Dict): 符合PlanManager内部数据结构的完整计划字典。
    
        Returns:
            Dict: 操作结果。
        """
        # (可选) 在这里可以添加对 plan_data 结构的验证
        # 例如,检查 'meta', 'state', 'tasks' 等关键字段是否存在
        if not all(k in plan_data for k in ["meta", "state", "tasks"]):
            return {"success": False, "message": "Invalid plan structure provided."}
        
        self.plan_data = deepcopy(plan_data)
        self._update_timestamp()
        
        return {"success": True, "message": "Plan loaded successfully."}
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: it '直接覆盖内存中的整个计划' (directly overwrites the entire plan in memory), which is a destructive operation, and warns to use it cautiously. This covers the mutation aspect and potential impact, though it doesn't detail error handling, permissions, or response format.

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 appropriately sized and front-loaded: the first sentence states the purpose, the second warns of risks, and the Args section clearly explains the parameter. Every sentence adds value without redundancy, making it efficient and well-structured for quick understanding.

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 tool's complexity (destructive operation with one nested parameter) and no annotations or output schema, the description is mostly complete. It covers purpose, behavior, and parameter details. However, it lacks information on return values or error cases, which could be useful given the mutation nature, though not strictly required without an output schema.

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

Parameters5/5

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

The schema description coverage is 0%, so the description must compensate. It adds significant meaning beyond the schema: it specifies that 'plan_data' is a dict with three top-level keys ('meta', 'state', 'tasks') and notes it's typically exported by 'dumpPlan'. This fully documents the parameter's structure and usage context, compensating for the lack of schema descriptions.

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 tool's purpose: '通过一个完整的计划对象加载或替换当前计划' (load or replace the current plan with a complete plan object). It specifies the verb ('加载或替换' - load or replace) and resource ('当前计划' - current plan). However, it doesn't explicitly differentiate from siblings like 'initializePlan' which might also set up a plan, though 'dumpPlan' is mentioned as a source for the data.

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 by mentioning that plan data '通常由 dumpPlan 工具导出' (usually exported by the dumpPlan tool), which suggests a workflow. It also warns '请谨慎使用' (use with caution) due to overwriting. However, it doesn't explicitly state when to use this versus alternatives like 'initializePlan' or provide clear exclusions, leaving some ambiguity.

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/donway19/MCPlanManager'

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