Skip to main content
Glama

explain_plan

Describes how a Tech Lead would allocate tasks for a given task description, offering insight into team role assignment and workflow organization.

Instructions

解释 Tech Lead 会如何分配任务(不实际执行)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYes要分析的任务描述

Implementation Reference

  • src/server.ts:289-302 (registration)
    Tool registration for 'explain_plan' in the ListToolsRequestSchema handler, defining its name, description, and inputSchema (requires 'task' string).
    {
      name: 'explain_plan',
      description: '解释 Tech Lead 会如何分配任务(不实际执行)',
      inputSchema: {
        type: 'object',
        properties: {
          task: {
            type: 'string',
            description: '要分析的任务描述',
          },
        },
        required: ['task'],
      },
    },
  • Handler for 'explain_plan' tool. Calls TechLead.analyze(task) to get a task analysis without executing it, then formats the response as a markdown plan showing workflow type, expert assignments, and execution order.
            case 'explain_plan': {
              const { task } = args as { task: string };
              
              // 让 Tech Lead 分析任务但不执行
              const analysis = await techLead.analyze(task);
              
              const expertPlan = analysis.experts
                .map((e: { id: string; name: string; tier: string; role: string }, i: number) => {
                  const subtask = analysis.subtasks.find(t => t.expertId === e.id);
                  return `${i + 1}. **${e.name}** (${e.tier})\n   - 角色: ${e.role.slice(0, 100)}...\n   - 任务: ${subtask?.description || '待分配'}`;
                })
                .join('\n\n');
              
              const plan = `# 🧠 任务执行计划
    
    ## 任务分析
    **原始任务**: ${task}
    
    ## Tech Lead 分析结果
    
    ### 工作流类型
    \`${analysis.workflow}\` ${analysis.workflow === 'sequential' ? '(顺序执行)' : analysis.workflow === 'parallel' ? '(并行执行)' : '(并行+审查)'}
    
    ### 专家分配 (${analysis.experts.length} 个)
    ${expertPlan}
    
    ### 执行顺序
    ${analysis.workflow === 'parallel' ? '所有专家将并行执行任务' : analysis.experts.map((e: { name: string }, i: number) => `${i + 1}. ${e.name}`).join(' → ')}
    
    ---
    > 💡 这只是计划预览,使用 \`team_work\` 工具实际执行任务`;
    
              return {
                content: [{ type: 'text', text: plan }],
              };
            }
  • TechLead.analyze() - the core AI-driven analysis method called by the explain_plan handler. Sends the task to an LLM with a system prompt asking it to dynamically create experts, decompose tasks, and choose a workflow.
    async analyze(task: string, context?: string): Promise<TaskAnalysis> {
      // 构建消息
      const userContent = context
        ? `用户需求:${task}\n\n额外上下文:${context}`
        : `用户需求:${task}`;
    
      const messages: ChatMessage[] = [
        { role: 'system', content: SYSTEM_PROMPT },
        { role: 'user', content: userContent },
      ];
    
      // 获取分析结果
      const response = await this.adapter.chat(messages);
      return this.parseAnalysis(response);
    }
  • TaskAnalysis interface - the type definition for the analysis result returned by techLead.analyze(), including summary, experts, subtasks, workflow type, and needsReview flag.
    export interface TaskAnalysis {
      /** 需求摘要 */
      readonly summary: string;
      /** 动态生成的专家列表 */
      readonly experts: readonly DynamicExpert[];
      /** 子任务列表 */
      readonly subtasks: readonly SubTask[];
      /** 工作流类型 */
      readonly workflow: WorkflowType;
      /** 是否需要最终审查 */
      readonly needsReview: boolean;
      /** 额外说明 */
      readonly notes?: string;
    }
Behavior3/5

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

No annotations provided, so description carries burden. It states the tool does not actually execute ('不实际执行'), a useful behavioral disclosure. However, it omits other traits like permissions, rate limits, or response details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence in Chinese with no redundancy or unnecessary words. It is appropriately sized for a simple tool.

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?

No output schema exists, yet the description does not explain the format or content of the explanation (e.g., text, structured data). This leaves agents unsure of what the tool returns, making it incomplete.

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 coverage is 100% for the single parameter 'task', so baseline is 3. The description adds no additional semantic value beyond what the schema already provides ('要分析的任务描述').

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 it explains how Tech Lead assigns tasks, with the specific verb '解释' and resource '任务分配'. It distinguishes from siblings like 'analyze_project_structure' but could more explicitly state the output.

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

Usage Guidelines2/5

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

No guidance on when to use vs alternatives (e.g., 'ask_expert', 'cost_estimate'). The description implies usage for task assignment understanding but lacks explicit context or exclusions.

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/7836246/claude-team-mcp'

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