Skip to main content
Glama
dennypradipta

Date Operations MCP

params.ts2.11 kB
import { z } from "zod"; const durationSchema = z .object({ years: z.number().optional(), months: z.number().optional(), weeks: z.number().optional(), days: z.number().optional(), hours: z.number().optional(), minutes: z.number().optional(), seconds: z.number().optional(), }) .optional(); export const formatParams = z.object({ datetime: z .string({ description: "The ISO 8601 Date string to format.", }) .describe("The ISO 8601 Date string to format."), format: z.string({ description: "The Unicode Technical Standard #35 format to use for the date.", }), }); export const addParams = z.object({ datetime: z.string({ description: "The ISO 8601 Date string to add the duration to.", }), duration: durationSchema, }); export const subtractParams = z.object({ datetime: z.string({ description: "The ISO 8601 Date string to subtract the duration from.", }), duration: durationSchema, }); export const differenceParams = z.object({ datetimeFrom: z.string({ description: "The ISO 8601 Date string to subtract the duration from.", }), datetimeTo: z.string({ description: "The ISO 8601 Date string to subtract the duration to.", }), unit: z .enum(["seconds", "minutes", "hours", "days", "weeks", "months", "years"]) .describe("The unit of the difference."), }); export const compareParams = z.object({ firstDatetime: z .string({ description: "The first ISO 8601 Date Time to check." }) .describe("The first ISO 8601 Date Time to check."), secondDatetime: z .string({ description: "The second ISO 8601 Date Time to check." }) .describe("The second ISO 8601 Date Time to check."), operator: z .enum(["after", "before", "equal"]) .describe("The operator to use."), }); export type TFormatParams = z.infer<typeof formatParams>; export type TAddParams = z.infer<typeof addParams>; export type TSubtractParams = z.infer<typeof subtractParams>; export type TDifferenceParams = z.infer<typeof differenceParams>; export type TCompareParams = z.infer<typeof compareParams>;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dennypradipta/date-operations-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server