Skip to main content
Glama
daomengKJ
by daomengKJ

calculate_leave_days

Calculate actual leave days and verify leave balance for annual or compensatory leave.

Instructions

计算实际休假天数并校验假期余额。

调用接口 5 计算实际休假天数,然后根据请假类型校验余额:

  • 年休假:校验年假余额是否充足

  • 调休假:校验调休假余额是否充足

  • 其他类型:不校验余额

Args: user_token: 用户认证 Token。 leave_type_code: 请假类型编码(来自 init_leave_flow 的 leave_types)。 start_date: 开始日期,格式 yyyy-MM-dd。 end_date: 结束日期,格式 yyyy-MM-dd。 user_code: 用户编码。 leave_type: 请假类型名称(如 "年休假"、"调休假"),用于余额校验。 avlb_annl_leave: 年假剩余天数(来自 init_leave_flow)。 avlb_ot_leave: 调休假剩余天数(来自 init_leave_flow)。 start_time_code: 开始时间编码,AM 或 PM,默认 AM。 end_time_code: 结束时间编码,AM 或 PM,默认 AM。

Returns: CalcDaysResult: 包含休假天数和余额校验结果。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_dateYes
user_codeYes
leave_typeYes
start_dateYes
user_tokenYes
avlb_ot_leaveYes
end_time_codeNoPM
avlb_annl_leaveYes
leave_type_codeYes
start_time_codeNoAM

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYes执行结果描述
successYes是否执行成功
leave_daysNo实际休假天数0
balance_sufficientNo假期余额是否充足(年假/调休假时校验)
Behavior3/5

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

No annotations are provided, so the description carries full burden. It describes calling an internal API, performing balance checks per leave type, and returning a result. However, it does not disclose potential destructive effects, side effects, or error handling (e.g., insufficient balance).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with Args and Returns sections, front-loading the purpose. It is clear and informative, though slightly verbose with internal API references. Every sentence adds value.

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?

Given the high parameter count and lack of schema descriptions, the description covers each parameter adequately. It mentions the return type CalcDaysResult and its contents. Missing details like error conditions or constraints (e.g., date format) but still sufficient for an agent.

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%, but the description provides detailed explanations for all 10 parameters, including their purpose (e.g., leave_type for balance check, avlb_annl_leave from init_leave_flow) and defaults (start_time_code default AM). This adds significant value 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 calculates actual leave days and validates leave balance, using specific verbs ('计算', '校验') and resources ('休假天数', '假期余额'). It distinguishes from siblings like init_leave_flow and submit_leave_application by focusing on the calculation step.

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 context on when to use (after init_leave_flow, which provides balances) and for which leave types balance checks are performed. It does not explicitly state when not to use or direct to alternatives, but the flow is implied.

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