Skip to main content
Glama
AliMail Admin MCP

AliMail Admin MCP

by mfc-open

获取部门层级链

get_department_chain
Read-onlyIdempotent

Retrieves the full department hierarchy chain from root to a target department for one ID or up to 100 IDs in batch, enabling parent-path and organizational structure mapping.

Instructions

获取从根部门到目标部门的完整层级链。传 id 查询单个,传 ids 批量查询(最多 100 个)。

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_chain"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNo单个部门 ID
idsNo批量部门 ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already cover the safety profile (readOnlyHint, idempotentHint, destructiveHint=false), so the description only needs to add context. It does add the useful semantics of the root-to-target chain ordering, but the 100-item cap merely restates maxItems from the schema, and it says nothing about behavior for unknown IDs or missing departments.

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?

Two short sentences, zero filler, with the core behavior front-loaded before the parameter routing. Every sentence earns its place.

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?

For a simple two-parameter read with no output schema, the description conveys the key result shape (an ordered chain from root to target). It would be stronger if it stated whether the target department is included or how an invalid ID is handled, but no critical detail is missing.

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 description coverage is 100%, so both parameters are already documented in the schema. The description reinforces id=single versus ids=batch and repeats the 100 cap, but adds no format, precedence, or error semantics beyond what is structured. Baseline 3 applies.

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 states a specific verb and resource: retrieve the complete hierarchy chain from the root department down to the target department. That is concrete enough for an agent to know what comes back. It does not name or distinguish itself from related tools such as get_department_tree, so it stops short of a 5.

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 explains the two invocation modes clearly: pass id for a single department, pass ids to batch-query up to 100. However, it gives no guidance on when to prefer this tool over get_department/get_department_tree, nor what happens if both parameters are supplied. Usage is implied rather than scoped.

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