mcpengine/servers/clover/src/tools/apps-tools.ts
Jake Shore a78d044005 housecall-pro: Complete MCP server with 112 tools and 15 React apps
- 112 MCP tools across 17 domains (jobs, customers, estimates, invoices, payments, employees, scheduling, dispatch, tags, notifications, reviews, reporting, price book, leads, webhooks, time tracking, settings)
- 15 React apps with proper Vite build setup and dark theme
- Full API client with Bearer auth, pagination, error handling, rate limiting
- Complete TypeScript types for all entities
- TSC passes clean
- GHL-quality standard achieved
2026-02-12 17:48:10 -05:00

83 lines
2.4 KiB
TypeScript

import { CloverClient } from '../clients/clover.js';
export function createAppsTools(client: CloverClient) {
return {
clover_list_apps: {
description: 'List all apps installed on the merchant account',
inputSchema: {
type: 'object',
properties: {
limit: {
type: 'number',
description: 'Maximum number of apps to return',
},
},
},
handler: async (args: any) => {
const apps = await client.fetchPaginated<any>('/apps', {}, args.limit);
return { apps, count: apps.length };
},
},
clover_get_app: {
description: 'Get information about a specific installed app',
inputSchema: {
type: 'object',
properties: {
appId: { type: 'string', description: 'App ID or UUID' },
},
required: ['appId'],
},
handler: async (args: any) => {
return await client.get<any>(`/apps/${args.appId}`);
},
},
clover_get_app_metered_events: {
description: 'Get metered events for an app (billing/usage data)',
inputSchema: {
type: 'object',
properties: {
appId: { type: 'string', description: 'App ID' },
startTime: {
type: 'number',
description: 'Start time for events (Unix timestamp)',
},
endTime: {
type: 'number',
description: 'End time for events (Unix timestamp)',
},
},
required: ['appId'],
},
handler: async (args: any) => {
const params: any = {};
if (args.startTime) params.startTime = args.startTime;
if (args.endTime) params.endTime = args.endTime;
return await client.get<any>(`/apps/${args.appId}/metered_events`, params);
},
},
clover_list_app_notifications: {
description: 'List notifications sent by an app',
inputSchema: {
type: 'object',
properties: {
appId: { type: 'string', description: 'App ID' },
limit: { type: 'number', description: 'Maximum number to return' },
},
required: ['appId'],
},
handler: async (args: any) => {
const notifications = await client.fetchPaginated<any>(
`/apps/${args.appId}/notifications`,
{},
args.limit
);
return { notifications, count: notifications.length };
},
},
};
}