Skip to main content
Glama
thana0623

prompts-mcp-server

by thana0623

make_plan

Generate a feasible execution plan from clarified task requirements after all checks pass. The plan is ready for user confirmation.

Instructions

【生成计划】在需求已澄清(check_requirements 全部 ✅)后,生成可行执行计划,等待用户确认。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskDescriptionYes已澄清的任务需求描述

Implementation Reference

  • The handleMakePlan method is the handler for the make_plan tool. It extracts taskDescription from args, validates it's provided, checks requirements clarity via checkRequirements(), and if clear, generates and formats a plan via generatePlan()/formatPlan(). Returns an error if requirements are not all clear.
    private async handleMakePlan(args: any) {
      const taskDescription = typeof args?.taskDescription === 'string' ? args.taskDescription : '';
    
      if (!taskDescription) {
        return {
          content: [{ type: 'text', text: '❌ 请提供任务需求描述。' }],
          isError: true,
        };
      }
    
      // 先检查需求是否明确
      const checkResult = checkRequirements(taskDescription);
      if (!checkResult.allClear) {
        return {
          content: [{
            type: 'text',
            text: `❌ **需求尚未完全明确,无法生成计划。**\n\n以下项目不明确: ${checkResult.unclearItems.join('、')}\n\n请先使用 \`check_requirements\` 工具追问澄清,待所有 5 项标准都 ✅ 后再生成计划。`,
          }],
          isError: true,
        };
      }
    
      const plan = generatePlan(taskDescription, checkResult);
      const formatted = formatPlan(plan);
    
      return {
        content: [{ type: 'text', text: formatted }],
      };
    }
  • The input schema registration for the make_plan tool. It defines a 'taskDescription' string property (required) as the sole input parameter, with a description indicating it should be the clarified task requirement.
    {
      name: 'make_plan',
      description: '【生成计划】在需求已澄清(check_requirements 全部 ✅)后,生成可行执行计划,等待用户确认。',
      inputSchema: {
        type: 'object',
        properties: {
          taskDescription: {
            type: 'string',
            description: '已澄清的任务需求描述',
          },
        },
        required: ['taskDescription'],
      },
    },
  • src/index.ts:244-245 (registration)
    The tool dispatch/case statement in CallToolRequestSchema handler that routes 'make_plan' requests to handleMakePlan().
    case 'make_plan':
      return this.handleMakePlan(args);
  • The generatePlan() function that creates a Plan object with steps derived from the task description keywords (backend, frontend, database, config, docs, tests, logging). Core plan generation logic.
    export function generatePlan(
      taskDescription: string,
      checkResult: ClarityCheckResult
    ): Plan {
      const desc = taskDescription.toLowerCase();
    
      const steps: PlanStep[] = [];
      let order = 1;
    
      // Step 1: 需求分析
      steps.push({
        order: order++,
        action: '需求分析与设计',
        details: '根据明确的需求,分析技术方案和实现路径',
        estimatedFiles: [],
      });
    
      // 检测是否涉及后端
      if (/后端|api|接口|数据库|service|controller|java|spring|auth|login|register/i.test(desc)) {
        steps.push({
          order: order++,
          action: '后端实现',
          details: '实现后端接口、业务逻辑、数据持久化',
          estimatedFiles: ['backend/src/**'],
        });
      }
    
      // 检测是否涉及前端
      if (/前端|页面|组件|ui|vue|react|界面|样式|交互/i.test(desc)) {
        steps.push({
          order: order++,
          action: '前端实现',
          details: '实现前端页面、组件、交互逻辑',
          estimatedFiles: ['frontend/src/**'],
        });
      }
    
      // 检测是否涉及数据库
      if (/数据库|表|sql|mysql|migration|entity/i.test(desc)) {
        steps.push({
          order: order++,
          action: '数据库变更',
          details: '创建/修改数据库表结构、迁移脚本',
          estimatedFiles: ['backend/sql/**', 'backend/src/main/**/model/**'],
        });
      }
    
      // 检测是否涉及配置
      if (/配置|config|yml|properties|环境/i.test(desc)) {
        steps.push({
          order: order++,
          action: '配置更新',
          details: '更新配置文件和环境变量',
          estimatedFiles: ['backend/src/main/resources/**'],
        });
      }
    
      // 文档更新
      steps.push({
        order: order++,
        action: '文档同步',
        details: '更新对应模块的 docs 文档和模块记录',
        estimatedFiles: ['docs/**', '.github/prompts/modules/**'],
      });
    
      // 测试
      steps.push({
        order: order++,
        action: '测试验证',
        details: '编写/更新测试用例,验证功能正确性',
        estimatedFiles: ['**/*Test.*', '**/*.spec.*'],
      });
    
      // 日志记录
      steps.push({
        order: order++,
        action: '日志记录',
        details: '记录本次对话日志(daily + recent-5 + summary-10 + 模块记录)',
        estimatedFiles: ['.github/prompts/**'],
      });
    
      return {
        title: `执行计划: ${taskDescription.slice(0, 50)}${taskDescription.length > 50 ? '...' : ''}`,
        description: taskDescription,
        steps,
        risks: [
          '需求变更可能导致计划调整',
          '依赖外部服务时可能受限于可用性',
        ],
        pendingConfirmation: true,
      };
    }
  • The formatPlan() function that formats a Plan object into a human-readable markdown string with title, steps, risks, and confirmation prompt.
    export function formatPlan(plan: Plan): string {
      const lines: string[] = [];
    
      lines.push('# 📋 执行计划');
      lines.push('');
      lines.push(`## ${plan.title}`);
      lines.push('');
      lines.push(`**需求描述**: ${plan.description}`);
      lines.push('');
      lines.push('## 执行步骤');
      lines.push('');
    
      for (const step of plan.steps) {
        lines.push(`### Step ${step.order}: ${step.action}`);
        lines.push('');
        lines.push(step.details);
        if (step.estimatedFiles.length > 0) {
          lines.push('');
          lines.push('预计涉及文件:');
          for (const f of step.estimatedFiles) {
            lines.push(`- \`${f}\``);
          }
        }
        lines.push('');
      }
    
      if (plan.risks.length > 0) {
        lines.push('## 风险提示');
        lines.push('');
        for (const risk of plan.risks) {
          lines.push(`- ⚠️ ${risk}`);
        }
        lines.push('');
      }
    
      lines.push('---');
      lines.push('');
      lines.push('🟡 **此计划等待你的确认。**');
      lines.push('');
      lines.push('请确认:');
      lines.push('1. 这个计划是否符合你的预期?');
      lines.push('2. 是否有需要调整的步骤?');
      lines.push('3. 确认后我将开始执行。');
    
      return lines.join('\n');
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It indicates the tool generates a plan and waits for user confirmation, implying a non-blocking or pending state. However, it lacks details on side effects, permissions, or what '等待用户确认' means for system state.

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, front-loaded sentence in Chinese that includes the tool's name in brackets. It includes all essential information without extra words.

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 simple tool (1 param, no output schema), the description covers prerequisite, action, and outcome adequately. It could mention the return value or plan format, but the core workflow is clear.

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?

Input schema has 100% coverage with a clear description for the required parameter 'taskDescription'. The tool description adds no new information beyond confirming it is the '已澄清的任务需求描述', so baseline 3 is appropriate.

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 the tool's action ('生成可行执行计划'), its prerequisite ('在需求已澄清 (check_requirements 全部 ✅) 后'), and its outcome ('等待用户确认'). It clearly distinguishes from sibling tool check_requirements by stating the sequential dependency.

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 states when to use the tool: after check_requirements is fully completed. It does not provide explicit when-not-to-use scenarios or list alternatives beyond the implied sibling, but the context is clear.

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/thana0623/prompts-mcp-server'

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