Skip to content
Dates and time

Work Days Calculator MCP tool in LangChain

Connect MultitaskAI to LangChain for Python as an MCP adapter, then ask in plain words. LangChain calls Work Days Calculator with the right arguments and answers with the exact result.

Set up MultitaskAI MCP in LangChain

Add MultitaskAI to LangChain for Python as an MCP adapter. It takes a minute and every tool comes with it.

  1. Create an API key in your MultitaskAI account.

  2. Install the MCP extra with pip install "langchain[mcp]".

  3. Load the MultitaskAI tools with MCPAdapter as below, with your key in place of YOUR_API_KEY.

  4. Pass the tools to create_agent and check that the agent calls them.

agent.py
from fastmcp.client import Client
from langchain.agents import create_agent
from langchain.mcp import MCPAdapter


async def main():
    async with MCPAdapter(Client("https://mcp.multitaskai.com", auth="YOUR_API_KEY")) as adapter:
        tools = await adapter.list_tools()
        agent = create_agent("claude-sonnet-5", tools)
        return await agent.ainvoke(
            {"messages": [{"role": "user", "content": "List my MultitaskAI tools."}]}
        )

API key

LangChain sends your MultitaskAI API key in the Authorization header. Create a key in your account and use it in place of YOUR_API_KEY.

Read the LangChain guide

The full LangChain guide covers every step, the endpoint, signing in and how to check the connection.

Ask in plain words

Once MultitaskAI is connected, a request like this one is enough. LangChain picks Work Days Calculator, fills in the details and answers with the exact result.

  • No tool names or settings to learn
  • The same exact answer every time
  • Works in every client that speaks MCP
You

Calculate work days: start date "2024-01-15", end date "2024-01-19" and exclude weekends true.

Used Work Days Calculator
Start Date
Monday, January 15, 2024
End Date
Friday, January 19, 2024
Total Days
5
Work Days (Mon-Fri)
5
Weekend Days (Sat-Sun)
0
Full Weeks
0
Show the raw MCP call
tools/call request
{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
        "name": "work-days-calculator",
        "arguments": {
            "startDate": "2024-01-15",
            "endDate": "2024-01-19",
            "excludeWeekends": true
        }
    }
}
Result
Start Date: Monday, January 15, 2024

End Date: Friday, January 19, 2024

Total Days: 5

Work Days (Mon-Fri): 5

Weekend Days (Sat-Sun): 0

Full Weeks: 0

Remaining Days: 5

Work Hours (8hr/day): 40

More dates and time MCP tools in LangChain

Free to start, unlimited with Pro

Every signed-in account gets 100 requests a day. MultitaskAI Pro removes the daily limit for €9 a month.

Free

For trying MultitaskAI and for light daily use.

€0forever

  • 100 requests a day
  • All 433 tools
  • OAuth connectors and API keys
  • Every request tied to your account

MultitaskAI Pro

Unlimited

For agents that work all day.

€9per month

  • Unlimited requests
  • All 433 tools
  • OAuth connectors and API keys
  • Billed monthly, cancel any time

Give your agent 433 tools in a minute

Sign in, add the endpoint to your client and ask. 100 requests a day are free.