Skip to main content
Glama
dennypradipta

Date Operations MCP

index.ts1.58 kB
#!/usr/bin/env node import { FastMCP } from "fastmcp"; import { formatTool, nowTool, addTool, subtractTool, differenceTool, compareTool, } from "./tools.js"; import { addParams, compareParams, differenceParams, formatParams, subtractParams, } from "./params.js"; const server = new FastMCP({ name: "Date Operations", version: "1.0.0", }); server.addTool({ name: "now", description: "Get the current date and time.", execute: nowTool, }); server.addTool({ name: "format", description: "Get the current date.", parameters: formatParams, execute: formatTool, }); server.addTool({ name: "add", description: "Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.", parameters: addParams, execute: addTool, }); server.addTool({ name: "subtract", description: "Subtract the specified years, months, weeks, days, hours, minutes, and seconds to the given date.", parameters: subtractParams, execute: subtractTool, }); server.addTool({ name: "difference", description: "Get the difference between two dates in years, months, weeks, days, hours, minutes, and seconds.", parameters: differenceParams, execute: differenceTool, }); server.addTool({ name: "compare", description: "Compare whether the first date is after, before, or equal to the second date.", parameters: compareParams, execute: compareTool, }); server.start({ transportType: (process.env.TRANSPORT_TYPE as "httpStream" | "stdio") || "httpStream", httpStream: { port: 3000, }, });

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