Skip to main content
Glama

LeaveManager – MCP Server with Claude Integration

LeaveManager is a custom Model Context Protocol (MCP) server built using FastMCP.
It allows Claude to interact with a backend Leave Management System using natural language.

This project demonstrates how Claude can automatically select and execute backend tools based on user queries.


πŸš€ Features

  • Check employee leave balance

  • Apply leave for specific dates

  • View leave history

  • In-memory state management

  • Claude Desktop integration via MCP

  • Automatic tool selection from natural language


Related MCP server: Attendance Management MCP Server

🧠 Tech Stack

  • Python 3.10+

  • FastMCP

  • MCP CLI

  • Claude Desktop (for tool invocation)

  • uv (Python package manager)


πŸ“‚ Project Structure

my-first-mcp-server/ β”‚ β”œβ”€β”€ main.py β”œβ”€β”€ pyproject.toml β”œβ”€β”€ README.md β”œβ”€β”€ .gitignore β”œβ”€β”€ uv.lock └── .venv/


πŸ› οΈ MCP Tools

1️⃣ get_leave_balance

Checks remaining leave days for an employee.

Input:

  • employee_id (string)


2️⃣ apply_leave

Applies leave for given dates and updates balance.

Input:

  • employee_id (string)

  • leave_dates (list of YYYY-MM-DD)


3️⃣ get_leave_history

Returns all leave dates taken by an employee.

Input:

  • employee_id (string)


πŸ’‘ Example Claude Queries

  • β€œCheck leave balance for employee E001”

  • β€œApply leave for employee E001 on 2025-04-17 and 2025-05-01”

  • β€œShow leave history for employee E001”

Claude automatically selects and executes the correct MCP tool.


⚠️ Important Note on Data Storage

  • This project uses in-memory storage

  • Data resets when the MCP server restarts

  • This is intentional for simplicity

  • Can be extended with SQLite for persistence


▢️ Running Locally (Without Claude)

uv run main.py


🎯 Learning Outcomes

Built a real MCP server

Exposed backend tools to Claude

Understood stateful MCP behavior

Integrated Python backend with LLM tool calling

πŸ“Œ Future Improvements

SQLite persistence

Date validation & duplicate checks

Employee creation & reset tools

FastAPI + MCP hybrid architecture

πŸ§‘β€πŸ’» Author

Uma Maheswara Rao
Aspiring AI Engineer / Data Analyst

Available Tools

3 tools
apply_leaveC
Apply leave for specific dates (e.g., ["2025-04-17", "2025-05-01"])
ParametersJSON Schema
NameRequiredDescriptionDefault
employee_idYes
leave_datesYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.7/5.0
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Apply leave' implies a write/mutation operation, the description doesn't specify whether this requires approval, what permissions are needed, whether it's reversible, or what happens with conflicting dates. The example format is helpful but doesn't address critical behavioral aspects of a leave application system.

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 extremely concise - just one sentence with a helpful example. There's no wasted text, and the information is front-loaded. However, the brevity comes at the cost of completeness, making it more under-specified than optimally concise.

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?

Given this is a mutation tool with no annotations, 2 parameters (0% schema coverage), but with an output schema present, the description is minimally adequate. The example format helps, but critical context is missing: no error conditions, no relationship to sibling tools, no behavioral constraints. The output schema existence means return values are documented elsewhere, but the description should still address more operational context.

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?

The description provides an example format for 'leave_dates' parameter (array of date strings), which adds meaningful context beyond the schema's 0% description coverage. However, it doesn't explain the 'employee_id' parameter at all, nor does it clarify date format requirements, validation rules, or what constitutes valid leave dates. The schema coverage is 0%, so the description partially compensates but not fully.

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?

The description states the tool's purpose ('Apply leave for specific dates') which is a clear verb+resource combination. However, it doesn't distinguish this from potential sibling tools like 'get_leave_balance' or 'get_leave_history' - it only describes what it does without contextual differentiation. The example dates help illustrate the format but don't enhance the core purpose statement.

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 provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites, constraints, or relationships with sibling tools like 'get_leave_balance' (which might be needed before applying leave) or 'get_leave_history' (which might show past applications). The agent receives no help in determining appropriate usage contexts.

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

