Skip to main content
Glama
daomengKJ
by daomengKJ

init_leave_flow

Initializes a leave application flow by verifying user identity, checking for unresolved leaves, retrieving leave types, and viewing remaining balance. Alerts if pending leave exists.

Instructions

初始化请假流程。

依次执行:获取用户信息(接口1)→ 检查未销假(接口4)→ 获取请假类型(接口2)→ 查询剩余假期(接口3)。 如果存在未销假记录,返回 has_pending_leave=true,LLM 应提示用户先销假。

两种调用方式:

  1. 提供 user_token:直接使用 Token 调用接口。

  2. 提供 user_code:自动通过 /auth/sso/getZhhhToken/{userCode} 获取 Token。 如果 Token 为空,返回提示"用户未登录,请先登录"。

Args: user_token: 用户认证 Token(可选,优先使用)。 user_code: 用户编码(可选,user_token 为空时通过此编码自动获取 Token)。

Returns: InitFlowResult: 包含用户信息、岗位列表、请假类型、剩余假期、Token。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_codeNo
user_tokenNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYes执行结果描述
successYes是否执行成功
user_codeNo用户编码
user_nameNo用户名称
user_orgsNo用户岗位列表
user_tokenNo用户认证 Token,供后续工具使用
leave_typesNo可选请假类型列表
avlb_ot_leaveNo调休假剩余天数0
avlb_annl_leaveNo年假剩余天数0
has_pending_leaveNo是否存在未销假记录(true 表示需先销假)
Behavior4/5

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

No annotations exist, but the description discloses key behaviors: the sequential API calls, automatic token retrieval, and the has_pending_leave flag. It does not mention any side effects, but the tool is read-heavy and non-destructive.

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 well-structured with paragraphs and bullets, providing thorough information without redundancy. Every sentence adds value.

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?

Given an output schema exists, the description does not need to detail return values but still summarizes them (user info, positions, leave types, etc.). It covers edge cases like token fetching and pending leave.

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 coverage is 0%, but the description fully explains both parameters: user_token as optional but preferred, and user_code as fallback with automatic token fetch. It adds meaning beyond the schema.

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 description clearly states the tool initializes a leave flow and distinguishes it from siblings like submit_leave_application. It mentions the specific sequence of backend steps, making its unique purpose clear.

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?

The description provides explicit guidelines for two calling modes (user_token vs user_code) and mentions a special case for pending leave. However, it does not explicitly state when not to use this tool compared to siblings.

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/daomengKJ/leave_mcp'

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