Skip to main content
Glama
AniketDonode

Leave Manager

by AniketDonode

Leave Manager MCP Server

This project is a Python MCP server for managing employees, leave balances, and leave requests with SQLite.

1. Create the project

Open PowerShell and create a project directory:

mkdir D:\Coding\mcpserver\LeaveManager
cd D:\Coding\mcpserver\LeaveManager

Create a uv Python project inside leave_manager_server:

uv init leave_manager_server
cd leave_manager_server
uv add "mcp[cli]>=2.1.1"

The project requires Python 3.14 or newer. uv creates pyproject.toml, uv.lock, and the virtual environment used to run the server.

Related MCP server: leave_manager

2. Implement the server

Create server.py and add the following parts:

  1. Import MCPServer from mcp.server.mcpserver.

  2. Create the server with MCPServer("Leave Manager").

  3. Define Employee and LeaveRequest data models.

  4. Create a SQLite database next to server.py using an absolute path.

  5. Initialize employees and leave_requests tables and insert sample data on startup.

  6. Add resources for employee directories and leave requests.

  7. Add tools to submit and approve leave, check balances, list pending approvals, get database statistics, and add employees.

  8. Start the server from the __main__ block:

if __name__ == "__main__":
		init_database()
		mcp.run()

The project uses MCP 2.x. The old MCP 1.x import does not work with this dependency:

from mcp.server.fastmcp import FastMCP

The working MCP 2.x form is:

from mcp.server.mcpserver import MCPServer

mcp = MCPServer("Leave Manager")

3. Run the server directly

From the project directory:

cd D:\Coding\mcpserver\LeaveManager\leave_manager_server
uv run server.py

The server uses standard input/output for MCP communication, so it stays running while an MCP client is connected. Press Ctrl+C to stop it.

Validate that the module imports correctly without starting the long-running server:

uv run python -c "import server; print('Server import valid')"

4. Test with MCP Inspector

The supported development command is:

cd D:\Coding\mcpserver\LeaveManager\leave_manager_server
uv run mcp dev server.py

The MCP Inspector uses Node.js. Install Node.js 22.19.0 or newer before using the latest Inspector. Check versions with:

node --version
npm --version

Do not run npm i in this Python project directory because it has no package.json. If Inspector reports a missing native binding, clear the temporary npx cache and retry:

Remove-Item "$env:LOCALAPPDATA\npm-cache\_npx" -Recurse -Force
uv run mcp dev server.py

5. Connect Claude Desktop

Claude Desktop reads its configuration from:

%APPDATA%\Claude\claude_desktop_config.json

Add this server entry. Replace the path if the project is stored elsewhere:

{
	"mcpServers": {
		"leave-manager": {
			"command": "uv",
			"args": [
				"run",
				"--directory",
				"D:\\Coding\\mcpserver\\LeaveManager\\leave_manager_server",
				"server.py"
			]
		}
	}
}

Restart Claude Desktop after saving the configuration. The server creates leave_manager.db beside server.py on its first startup.

Available MCP features

Resources:

  • employees://all

  • employee://{employee_id}

  • leave-requests://all

  • leave-requests://employee/{employee_id}

  • leave-requests://status/{status}

Tools:

  • submit_leave_request

  • approve_leave_request

  • check_leave_balance

  • get_pending_approvals

  • get_database_stats

  • add_employee

  • This will add my Config file automatic uv run mcp install server.py --name "leave_manager"

Available Tools

6 tools
add_employeeC

Add a new employee to the system with duplicate checking

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes
managerYes
departmentYes
force_createNo
sick_leave_balanceNo
annual_leave_balanceNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.6/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full disclosure burden. It reveals one behavioral trait ('duplicate checking'), but does not state what happens when a duplicate is found, whether force_create bypasses that check, what permissions are needed, or whether the operation is reversible. For a mutation tool with zero annotation coverage this is thin.

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?

A single front-loaded sentence with no filler. It is efficient, though its brevity borders on under-specification for a six-parameter mutation tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be described. But with six undocumented parameters, no annotations, and a state-changing operation, the definition leaves major gaps an agent needs before calling it safely.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across six parameters, so the description is expected to compensate but does not. None of name, manager, department, force_create, sick_leave_balance, or annual_leave_balance are explained, and the vague 'duplicate checking' phrase never connects to force_create.

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?

States a specific verb ('Add') and resource ('employee'), which is enough to separate it from the leave-management siblings listed. However, it does not explicitly contrast itself with any sibling, so it lands just short of the top band.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance, no prerequisites, and no mention of alternatives. The agent learns what the tool does but not the context or conditions for invoking it.

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

approve_leave_requestD

Approve a leave request

ParametersJSON Schema
NameRequiredDescriptionDefault
request_idYes
approver_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

D1.8/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden, yet it discloses nothing about authorization requirements (who may approve), irreversibility of the state change, side effects such as notifications to the requester, or failure modes for already-decided requests. It only implies a mutation via the word 'Approve'.

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

Conciseness2/5

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

It is short, but that brevity reflects under-specification rather than conciseness: the single phrase duplicates the tool name and earns no additional place in the definition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a state-changing approval operation with an output schema but zero annotation coverage and zero parameter documentation, the definition omits everything an agent needs — required permissions, effect of approval, idempotency, and the meaning of both required inputs.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% for both parameters, so the description must compensate, but it says nothing about request_id (format, source, where to obtain it) or approver_name (whether it must match an authenticated identity). The two required parameters are entirely undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The text 'Approve a leave request' is a verbatim human-readable restatement of the tool name approve_leave_request, adding no scope, object detail, or distinguishing information. It does not distinguish this tool from siblings like submit_leave_request or get_pending_approvals beyond the obvious verb.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance, no prerequisites, and no reference to alternatives such as get_pending_approvals (which presumably surfaces the requests worth approving). The agent must infer the entire workflow context.

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

