pal

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Pal MCP Toolkit

Pal MCP 工具包

The Pal MCP toolkit provides specialized tools for comprehensive code analysis and development workflows. Each tool follows a multi-step workflow pattern with expert validation.
Pal MCP 工具包为全面的代码分析和开发工作流提供专用工具,每个工具都遵循经过专家验证的多步工作流模式。

Quick Reference: Tool Selection

快速参考:工具选择

Task TypeToolReference
Architecture & code analysis before complex tasks
mcp__zen__analyze
analyze.md
Bug investigation & root cause analysis
mcp__zen__debug
debug.md
Strategic planning & task breakdown
mcp__zen__planner
planner.md
Code smell detection & refactoring
mcp__zen__refactor
refactor.md
Code review after completing tasks
mcp__zen__codereview
review.md
Execution flow & dependency tracing
mcp__zen__tracer
tracer.md
任务类型工具参考文档
复杂任务前的架构与代码分析
mcp__zen__analyze
analyze.md
Bug排查与根因分析
mcp__zen__debug
debug.md
战略规划与任务拆解
mcp__zen__planner
planner.md
代码异味检测与重构
mcp__zen__refactor
refactor.md
任务完成后的代码审查
mcp__zen__codereview
review.md
执行流与依赖追踪
mcp__zen__tracer
tracer.md

Critical Workflow Requirements

关键工作流要求

<critical>
<critical>

Mandatory Completion Rules

强制完成规则

  • NEVER stop a workflow before
    next_step_required: false
    is returned
  • ALWAYS increment
    step_number
    and call the tool again when
    next_step_required: true
  • TASK INVALIDATION: Incomplete workflows result in immediate task rejection
  • NO EXCEPTIONS: Even if analysis seems complete after step 1, you MUST complete all steps
  • 严禁在返回
    next_step_required: false
    之前终止工作流
  • next_step_required: true
    时,务必递增
    step_number
    并再次调用工具
  • 任务失效规则:未完成的工作流会导致任务直接被驳回
  • 无例外规则:即使第一步之后分析看起来已经完成,你也必须完成所有步骤

Model Requirement

模型要求

  • MANDATORY: Always use
    model: "anthropic/claude-opus-4.6"
    for ALL Pal MCP tool calls
  • NEVER use any other model when calling Pal MCP tools
  • 强制要求:所有Pal MCP工具调用必须使用
    model: "anthropic/claude-opus-4.6"
  • 调用Pal MCP工具时严禁使用任何其他模型

Workflow Validation Checklist

工作流验证检查清单

  1. Check
    next_step_required
    in every response
  2. If
    true
    , call the tool again with incremented
    step_number
  3. Never proceed with implementation while
    next_step_required: true
  4. Workflow is complete ONLY when
    next_step_required: false
</critical>
  1. 每次响应都要检查
    next_step_required
  2. 如果为
    true
    ,递增
    step_number
    后再次调用工具
  3. next_step_required: true
    时,永远不要进入实现环节
  4. 仅当
    next_step_required: false
    时,工作流才算完成
</critical>

Tool Overview

工具概览

Analyze (
mcp__zen__analyze
)