get_leave_balanceC

Check how many leave days are left for the employee

ParametersJSON Schema
NameRequiredDescriptionDefault
employee_idYes

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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It does mention the action is to 'Check', implying a read-only operation, but it does not explicitly state whether authentication is required, what happens if the employee_id is invalid, or the format of the returned data. It also does not confirm there are no side effects, which is critical without annotations.

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 a single, concise sentence with no redundant words. It is front-loaded with the action and resource, making it easy to parse. This is appropriately sized for the tool's simplicity.

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?

The tool is simple with only one parameter and an output schema, so the description covers the core function. However, it misses usage context and does not explicitly frame it as a read-only operation. The absence of annotations and lack of comparison to siblings leaves gaps, but given the tool's simplicity, it is minimally viable.

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 description coverage is 0% and the description does not mention the employee_id parameter at all. The parameter name and type are self-explanatory, but the description adds no meaning about the expected format, whether it is an internal identifier, or any constraints. Given the low coverage, the description should compensate but fails to do so.

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 clearly states the tool's function: checking remaining leave days for an employee. It uses a specific verb ('Check') and resource ('leave days'), which distinguishes it from generic operations. However, it does not explicitly compare against sibling tools like get_leave_history or apply_leave, so the differentiation is implied rather than stated.

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 versus alternatives. The description simply states what it does, but does not mention that it should be used for current balance checks, nor provide exclusions (e.g., for historical data use get_leave_history). This leaves the agent without clear decision-making context.

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

get_leave_historyC

Get leave history for the employee

ParametersJSON Schema
NameRequiredDescriptionDefault
employee_idYes

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 must carry the burden. It only states the purpose without disclosing behavioral traits such as read-only nature, response format, filtering, or pagination. Minimal disclosure of the operation.

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 a single sentence with no redundant words, making it concise and front-loaded. However, it is somewhat under-specified, but for conciseness it earns high marks.

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?

Given the existence of an output schema and one required parameter, the description is very incomplete. It does not explain expected return values, usage context, or any limitations. For a tool with no annotations, this is a significant gap.

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%. The description adds no information about the employee_id parameter beyond what the schema shows. It would need to explain how to specify the employee, but it does not.

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 'Get' and resource 'leave history', clearly indicating the tool's function. It distinguishes from siblings like get_leave_balance (balance vs history), though it lacks detail on scope.

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 guidance on when to use this tool versus alternatives. Does not mention conditions, prerequisites, or exclusion criteria.

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. 3 tool updatesv0.1.0
    • First observedapply_leave
    • First observedget_leave_balance
    • First observedget_leave_history

TDQS

B3/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: apply_leave is for submitting new leave requests, get_leave_balance shows remaining leave days, and get_leave_history retrieves past leave records. There is no overlap in functionality, making tool selection straightforward for an agent.

Naming Consistency5/5

All tools follow a consistent verb_noun naming pattern (apply_leave, get_leave_balance, get_leave_history) with clear, descriptive names. The pattern is uniform throughout, enhancing readability and predictability.

Tool Count3/5

With only 3 tools, the server feels thin for a leave management domain, as it lacks operations like updating or canceling leave requests, viewing team leave calendars, or approving/rejecting leave. While the tools cover basic needs, the scope is borderline minimal.

Completeness2/5

The tool set has significant gaps for a leave management system. It includes apply, balance, and history but misses critical operations such as update_leave, delete_leave, list_pending_requests, or approve_leave. This incomplete coverage will likely cause agent failures in real-world workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    D
    quality
    D
    maintenance
    A Model Context Protocol server that enables Claude Desktop to access structured employee data and perform HR operations including employee lookups, searches, and global leave requests.
    3
    1
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    A Model Context Protocol server that enables Claude to interact with a Lucca instance to list employees, departments, and view absences in natural language.
    3
    MIT