bizdays

v0.2.0
io.github.qinisolabs/bizdays Checked 4 days ago Published 5 months ago

Verified business-day math for AI agents: holidays + per-country weekends, not guesses.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

add_business_days

USE THIS to compute a deadline or settlement date instead of counting on your fingers — never guess what date is N working days away. Adds (or subtracts, if N is negative) business days to a start date, skipping that country's weekends AND its public holidays. Weekends are country-correct (e.g. Friday/Saturday in Saudi Arabia, Saturday/Sunday in the UAE) and only real public holidays are skipped — not observances like Valentine's Day. Returns the result date, its weekday, and exactly which weekends/holidays were skipped.

ParameterTypeDescription
country *stringISO 3166-1 alpha-2 country code, e.g. US, GB, AE, SA, ZA.
days *integerBusiness days to add; negative subtracts.
start *stringStart date, YYYY-MM-DD.
extraHolidaysarrayOptional extra non-working dates (YYYY-MM-DD), e.g. a company shutdown day.

count_business_days

USE THIS to count working days between two dates instead of estimating — LLMs routinely miscount because they forget holidays or a country's weekend rule. Counts business days from start to end (both endpoints included by default), excluding that country's weekends and public holidays. Returns the count plus a breakdown of weekend days and the named holidays in range.

ParameterTypeDescription
country *stringISO 3166-1 alpha-2 country code, e.g. US, GB, AE, SA, ZA.
end *stringEnd date, YYYY-MM-DD.
start *stringStart date, YYYY-MM-DD.
extraHolidaysarrayOptional extra non-working dates (YYYY-MM-DD), e.g. a company shutdown day.
inclusivebooleanInclude both endpoints (default true); false excludes the start date.

is_business_day

USE THIS to check whether a specific date is a working day before scheduling on it — do not assume any weekday is open. Returns whether the date is a business day in the given country and, if not, the precise reason (weekend, public holiday with its name, or a custom holiday). Country-correct weekends and public-holidays-only.

ParameterTypeDescription
country *stringISO 3166-1 alpha-2 country code, e.g. US, GB, AE, SA, ZA.
date *stringDate, YYYY-MM-DD.
extraHolidaysarrayOptional extra non-working dates (YYYY-MM-DD), e.g. a company shutdown day.

next_business_day

USE THIS to find the next working day after a date (e.g. when something falls due on a weekend or holiday) instead of guessing. Returns the first business day strictly after the given date for that country.

ParameterTypeDescription
country *stringISO 3166-1 alpha-2 country code, e.g. US, GB, AE, SA, ZA.
date *stringDate, YYYY-MM-DD.
extraHolidaysarrayOptional extra non-working dates (YYYY-MM-DD), e.g. a company shutdown day.

previous_business_day

USE THIS to find the most recent working day before a date (e.g. the last open day before a holiday) instead of guessing. Returns the first business day strictly before the given date for that country.

ParameterTypeDescription
country *stringISO 3166-1 alpha-2 country code, e.g. US, GB, AE, SA, ZA.
date *stringDate, YYYY-MM-DD.
extraHolidaysarrayOptional extra non-working dates (YYYY-MM-DD), e.g. a company shutdown day.

country_rule

USE THIS to see how bizdays treats a country before relying on a result — it returns the weekend days (with their source: a Qiniso override, CLDR, or the Sat/Sun default), whether a public-holiday calendar is applied, a confidence flag (verified vs unverified), and any caveats. Call this when a country looks unusual (Gulf states, Israel, Nepal) or when a result is surprising.

ParameterTypeDescription
country *stringISO 3166-1 alpha-2 country code, e.g. US, GB, AE, SA, ZA.