Skip to main content
Glama
input-parser.ts1.03 kB
// Parses and validates input arguments for spending-by-category tool export interface SpendingByCategoryInput { startDate: string; endDate: string; accountId?: string; includeIncome: boolean; } export class SpendingByCategoryInputParser { parse(args: unknown): SpendingByCategoryInput { if (!args || typeof args !== 'object') { throw new Error('Arguments must be an object'); } const argsObj = args as Record<string, unknown>; const { startDate, endDate, accountId, includeIncome } = argsObj; if (!startDate || typeof startDate !== 'string') { throw new Error('startDate is required and must be a string (YYYY-MM-DD)'); } if (!endDate || typeof endDate !== 'string') { throw new Error('endDate is required and must be a string (YYYY-MM-DD)'); } return { startDate, endDate, accountId: accountId && typeof accountId === 'string' ? accountId : undefined, includeIncome: typeof includeIncome === 'boolean' ? includeIncome : false, }; } }

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/s-stefanov/actual-mcp'

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