heyibad/quickbook-mcp

Add input validation to customer handler

Aperta

#1 aperta il 26 ott 2025

 (1 commento) (0 reazioni) (0 assegnatari)TypeScript (0 fork)auto 404
enhancementgood first issuehacktoberfest

Metriche repository

Star
 (1 stella)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Description

The customer handler (create-quickbooks-customer.handler.ts) currently accepts any customer data without validating required fields. This can lead to API errors and poor user experience.

Proposed Solution

Add Zod schema validation for customer data before making API calls to QuickBooks.

Requirements

  • Create a Zod schema for customer data validation
  • Add validation before API call in createQuickbooksCustomer function
  • Return clear validation errors to the user
  • Update tests to cover validation scenarios

Example Implementation

\\ ypescript import { z } from 'zod';

const CustomerSchema = z.object({ DisplayName: z.string().min(1, 'Display name is required'), // Add other required fields }); \`n

Benefits

  • Better error messages for users
  • Catch errors before API calls
  • Improve code reliability

Guida contributor