@@ -30,6 +30,29 @@ const GetCustomerDataInputSchema = z.object({
3030 . describe ( "Filter by segment (default: All)" ) ,
3131} ) ;
3232
33+ const CustomerSchema = z . object ( {
34+ id : z . string ( ) ,
35+ name : z . string ( ) ,
36+ segment : z . string ( ) ,
37+ annualRevenue : z . number ( ) ,
38+ employeeCount : z . number ( ) ,
39+ accountAge : z . number ( ) ,
40+ engagementScore : z . number ( ) ,
41+ supportTickets : z . number ( ) ,
42+ nps : z . number ( ) ,
43+ } ) ;
44+
45+ const SegmentSummarySchema = z . object ( {
46+ name : z . string ( ) ,
47+ count : z . number ( ) ,
48+ color : z . string ( ) ,
49+ } ) ;
50+
51+ const GetCustomerDataOutputSchema = z . object ( {
52+ customers : z . array ( CustomerSchema ) ,
53+ segments : z . array ( SegmentSummarySchema ) ,
54+ } ) ;
55+
3356// Cache generated data for session consistency
3457let cachedCustomers : Customer [ ] | null = null ;
3558let cachedSegments : SegmentSummary [ ] | null = null ;
@@ -78,6 +101,7 @@ export function createServer(): McpServer {
78101 description :
79102 "Returns customer data with segment information for visualization. Optionally filter by segment." ,
80103 inputSchema : GetCustomerDataInputSchema . shape ,
104+ outputSchema : GetCustomerDataOutputSchema . shape ,
81105 _meta : { [ RESOURCE_URI_META_KEY ] : resourceUri } ,
82106 } ,
83107 async ( { segment } ) : Promise < CallToolResult > => {
0 commit comments