Skip to main content
Glama
AliMail Admin MCP

AliMail Admin MCP

by mfc-open

获取部门树

get_department_tree
Read-onlyIdempotent

Recursively retrieves a complete department tree from Alibaba Mail, handling pagination automatically and optionally including direct members. Set depth and node limits to keep large organizations manageable.

Instructions

从指定部门(默认根部门)递归获取完整部门树,自动处理分页。可选包含每个部门的直属成员。大型组织请设置 maxDepth / maxNodes 控制规模,结果中 truncated=true 表示被截断。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_department_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootIdNo起始部门 ID,默认 $root$root
maxDepthNo最大递归深度
maxNodesNo最多返回的部门数量
includeUsersNo是否包含每个部门的直属成员(调用次数显著增加)
maxUsersPerDepartmentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive, open-world semantics, and the description adds genuinely new behavioral facts: pagination is automatic and results can be truncated with a truncated=true flag. That truncation disclosure is important for the agent to interpret partial results. It does not mention rate/cost implications of includeUsers in the description itself (the cost note lives only in the schema).

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?

Three short sentences, front-loaded with behavior, then the optional includeUsers dimension, then scale control. Every clause carries information; nothing is redundant.

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?

With five optional parameters, no output schema, and automatic pagination, the description covers the essentials: default root, recursion scope, optional member inclusion, scale limits, and the truncated indicator. Given the absence of an output schema, it does a fair job explaining the one output field that matters, though it could say more about result shape (e.g., nested children structure).

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 80%, so the schema already documents rootId defaults, maxDepth/maxNodes bounds, and the includeUsers cost note. The description adds the operational rationale for maxDepth/maxNodes ('大型组织请设置...控制规模') and ties them to the truncated output flag, which is modest but real added meaning beyond the schema.

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 uses a specific verb and resource ('从指定部门(默认根部门)递归获取完整部门树'), establishing scope and default entry point clearly. It does not name or contrast with close siblings such as list_sub_departments or get_department_chain, so the agent must infer differentiation from the name alone.

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?

It gives practical guidance for the parameters (set maxDepth/maxNodes for large orgs, includeUsers is optional) and notes that pagination is handled automatically, which helps the agent decide it does not need to paginate. However, there is no explicit guidance on when to choose this full-recursive tool versus the single-level siblings, so usage is implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.