Skip to main content
Glama
Wulnut
by Wulnut

list_child_tasks

Retrieve child tasks for a given parent work item ID. Specify a relation name when multiple sub-task rules exist to get the correct task list.

Instructions

列出指定父工作项下的子任务(通过“空间关联关系”规则实现)。

背景说明:
- 飞书项目中的“父子/子任务”通常不是一个固定字段,而是通过“关联关系规则(Relation Rule)”实现。
- 同一个项目空间可能存在多条关联规则(例如:"子任务"、"关联"、"阻塞")。
  因此本工具支持 relation_name 参数用于选择具体规则。

本工具的行为:
1) 解析 project / work_item_type 参数(支持 project_name 与 project_key 两种输入)。
2) 通过 HierarchyProvider 选择关联规则:
   - 若 relation_name 传入:按名称精确匹配。
   - 若未传:若规则只有 1 条则自动选择;若 >1 条则报错提示需要指定。
3) 调用 RelationAPI.work_item_list 获取关联的 work_item_ids。

注意:
- 成功时返回 JSON 字符串(success=true)。
- 失败时返回纯文本错误信息(由 with_error_handling 统一处理),不会返回 JSON。

Args:
    parent_issue_id: 父工作项 ID(必填)。
    relation_name: 关联规则名称(可选)。规则多于 1 条时建议必填。
    page_num: 页码,从 1 开始(默认 1)。
    page_size: 每页数量(默认 20)。
    project: 项目标识符(可选)。可以是项目名称或 project_key;不传则使用环境变量 FEISHU_PROJECT_KEY 指定的默认项目。
    work_item_type: 工作项类型名称(可选)。例如:"问题管理"、"Issue管理"。
    user_key: (可选) 飞书用户标识符 (X-USER-KEY)。

Returns:
    JSON 字符串。

    成功时(success=true)data 格式:
    {
      "work_item_ids": [int, ...]
    }

Examples:
    # 获取父任务 123 的子任务列表(自动选择唯一规则)
    list_child_tasks(parent_issue_id=123)

    # 指定关联规则名称
    list_child_tasks(parent_issue_id=123, relation_name="子任务")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNo
page_numNo
user_keyNo
page_sizeNo
relation_nameNo
work_item_typeNo
parent_issue_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.2

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden. It documents success vs failure response formats (JSON with success=true vs plain-text error), the env-var default for project, and page/relation-rule resolution behavior. It stops short of mentioning auth requirements, rate limits, or empty-result behavior, but those are not essential for a read-only list operation.

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 sectioned and front-loaded with the one-line purpose. Although long, the background, numbered behavior, Args, Returns, and Examples sections are each informative and avoid filler.

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?

For a 7-parameter tool with no annotation support and zero schema descriptions, the description is complete: it explains parameter semantics, default selection, ambiguity errors, return payload shape, and gives two examples. There is no missing information an agent needs to invoke it correctly.

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?

Schema description coverage is 0%, and the description fully compensates: every one of the 7 parameters is explained with type, default, and meaning, including parent_issue_id, relation_name, page_num/page_size, project, work_item_type, and user_key. Examples show realistic calls.

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 opening sentence states a specific action and resource: '列出指定父工作项下的子任务' and clarifies the underlying mechanism (空间关联关系规则). The behavior section names the exact API call, RelationAPI.work_item_list, which separates this from broader task tools like get_tasks and from bind_child_tasks/unbind_child_tasks.

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?

It gives concrete selection rules for relation_name: exact match if provided, auto-select when there is exactly one rule, and an explicit error when multiple rules exist. It does not explicitly list alternative tools or say when not to use this tool, 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.