分析工具(
mcp__zen__analyze

When to Use:
  • Before complex tasks to understand existing architecture
  • Architecture review and system design assessment
  • Performance, security, and technical debt analysis
Key Parameters:
  • analysis_type
    :
    "architecture"
    |
    "performance"
    |
    "security"
    |
    "quality"
    |
    "general"
  • output_format
    :
    "summary"
    |
    "detailed"
    |
    "actionable"
See references/analyze.md for complete documentation.

适用场景:
  • 执行复杂任务前,了解现有架构
  • 架构评审与系统设计评估
  • 性能、安全和技术债分析
核心参数:
  • analysis_type
    :
    "architecture"
    |
    "performance"
    |
    "security"
    |
    "quality"
    |
    "general"
  • output_format
    :
    "summary"
    |
    "detailed"
    |
    "actionable"
完整文档见 references/analyze.md

Debug (
mcp__zen__debug
)

调试工具(
mcp__zen__debug

When to Use:
  • Bug investigation and root cause analysis
  • Performance issues, memory leaks, race conditions
  • Integration failures and service communication problems
Key Parameters:
  • hypothesis
    : Current theory about the root cause
  • confidence
    :
    "exploring"
    |
    "low"
    |
    "medium"
    |
    "high"
    |
    "very_high"
    |
    "almost_certain"
    |
    "certain"
See references/debug.md for complete documentation.

适用场景:
  • Bug排查与根因分析
  • 性能问题、内存泄漏、竞态条件排查
  • 集成失败与服务通信问题排查
核心参数:
  • hypothesis
    : 当前关于根因的假设
  • confidence
    :
    "exploring"
    |
    "low"
    |
    "medium"
    |
    "high"
    |
    "very_high"
    |
    "almost_certain"
    |
    "certain"
完整文档见 references/debug.md

Planner (
mcp__zen__planner
)

规划工具(
mcp__zen__planner

When to Use:
  • Breaking down complex tasks into manageable steps
  • System design and architectural decisions
  • Migration planning and implementation strategies
Key Parameters:
  • is_step_revision
    : For refining previous steps
  • is_branch_point
    : For exploring alternative approaches
  • branch_id
    : Naming alternative approaches
See references/planner.md for complete documentation.

适用场景:
  • 将复杂任务拆解为可执行的步骤
  • 系统设计与架构决策
  • 迁移规划与实现策略制定
核心参数:
  • is_step_revision
    : 用于优化之前的步骤
  • is_branch_point
    : 用于探索替代方案
  • branch_id
    : 替代方案命名
完整文档见 references/planner.md

Refactor (
mcp__zen__refactor
)

重构工具(
mcp__zen__refactor

When to Use:
  • Addressing code smells and technical debt
  • Decomposing large modules or classes
  • Modernizing legacy patterns
Key Parameters:
  • refactor_type
    :
    "codesmells"
    |
    "decompose"
    |
    "modernize"
    |
    "organization"
  • focus_areas
    :
    ["performance", "readability", "maintainability", "security"]
See references/refactor.md for complete documentation.

适用场景:
  • 处理代码异味与技术债
  • 拆解大型模块或类
  • 升级老旧代码模式
核心参数:
  • refactor_type
    :
    "codesmells"
    |
    "decompose"
    |
    "modernize"
    |
    "organization"
  • focus_areas
    :
    ["performance", "readability", "maintainability", "security"]
完整文档见 references/refactor.md

Code Review (
mcp__zen__codereview
)

代码审查工具(
mcp__zen__codereview

When to Use:
  • After completing a task (MANDATORY)
  • Before submitting pull requests
  • Validating implementation against project standards
Key Parameters:
  • review_type
    :
    "full"
    for comprehensive analysis
  • severity_filter
    :
    "all"
    to catch all severity levels
  • focus_on
    : Specific areas like "performance", "security", "type-safety"
See references/review.md for complete documentation.

适用场景:
  • 任务完成后(强制要求)
  • 提交pull request之前
  • 验证实现是否符合项目规范
核心参数:
  • review_type
    :
    "full"
    代表全面分析
  • severity_filter
    :
    "all"
    代表捕获所有严重级别的问题
  • focus_on
    : 特定关注领域,比如"performance"、"security"、"type-safety"
完整文档见 references/review.md

Tracer (
mcp__zen__tracer
)

追踪工具(
mcp__zen__tracer

When to Use:
  • Understanding code execution paths
  • Mapping dependencies before refactoring
  • Debugging complex flows
Key Parameters:
  • trace_mode
    :
    "precision"
    (execution flow) |
    "dependencies"
    (structural analysis) |
    "ask"
  • target_description
    : Clear description of what to trace and why
See references/tracer.md for complete documentation.
适用场景:
  • 理解代码执行路径
  • 重构前梳理依赖关系
  • 调试复杂流程
核心参数:
  • trace_mode
    :
    "precision"
    (执行流) |
    "dependencies"
    (结构分析) |
    "ask"
  • target_description
    : 对追踪目标和原因的清晰描述
完整文档见 references/tracer.md

Common Required Parameters

通用必填参数

All Pal MCP tools require these base parameters:
json
{
  "step": "Description of current step",
  "step_number": 1,
  "total_steps": 2,
  "next_step_required": true,
  "findings": "Findings from this step",
  "model": "anthropic/claude-opus-4.6"
}
所有Pal MCP工具都需要以下基础参数:
json
{
  "step": "Description of current step",
  "step_number": 1,
  "total_steps": 2,
  "next_step_required": true,
  "findings": "Findings from this step",
  "model": "anthropic/claude-opus-4.6"
}

File Path Requirements

文件路径要求

  • ALWAYS use full absolute paths for
    relevant_files
  • Include files directly involved in the analysis
  • Include related files that provide context
  • Include test files when relevant
  • 务必
    relevant_files
    使用完整的绝对路径
  • 包含直接参与分析的文件
  • 包含能提供上下文的相关文件
  • 适用时包含测试文件

Typical Workflow Pattern

典型工作流模式

  1. Start: Call the tool with
    step_number: 1
    and initial strategy
  2. Iterate: Increment
    step_number
    and refine findings based on previous step
  3. Continue: Keep calling until
    next_step_required: false
  4. Complete: Only proceed with implementation after workflow completes
  1. 启动:以
    step_number: 1
    和初始策略调用工具
  2. 迭代:递增
    step_number
    ,基于上一步的结果优化分析结论
  3. 继续:持续调用工具直到
    next_step_required: false
  4. 完成:仅在工作流完成后再进入实现环节

Violation Examples (Task Rejection)

违规示例(会导致任务被驳回)

  • Calling a Pal tool once and proceeding to implementation
  • Skipping steps because analysis seems complete
  • Starting implementation before
    next_step_required: false
  • Using a model other than
    anthropic/claude-opus-4.6
  • 仅调用一次Pal工具就进入实现环节
  • 因为分析看起来已经完成就跳过步骤
  • next_step_required: false
    返回前就开始实现
  • 使用
    anthropic/claude-opus-4.6
    之外的模型