check_leave_balanceC

Check leave balance for an employee

ParametersJSON Schema
NameRequiredDescriptionDefault
employee_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are provided, so the description must disclose behavior. It only states the action; it does not mention read-only nature, permissions required, side effects, or whether it returns current or accrued balance. The output schema covers return values, but behavioral traits are absent.

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?

Single front-loaded sentence with no filler. It is arguably too terse given missing guidance, but from a pure conciseness standpoint it avoids waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-param read tool, the description covers the core purpose, and the output schema handles return values. Still missing parameter semantics and usage context, leaving an agent to infer format and when to call.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% for the single employee_id parameter. The phrase 'for an employee' merely restates the parameter name and adds no format, source, or validation detail (e.g., whether it is a UUID or email). It fails to compensate for the coverage gap.

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?

States a specific verb 'check' and resource 'leave balance' scoped to an employee, making the action clear. It does not explicitly differentiate from siblings like submit_leave_request or approve_leave_request, though the verb implies a read-only query.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No indication of when to use this tool versus alternatives, no prerequisites (e.g., employee must exist), and no mention of related tools. Usage is only implied by the verb.

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

get_database_statsC

Get database statistics

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It does not clarify whether this is read-only, what scope of statistics is returned, or any performance/caching considerations, though the verb "Get" weakly implies a read.

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?

A single front-loaded sentence with no filler. It is appropriately terse for a zero-parameter call, though the brevity comes at the cost of detail rather than being maximally informative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained. For a zero-param read tool this is minimally adequate, but the description omits what the statistics cover, which the agent cannot recover from a generic schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so the baseline is 4. The description correctly implies no input is required, and there are no parameter semantics to document.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a generic verb and resource ("Get database statistics"), which is understandable but essentially restates the tool name with no differentiation from siblings and no indication of which statistics or for what entity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool, what triggers it, or how it relates to the leave-management siblings. The agent must infer usage entirely.

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

get_pending_approvalsA

Get all pending leave requests that need approval

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. 'Get all' usefully discloses an unfiltered, complete read with no parameters, but it says nothing about required permissions (approver role), scope (own team vs. all), or freshness of results. Adequate but not rich.

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?

A single, front-loaded sentence with no filler. Every word contributes to defining the resource and its scope.

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, zero-parameter read tool with an output schema (which covers return values), the description supplies enough to select and invoke it. Only minor gaps around authorization context remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so per the baseline there is nothing for the description to disambiguate; the description correctly conveys that no input filtering is available.

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 ('Get') and resource ('all pending leave requests that need approval'), and the name/siblings make the scope distinct from approve_leave_request or submit_leave_request. It is clear but relies on the tool name rather than explicit contrast with alternatives.

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?

The phrase 'need approval' implies the usage context (an approver looking at their queue), but there is no explicit when-to-use statement, no mention of prerequisites, and no routing toward alternatives. Usage is only implied.

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

submit_leave_requestC

Submit a new leave request

ParametersJSON Schema
NameRequiredDescriptionDefault
reasonYes
end_dateYes
leave_typeYes
start_dateYes
employee_idYes
days_requestedYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.4/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure, but it only implies a mutation ('Submit') without stating permissions required, validation rules, whether approval is triggered, or what happens to existing data. It reveals that a write occurs but nothing about side effects or constraints.

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

Conciseness3/5

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

The single sentence is front-loaded and free of filler, but it is under-specified relative to the tool's complexity. Brevity here functions as omission rather than efficiency, since the sentence adds almost nothing beyond the tool name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be described, but the input side is severely under-documented: six required parameters with no schema descriptions and no annotation coverage. For a mutation tool that likely interacts with leave balances and approval workflows, the description should convey more context to prevent malformed calls.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and there are six required parameters, yet the description adds no meaning for any of them. It does not explain formats for dates, allowable values for leave_type, the relationship between start_date/end_date and days_requested, or the employee_id semantics.

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 ('Submit') and resource ('a new leave request'), making the tool's core action immediately clear. It does not explicitly differentiate itself from siblings like approve_leave_request or check_leave_balance, so an agent must rely on tool names to disambiguate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description offers no when-to-use guidance, no prerequisites, and no mention of alternatives such as checking leave balance first. It simply restates the action, leaving the agent to infer the appropriate context without help.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv0.1.0
    • First observedadd_employee
    • First observedapprove_leave_request
    • First observedcheck_leave_balance
    • First observedget_database_stats
    • First observedget_pending_approvals
    • First observedsubmit_leave_request

TDQS

B3/5.0

Scored across 6 tools

Disambiguation5/5

Each tool has a clearly distinct action and target resource; there is no overlap between submitting, approving, checking balance, listing pending approvals, adding employees, or retrieving stats.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern (submit_leave_request, approve_leave_request, etc.), making the set predictable and easy to parse.

Tool Count5/5

Six tools is well within the typical 3-15 range for a focused domain. Each tool earns its place, though get_database_stats is somewhat generic.

Completeness3/5

The leave lifecycle lacks key operations like reject_leave_request, cancel_leave_request, or get_leave_history. Approval without rejection is a notable gap, and employee management only supports addition.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers