MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / resolveDateRange

Function resolveDateRange

packages/mcp/src/tools/shared.ts:63–72  ·  view source on GitHub ↗
(
  startDate?: string,
  endDate?: string
)

Source from the content-addressed store, hash-verified

61 * Resolve a date range, defaulting to the last 30 days if not provided.
62 */
63export function resolveDateRange(
64 startDate?: string,
65 endDate?: string
66): { startDate: string; endDate: string } {
67 const end = endDate ?? new Date().toISOString().slice(0, 10);
68 const start =
69 startDate ??
70 new Date(Date.now() - 30 * 86_400_000).toISOString().slice(0, 10);
71 return { startDate: start, endDate: end };
72}
73
74/**
75 * Serialize a tool result to MCP content format.

Callers 12

shared.test.tsFile · 0.90
registerGscOverviewToolsFunction · 0.90
registerGscPageToolsFunction · 0.90
registerGscQueryToolsFunction · 0.90
registerUserFlowToolsFunction · 0.90
registerOverviewToolsFunction · 0.90
registerPageToolsFunction · 0.90
registerFunnelToolsFunction · 0.90
registerTrafficToolsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected