GnistAI GnistAI
Log in

Getting Started with Working Days Calculator

Business day calculator — count working days, add/subtract business days, check weekday status.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Utilities

Data source: Algorithmic

Overview

Working Days Calculator performs computations on your inputs — no external data source required. This tutorial covers all 5 tools with parameter reference and code examples.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-working-days": {
      "url": "https://context.gnist.ai/mcp/working-days/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (5)

count_working_days

Count business days between two dates (Monday–Friday only). The range is [start, end) — start is inclusive, end is exclusive. Returns a negative count if end is before start. Args: start: Start date in ISO 8601 format (YYYY-MM-DD). end: End date in ISO 8601 format (YYYY-MM-DD), exclusive. Returns: Dictionary with count of working days and calendar days in the range.

ParameterTypeRequiredDescription
startstringrequired
endstringrequired
curl -X POST "https://context.gnist.ai/mcp/working-days/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "count_working_days", "arguments": {"start": "example", "end": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/working-days/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'end': 'example', 'start': 'example'},
            'name': 'count_working_days'}},
)
print(resp.json())

add_working_days

Add N business days to a date and return the resulting date. Skips weekends (Saturday and Sunday). Supports negative values to subtract days. Args: date: Starting date in ISO 8601 format (YYYY-MM-DD). days: Number of business days to add (negative to subtract). Returns: Dictionary with the starting date, days added, and resulting date.

ParameterTypeRequiredDescription
datestringrequired
daysintegerrequired
curl -X POST "https://context.gnist.ai/mcp/working-days/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "add_working_days", "arguments": {"date": "2025-01-15", "days": 5}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/working-days/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'date': '2025-01-15', 'days': 5},
            'name': 'add_working_days'}},
)
print(resp.json())

is_working_day

Check whether a given date is a business day (Monday–Friday). Args: date: Date to check in ISO 8601 format (YYYY-MM-DD). Returns: Dictionary with is_working_day boolean and day_of_week name.

ParameterTypeRequiredDescription
datestringrequired
curl -X POST "https://context.gnist.ai/mcp/working-days/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "is_working_day", "arguments": {"date": "2025-01-15"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/working-days/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'date': '2025-01-15'}, 'name': 'is_working_day'}},
)
print(resp.json())

get_working_days_in_month

List all working days (Monday–Friday) in a given year and month. Args: year: The year (e.g. 2026). month: The month (1–12). Returns: Dictionary with count of working days and list of dates.

ParameterTypeRequiredDescription
yearintegerrequired
monthintegerrequired
curl -X POST "https://context.gnist.ai/mcp/working-days/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_working_days_in_month", "arguments": {"year": 2025, "month": 5}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/working-days/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'month': 5, 'year': 2025},
            'name': 'get_working_days_in_month'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/working-days/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/working-days/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

FAQ

What data does Working Days Calculator provide?

Business day calculator — count working days, add/subtract business days, check weekday status. It exposes 5 tools: count_working_days, add_working_days, is_working_day, get_working_days_in_month, report_feedback.

Does this toolkit require external data?

No. It performs computations on your inputs directly. You only need a Gnist API key.

What format does the Working Days Calculator API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials