FieldEdge: Complete MCP server rebuild with 45+ tools, 16 apps, full API client
This commit is contained in:
parent
96e52666c5
commit
de579bce6a
@ -1,41 +1,22 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* FieldEdge MCP Server Main Entry Point
|
||||
* FieldEdge MCP Server - Main Entry Point
|
||||
*/
|
||||
|
||||
import { config } from 'dotenv';
|
||||
import { FieldEdgeServer } from './server.js';
|
||||
|
||||
// Load environment variables
|
||||
config();
|
||||
async function main() {
|
||||
const apiKey = process.env.FIELDEDGE_API_KEY;
|
||||
const baseUrl = process.env.FIELDEDGE_BASE_URL;
|
||||
|
||||
function getEnvVar(name: string, required = true): string {
|
||||
const value = process.env[name];
|
||||
if (required && !value) {
|
||||
console.error(`Error: ${name} environment variable is required`);
|
||||
console.error('\nPlease set the following environment variables:');
|
||||
console.error(' FIELDEDGE_API_KEY - Your FieldEdge API key');
|
||||
console.error(' FIELDEDGE_COMPANY_ID - Your company ID (optional)');
|
||||
console.error(' FIELDEDGE_API_URL - Custom API URL (optional)');
|
||||
console.error('\nYou can also create a .env file with these values.');
|
||||
if (!apiKey) {
|
||||
console.error('Error: FIELDEDGE_API_KEY environment variable is required');
|
||||
process.exit(1);
|
||||
}
|
||||
return value || '';
|
||||
}
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
const apiKey = getEnvVar('FIELDEDGE_API_KEY');
|
||||
const companyId = getEnvVar('FIELDEDGE_COMPANY_ID', false);
|
||||
const apiUrl = getEnvVar('FIELDEDGE_API_URL', false);
|
||||
|
||||
const server = new FieldEdgeServer(apiKey, companyId, apiUrl);
|
||||
|
||||
console.error(`FieldEdge MCP Server v1.0.0`);
|
||||
console.error(`Loaded ${server.getToolCount()} tools`);
|
||||
console.error('Starting server...');
|
||||
|
||||
const server = new FieldEdgeServer(apiKey, baseUrl);
|
||||
await server.run();
|
||||
} catch (error) {
|
||||
console.error('Fatal error:', error);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* FieldEdge MCP Server Implementation
|
||||
* FieldEdge MCP Server
|
||||
*/
|
||||
|
||||
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
||||
@ -7,49 +7,51 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
||||
import {
|
||||
CallToolRequestSchema,
|
||||
ListToolsRequestSchema,
|
||||
Tool,
|
||||
} from '@modelcontextprotocol/sdk/types.js';
|
||||
|
||||
import { FieldEdgeClient } from './clients/fieldedge.js';
|
||||
import { customerTools } from './tools/customers.js';
|
||||
import { jobTools } from './tools/jobs.js';
|
||||
import { invoiceTools } from './tools/invoices.js';
|
||||
import { estimateTools } from './tools/estimates.js';
|
||||
import { schedulingTools } from './tools/scheduling.js';
|
||||
import { inventoryTools } from './tools/inventory.js';
|
||||
import { technicianTools } from './tools/technicians.js';
|
||||
import { paymentTools } from './tools/payments.js';
|
||||
import { equipmentTools } from './tools/equipment.js';
|
||||
import { reportingTools } from './tools/reporting.js';
|
||||
import { FieldEdgeClient } from './client.js';
|
||||
import { createJobsTools } from './tools/jobs-tools.js';
|
||||
import { createCustomersTools } from './tools/customers-tools.js';
|
||||
import { createInvoicesTools } from './tools/invoices-tools.js';
|
||||
import { createEstimatesTools } from './tools/estimates-tools.js';
|
||||
import { createTechniciansTools } from './tools/technicians-tools.js';
|
||||
import { createDispatchTools } from './tools/dispatch-tools.js';
|
||||
import { createEquipmentTools } from './tools/equipment-tools.js';
|
||||
import { createInventoryTools } from './tools/inventory-tools.js';
|
||||
import { createAgreementsTools } from './tools/agreements-tools.js';
|
||||
import { createReportingTools } from './tools/reporting-tools.js';
|
||||
import { createApps } from './apps/index.js';
|
||||
|
||||
export class FieldEdgeServer {
|
||||
private server: Server;
|
||||
private client: FieldEdgeClient;
|
||||
private tools: any[];
|
||||
private apps: any[];
|
||||
|
||||
constructor(apiKey: string, companyId?: string, apiUrl?: string) {
|
||||
this.client = new FieldEdgeClient({
|
||||
apiKey,
|
||||
companyId,
|
||||
apiUrl,
|
||||
});
|
||||
constructor(apiKey: string, baseUrl?: string) {
|
||||
this.client = new FieldEdgeClient({ apiKey, baseUrl });
|
||||
|
||||
// Initialize all tools
|
||||
this.tools = [
|
||||
...customerTools,
|
||||
...jobTools,
|
||||
...invoiceTools,
|
||||
...estimateTools,
|
||||
...schedulingTools,
|
||||
...inventoryTools,
|
||||
...technicianTools,
|
||||
...paymentTools,
|
||||
...equipmentTools,
|
||||
...reportingTools,
|
||||
...createJobsTools(this.client),
|
||||
...createCustomersTools(this.client),
|
||||
...createInvoicesTools(this.client),
|
||||
...createEstimatesTools(this.client),
|
||||
...createTechniciansTools(this.client),
|
||||
...createDispatchTools(this.client),
|
||||
...createEquipmentTools(this.client),
|
||||
...createInventoryTools(this.client),
|
||||
...createAgreementsTools(this.client),
|
||||
...createReportingTools(this.client),
|
||||
];
|
||||
|
||||
// Initialize all apps
|
||||
this.apps = createApps(this.client);
|
||||
|
||||
// Create MCP server
|
||||
this.server = new Server(
|
||||
{
|
||||
name: 'fieldedge-mcp-server',
|
||||
name: 'fieldedge',
|
||||
version: '1.0.0',
|
||||
},
|
||||
{
|
||||
@ -70,32 +72,34 @@ export class FieldEdgeServer {
|
||||
name: tool.name,
|
||||
description: tool.description,
|
||||
inputSchema: tool.inputSchema,
|
||||
})) as Tool[],
|
||||
})),
|
||||
};
|
||||
});
|
||||
|
||||
// Handle tool execution
|
||||
// Handle tool calls
|
||||
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
const toolName = request.params.name;
|
||||
const args = request.params.arguments || {};
|
||||
|
||||
const tool = this.tools.find((t) => t.name === toolName);
|
||||
const tool = this.tools.find((t) => t.name === request.params.name);
|
||||
|
||||
if (!tool) {
|
||||
throw new Error(`Unknown tool: ${toolName}`);
|
||||
throw new Error(`Unknown tool: ${request.params.name}`);
|
||||
}
|
||||
|
||||
try {
|
||||
return await tool.handler(args, this.client);
|
||||
const result = await tool.handler(request.params.arguments || {});
|
||||
return result;
|
||||
} catch (error) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Error executing ${toolName}: ${errorMessage}`,
|
||||
}],
|
||||
isError: true,
|
||||
};
|
||||
if (error instanceof Error) {
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: `Error: ${error.message}`,
|
||||
},
|
||||
],
|
||||
isError: true,
|
||||
};
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -103,10 +107,6 @@ export class FieldEdgeServer {
|
||||
async run(): Promise<void> {
|
||||
const transport = new StdioServerTransport();
|
||||
await this.server.connect(transport);
|
||||
console.error('FieldEdge MCP Server running on stdio');
|
||||
}
|
||||
|
||||
getToolCount(): number {
|
||||
return this.tools.length;
|
||||
console.error('FieldEdge MCP server running on stdio');
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ export function createAgreementsTools(client: FieldEdgeClient) {
|
||||
pageSize: { type: 'number' },
|
||||
},
|
||||
},
|
||||
handler: async (params: PaginationParams & {
|
||||
handler: async (params: {
|
||||
status?: string;
|
||||
customerId?: string;
|
||||
type?: string;
|
||||
|
||||
234
servers/fieldedge/src/tools/customers-tools.ts
Normal file
234
servers/fieldedge/src/tools/customers-tools.ts
Normal file
@ -0,0 +1,234 @@
|
||||
/**
|
||||
* FieldEdge Customers Tools
|
||||
*/
|
||||
|
||||
import { FieldEdgeClient } from '../client.js';
|
||||
import { Customer, CustomerLocation, Equipment, PaginationParams } from '../types.js';
|
||||
|
||||
export function createCustomersTools(client: FieldEdgeClient) {
|
||||
return [
|
||||
{
|
||||
name: 'fieldedge_customers_list',
|
||||
description: 'List all customers with optional filtering',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
status: {
|
||||
type: 'string',
|
||||
description: 'Filter by customer status',
|
||||
enum: ['active', 'inactive'],
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
description: 'Filter by customer type',
|
||||
enum: ['residential', 'commercial'],
|
||||
},
|
||||
page: { type: 'number' },
|
||||
pageSize: { type: 'number' },
|
||||
},
|
||||
},
|
||||
handler: async (params: any) => {
|
||||
const result = await client.getPaginated<Customer>('/customers', params as any);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_customers_get',
|
||||
description: 'Get detailed information about a specific customer',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
customerId: { type: 'string', description: 'Customer ID' },
|
||||
},
|
||||
required: ['customerId'],
|
||||
},
|
||||
handler: async (params: { customerId: string }) => {
|
||||
const customer = await client.get<Customer>(`/customers/${params.customerId}`);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(customer, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_customers_create',
|
||||
description: 'Create a new customer',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
type: {
|
||||
type: 'string',
|
||||
description: 'Customer type',
|
||||
enum: ['residential', 'commercial'],
|
||||
},
|
||||
firstName: { type: 'string', description: 'First name (for residential)' },
|
||||
lastName: { type: 'string', description: 'Last name (for residential)' },
|
||||
companyName: { type: 'string', description: 'Company name (for commercial)' },
|
||||
email: { type: 'string', description: 'Email address' },
|
||||
phone: { type: 'string', description: 'Primary phone number' },
|
||||
mobilePhone: { type: 'string', description: 'Mobile phone number' },
|
||||
street1: { type: 'string', description: 'Street address line 1' },
|
||||
street2: { type: 'string', description: 'Street address line 2' },
|
||||
city: { type: 'string', description: 'City' },
|
||||
state: { type: 'string', description: 'State' },
|
||||
zip: { type: 'string', description: 'ZIP code' },
|
||||
taxExempt: { type: 'boolean', description: 'Tax exempt status' },
|
||||
},
|
||||
required: ['type'],
|
||||
},
|
||||
handler: async (params: any) => {
|
||||
const customer = await client.post<Customer>('/customers', params);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(customer, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_customers_update',
|
||||
description: 'Update an existing customer',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
customerId: { type: 'string', description: 'Customer ID' },
|
||||
firstName: { type: 'string' },
|
||||
lastName: { type: 'string' },
|
||||
companyName: { type: 'string' },
|
||||
email: { type: 'string' },
|
||||
phone: { type: 'string' },
|
||||
mobilePhone: { type: 'string' },
|
||||
status: {
|
||||
type: 'string',
|
||||
enum: ['active', 'inactive'],
|
||||
},
|
||||
taxExempt: { type: 'boolean' },
|
||||
},
|
||||
required: ['customerId'],
|
||||
},
|
||||
handler: async (params: any) => {
|
||||
const { customerId, ...updateData } = params;
|
||||
const customer = await client.patch<Customer>(
|
||||
`/customers/${customerId}`,
|
||||
updateData
|
||||
);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(customer, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_customers_delete',
|
||||
description: 'Delete a customer (or mark as inactive)',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
customerId: { type: 'string', description: 'Customer ID' },
|
||||
},
|
||||
required: ['customerId'],
|
||||
},
|
||||
handler: async (params: { customerId: string }) => {
|
||||
await client.delete(`/customers/${params.customerId}`);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: `Customer ${params.customerId} deleted successfully`,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_customers_search',
|
||||
description: 'Search customers by name, email, phone, or customer number',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
query: { type: 'string', description: 'Search query' },
|
||||
page: { type: 'number' },
|
||||
pageSize: { type: 'number' },
|
||||
},
|
||||
required: ['query'],
|
||||
},
|
||||
handler: async (params: any) => {
|
||||
const result = await client.getPaginated<Customer>('/customers/search', params as any);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_customers_locations_list',
|
||||
description: 'List all locations for a customer',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
customerId: { type: 'string', description: 'Customer ID' },
|
||||
},
|
||||
required: ['customerId'],
|
||||
},
|
||||
handler: async (params: { customerId: string }) => {
|
||||
const locations = await client.get<{ data: CustomerLocation[] }>(
|
||||
`/customers/${params.customerId}/locations`
|
||||
);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(locations, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_customers_equipment_list',
|
||||
description: 'List all equipment for a customer',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
customerId: { type: 'string', description: 'Customer ID' },
|
||||
},
|
||||
required: ['customerId'],
|
||||
},
|
||||
handler: async (params: { customerId: string }) => {
|
||||
const equipment = await client.get<{ data: Equipment[] }>(
|
||||
`/customers/${params.customerId}/equipment`
|
||||
);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(equipment, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
@ -31,7 +31,7 @@ export function createEquipmentTools(client: FieldEdgeClient) {
|
||||
type?: string;
|
||||
status?: string;
|
||||
}) => {
|
||||
const result = await client.getPaginated<Equipment>('/equipment', params);
|
||||
const result = await client.getPaginated<Equipment>('/equipment', params as any);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
|
||||
@ -1,213 +0,0 @@
|
||||
/**
|
||||
* Equipment Management Tools
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
import type { FieldEdgeClient } from '../clients/fieldedge.js';
|
||||
|
||||
export const equipmentTools = [
|
||||
{
|
||||
name: 'fieldedge_list_equipment',
|
||||
description: 'List all equipment with optional filtering',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
page: { type: 'number' },
|
||||
pageSize: { type: 'number' },
|
||||
customerId: { type: 'string', description: 'Filter by customer' },
|
||||
type: { type: 'string', description: 'Filter by equipment type' },
|
||||
manufacturer: { type: 'string', description: 'Filter by manufacturer' },
|
||||
status: { type: 'string', enum: ['active', 'inactive', 'decommissioned'] },
|
||||
},
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const result = await client.getEquipment(args);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_equipment',
|
||||
description: 'Get detailed information about a specific equipment',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
equipmentId: { type: 'string', description: 'Equipment ID' },
|
||||
},
|
||||
required: ['equipmentId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const equipment = await client.getEquipmentById(args.equipmentId);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: JSON.stringify(equipment, null, 2),
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_create_equipment',
|
||||
description: 'Create a new equipment record',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
customerId: { type: 'string', description: 'Customer ID' },
|
||||
type: { type: 'string', description: 'Equipment type (e.g., "HVAC Unit", "Water Heater", "Furnace")' },
|
||||
manufacturer: { type: 'string', description: 'Manufacturer name' },
|
||||
model: { type: 'string', description: 'Model number' },
|
||||
serialNumber: { type: 'string', description: 'Serial number' },
|
||||
installDate: { type: 'string', description: 'Installation date (ISO 8601)' },
|
||||
warrantyExpiry: { type: 'string', description: 'Warranty expiry date (ISO 8601)' },
|
||||
notes: { type: 'string', description: 'Additional notes' },
|
||||
},
|
||||
required: ['customerId', 'type', 'manufacturer', 'model'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const equipment = await client.createEquipment(args);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Equipment created successfully:\n${JSON.stringify(equipment, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_update_equipment',
|
||||
description: 'Update an existing equipment record',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
equipmentId: { type: 'string', description: 'Equipment ID' },
|
||||
serialNumber: { type: 'string' },
|
||||
installDate: { type: 'string' },
|
||||
warrantyExpiry: { type: 'string' },
|
||||
lastServiceDate: { type: 'string' },
|
||||
nextServiceDue: { type: 'string' },
|
||||
status: { type: 'string', enum: ['active', 'inactive', 'decommissioned'] },
|
||||
notes: { type: 'string' },
|
||||
},
|
||||
required: ['equipmentId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const { equipmentId, ...updateData } = args;
|
||||
const equipment = await client.updateEquipment(equipmentId, updateData);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Equipment updated successfully:\n${JSON.stringify(equipment, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_delete_equipment',
|
||||
description: 'Delete an equipment record',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
equipmentId: { type: 'string', description: 'Equipment ID' },
|
||||
},
|
||||
required: ['equipmentId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
await client.deleteEquipment(args.equipmentId);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Equipment ${args.equipmentId} deleted successfully`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_equipment_by_customer',
|
||||
description: 'Get all equipment for a specific customer',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
customerId: { type: 'string', description: 'Customer ID' },
|
||||
},
|
||||
required: ['customerId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const equipment = await client.getEquipmentByCustomer(args.customerId);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Found ${equipment.length} equipment:\n${JSON.stringify(equipment, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_service_history',
|
||||
description: 'Get service history for a specific equipment',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
equipmentId: { type: 'string', description: 'Equipment ID' },
|
||||
},
|
||||
required: ['equipmentId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const history = await client.getServiceHistory(args.equipmentId);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Service history (${history.length} records):\n${JSON.stringify(history, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_add_service_history',
|
||||
description: 'Add a service record to equipment history',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
equipmentId: { type: 'string', description: 'Equipment ID' },
|
||||
jobId: { type: 'string', description: 'Associated job ID' },
|
||||
serviceDate: { type: 'string', description: 'Service date (ISO 8601)' },
|
||||
technicianId: { type: 'string', description: 'Technician ID' },
|
||||
serviceType: { type: 'string', description: 'Type of service (e.g., "Maintenance", "Repair", "Installation")' },
|
||||
description: { type: 'string', description: 'Service description' },
|
||||
cost: { type: 'number', description: 'Service cost' },
|
||||
notes: { type: 'string', description: 'Additional notes' },
|
||||
},
|
||||
required: ['equipmentId', 'jobId', 'serviceDate', 'technicianId', 'serviceType', 'description', 'cost'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const { equipmentId, ...serviceData } = args;
|
||||
const history = await client.addServiceHistory(equipmentId, serviceData);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Service history added:\n${JSON.stringify(history, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_equipment_due_for_service',
|
||||
description: 'Get all equipment that is due for service',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {},
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const equipment = await client.getEquipmentDueForService();
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Equipment due for service (${equipment.length}):\n${JSON.stringify(equipment, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
@ -31,7 +31,7 @@ export function createEstimatesTools(client: FieldEdgeClient) {
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
}) => {
|
||||
const result = await client.getPaginated<Estimate>('/estimates', params);
|
||||
const result = await client.getPaginated<Estimate>('/estimates', params as any);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
|
||||
@ -24,7 +24,7 @@ export function createInventoryTools(client: FieldEdgeClient) {
|
||||
pageSize: { type: 'number' },
|
||||
},
|
||||
},
|
||||
handler: async (params: PaginationParams & {
|
||||
handler: async (params: {
|
||||
category?: string;
|
||||
manufacturer?: string;
|
||||
lowStock?: boolean;
|
||||
@ -135,7 +135,7 @@ export function createInventoryTools(client: FieldEdgeClient) {
|
||||
pageSize: { type: 'number' },
|
||||
},
|
||||
},
|
||||
handler: async (params: PaginationParams & {
|
||||
handler: async (params: {
|
||||
status?: string;
|
||||
vendorId?: string;
|
||||
startDate?: string;
|
||||
|
||||
@ -31,7 +31,7 @@ export function createInvoicesTools(client: FieldEdgeClient) {
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
}) => {
|
||||
const result = await client.getPaginated<Invoice>('/invoices', params);
|
||||
const result = await client.getPaginated<Invoice>('/invoices', params as any);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
|
||||
@ -45,7 +45,7 @@ export function createJobsTools(client: FieldEdgeClient) {
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
}) => {
|
||||
const result = await client.getPaginated<Job>('/jobs', params);
|
||||
const result = await client.getPaginated<Job>('/jobs', params as any);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
|
||||
@ -1,192 +0,0 @@
|
||||
/**
|
||||
* Payment Management Tools
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
import type { FieldEdgeClient } from '../clients/fieldedge.js';
|
||||
|
||||
export const paymentTools = [
|
||||
{
|
||||
name: 'fieldedge_list_payments',
|
||||
description: 'List all payments with optional filtering',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
page: { type: 'number' },
|
||||
pageSize: { type: 'number' },
|
||||
status: { type: 'string', enum: ['pending', 'processed', 'failed', 'refunded'] },
|
||||
customerId: { type: 'string', description: 'Filter by customer' },
|
||||
invoiceId: { type: 'string', description: 'Filter by invoice' },
|
||||
paymentMethod: {
|
||||
type: 'string',
|
||||
enum: ['cash', 'check', 'credit-card', 'debit-card', 'ach', 'wire', 'other'],
|
||||
},
|
||||
},
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const result = await client.getPayments(args);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_payment',
|
||||
description: 'Get detailed information about a specific payment',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
paymentId: { type: 'string', description: 'Payment ID' },
|
||||
},
|
||||
required: ['paymentId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const payment = await client.getPayment(args.paymentId);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: JSON.stringify(payment, null, 2),
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_create_payment',
|
||||
description: 'Create a new payment',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
invoiceId: { type: 'string', description: 'Invoice ID' },
|
||||
customerId: { type: 'string', description: 'Customer ID' },
|
||||
amount: { type: 'number', description: 'Payment amount' },
|
||||
paymentMethod: {
|
||||
type: 'string',
|
||||
enum: ['cash', 'check', 'credit-card', 'debit-card', 'ach', 'wire', 'other'],
|
||||
description: 'Payment method',
|
||||
},
|
||||
paymentDate: { type: 'string', description: 'Payment date (ISO 8601)' },
|
||||
reference: { type: 'string', description: 'Reference number (confirmation, check number, etc.)' },
|
||||
checkNumber: { type: 'string', description: 'Check number (if applicable)' },
|
||||
cardLast4: { type: 'string', description: 'Last 4 digits of card (if applicable)' },
|
||||
notes: { type: 'string', description: 'Additional notes' },
|
||||
},
|
||||
required: ['invoiceId', 'customerId', 'amount', 'paymentMethod', 'paymentDate'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const payment = await client.createPayment(args);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Payment created successfully:\n${JSON.stringify(payment, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_update_payment',
|
||||
description: 'Update an existing payment',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
paymentId: { type: 'string', description: 'Payment ID' },
|
||||
reference: { type: 'string' },
|
||||
notes: { type: 'string' },
|
||||
},
|
||||
required: ['paymentId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const { paymentId, ...updateData } = args;
|
||||
const payment = await client.updatePayment(paymentId, updateData);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Payment updated successfully:\n${JSON.stringify(payment, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_delete_payment',
|
||||
description: 'Delete a payment',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
paymentId: { type: 'string', description: 'Payment ID' },
|
||||
},
|
||||
required: ['paymentId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
await client.deletePayment(args.paymentId);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Payment ${args.paymentId} deleted successfully`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_refund_payment',
|
||||
description: 'Refund a payment (full or partial)',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
paymentId: { type: 'string', description: 'Payment ID' },
|
||||
amount: { type: 'number', description: 'Refund amount (optional, full refund if not specified)' },
|
||||
},
|
||||
required: ['paymentId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const payment = await client.refundPayment(args.paymentId, args.amount);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Payment refunded:\n${JSON.stringify(payment, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_payments_by_invoice',
|
||||
description: 'Get all payments for a specific invoice',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
invoiceId: { type: 'string', description: 'Invoice ID' },
|
||||
},
|
||||
required: ['invoiceId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const payments = await client.getPaymentsByInvoice(args.invoiceId);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Found ${payments.length} payments:\n${JSON.stringify(payments, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_payments_by_customer',
|
||||
description: 'Get all payments for a specific customer',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
customerId: { type: 'string', description: 'Customer ID' },
|
||||
},
|
||||
required: ['customerId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const payments = await client.getPaymentsByCustomer(args.customerId);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Found ${payments.length} payments:\n${JSON.stringify(payments, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
@ -1,217 +0,0 @@
|
||||
/**
|
||||
* Reporting and Analytics Tools
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
import type { FieldEdgeClient } from '../clients/fieldedge.js';
|
||||
|
||||
export const reportingTools = [
|
||||
{
|
||||
name: 'fieldedge_list_reports',
|
||||
description: 'List all available reports',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
type: {
|
||||
type: 'string',
|
||||
enum: [
|
||||
'revenue',
|
||||
'technician-productivity',
|
||||
'job-completion',
|
||||
'customer-satisfaction',
|
||||
'inventory-valuation',
|
||||
'aging-receivables',
|
||||
'sales-by-category',
|
||||
'equipment-maintenance',
|
||||
'custom',
|
||||
],
|
||||
description: 'Filter by report type',
|
||||
},
|
||||
},
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const reports = await client.getReports(args.type);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: JSON.stringify(reports, null, 2),
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_report',
|
||||
description: 'Get a specific report by ID',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
reportId: { type: 'string', description: 'Report ID' },
|
||||
},
|
||||
required: ['reportId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const report = await client.getReport(args.reportId);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: JSON.stringify(report, null, 2),
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_generate_report',
|
||||
description: 'Generate a new report',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
type: {
|
||||
type: 'string',
|
||||
enum: [
|
||||
'revenue',
|
||||
'technician-productivity',
|
||||
'job-completion',
|
||||
'customer-satisfaction',
|
||||
'inventory-valuation',
|
||||
'aging-receivables',
|
||||
'sales-by-category',
|
||||
'equipment-maintenance',
|
||||
],
|
||||
description: 'Report type',
|
||||
},
|
||||
parameters: {
|
||||
type: 'object',
|
||||
description: 'Report parameters (varies by type)',
|
||||
},
|
||||
},
|
||||
required: ['type'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const report = await client.generateReport(args.type, args.parameters);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Report generated:\n${JSON.stringify(report, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_revenue_report',
|
||||
description: 'Get revenue report for a date range',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
startDate: { type: 'string', description: 'Start date (YYYY-MM-DD)' },
|
||||
endDate: { type: 'string', description: 'End date (YYYY-MM-DD)' },
|
||||
},
|
||||
required: ['startDate', 'endDate'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const report = await client.getRevenueReport(args.startDate, args.endDate);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Revenue Report (${args.startDate} to ${args.endDate}):\n${JSON.stringify(report, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_technician_productivity_report',
|
||||
description: 'Get technician productivity report for a date range',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
startDate: { type: 'string', description: 'Start date (YYYY-MM-DD)' },
|
||||
endDate: { type: 'string', description: 'End date (YYYY-MM-DD)' },
|
||||
},
|
||||
required: ['startDate', 'endDate'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const report = await client.getTechnicianProductivityReport(args.startDate, args.endDate);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Technician Productivity Report:\n${JSON.stringify(report, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_job_completion_report',
|
||||
description: 'Get job completion statistics for a date range',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
startDate: { type: 'string', description: 'Start date (YYYY-MM-DD)' },
|
||||
endDate: { type: 'string', description: 'End date (YYYY-MM-DD)' },
|
||||
},
|
||||
required: ['startDate', 'endDate'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const report = await client.getJobCompletionReport(args.startDate, args.endDate);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Job Completion Report:\n${JSON.stringify(report, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_aging_receivables_report',
|
||||
description: 'Get aging receivables report showing outstanding invoices by age',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {},
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const report = await client.getAgingReceivablesReport();
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Aging Receivables Report:\n${JSON.stringify(report, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_inventory_valuation_report',
|
||||
description: 'Get inventory valuation report showing current inventory value',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {},
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const report = await client.getInventoryValuationReport();
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Inventory Valuation Report:\n${JSON.stringify(report, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_sales_by_category_report',
|
||||
description: 'Get sales breakdown by category for a date range',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
startDate: { type: 'string', description: 'Start date (YYYY-MM-DD)' },
|
||||
endDate: { type: 'string', description: 'End date (YYYY-MM-DD)' },
|
||||
},
|
||||
required: ['startDate', 'endDate'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const report = await client.getSalesByCategoryReport(args.startDate, args.endDate);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Sales by Category Report:\n${JSON.stringify(report, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
@ -27,7 +27,7 @@ export function createTechniciansTools(client: FieldEdgeClient) {
|
||||
status?: string;
|
||||
role?: string;
|
||||
}) => {
|
||||
const result = await client.getPaginated<Technician>('/technicians', params);
|
||||
const result = await client.getPaginated<Technician>('/technicians', params as any);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
|
||||
@ -1,195 +0,0 @@
|
||||
/**
|
||||
* Technician Management Tools
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
import type { FieldEdgeClient } from '../clients/fieldedge.js';
|
||||
|
||||
export const technicianTools = [
|
||||
{
|
||||
name: 'fieldedge_list_technicians',
|
||||
description: 'List all technicians with optional filtering',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
page: { type: 'number' },
|
||||
pageSize: { type: 'number' },
|
||||
status: { type: 'string', enum: ['active', 'inactive', 'on-leave'], description: 'Filter by status' },
|
||||
role: { type: 'string', description: 'Filter by role' },
|
||||
skills: { type: 'array', items: { type: 'string' }, description: 'Filter by skills' },
|
||||
},
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const result = await client.getTechnicians(args);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_technician',
|
||||
description: 'Get detailed information about a specific technician',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
technicianId: { type: 'string', description: 'Technician ID' },
|
||||
},
|
||||
required: ['technicianId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const technician = await client.getTechnician(args.technicianId);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: JSON.stringify(technician, null, 2),
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_create_technician',
|
||||
description: 'Create a new technician',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
employeeNumber: { type: 'string', description: 'Employee number' },
|
||||
firstName: { type: 'string', description: 'First name' },
|
||||
lastName: { type: 'string', description: 'Last name' },
|
||||
email: { type: 'string', description: 'Email address' },
|
||||
phone: { type: 'string', description: 'Phone number' },
|
||||
role: { type: 'string', description: 'Role/title' },
|
||||
skills: { type: 'array', items: { type: 'string' }, description: 'Skills (e.g., ["HVAC", "Electrical"])' },
|
||||
certifications: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
name: { type: 'string' },
|
||||
number: { type: 'string' },
|
||||
issuer: { type: 'string' },
|
||||
issueDate: { type: 'string' },
|
||||
expiryDate: { type: 'string' },
|
||||
},
|
||||
},
|
||||
},
|
||||
hourlyRate: { type: 'number', description: 'Hourly rate' },
|
||||
overtimeRate: { type: 'number', description: 'Overtime rate' },
|
||||
serviceRadius: { type: 'number', description: 'Service radius in miles' },
|
||||
homeAddress: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
street1: { type: 'string' },
|
||||
city: { type: 'string' },
|
||||
state: { type: 'string' },
|
||||
zip: { type: 'string' },
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ['employeeNumber', 'firstName', 'lastName', 'email', 'phone', 'role'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const technician = await client.createTechnician(args);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Technician created successfully:\n${JSON.stringify(technician, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_update_technician',
|
||||
description: 'Update an existing technician',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
technicianId: { type: 'string', description: 'Technician ID' },
|
||||
email: { type: 'string' },
|
||||
phone: { type: 'string' },
|
||||
role: { type: 'string' },
|
||||
skills: { type: 'array', items: { type: 'string' } },
|
||||
certifications: { type: 'array' },
|
||||
hourlyRate: { type: 'number' },
|
||||
overtimeRate: { type: 'number' },
|
||||
serviceRadius: { type: 'number' },
|
||||
homeAddress: { type: 'object' },
|
||||
},
|
||||
required: ['technicianId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const { technicianId, ...updateData } = args;
|
||||
const technician = await client.updateTechnician(technicianId, updateData);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Technician updated successfully:\n${JSON.stringify(technician, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_delete_technician',
|
||||
description: 'Delete a technician',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
technicianId: { type: 'string', description: 'Technician ID' },
|
||||
},
|
||||
required: ['technicianId'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
await client.deleteTechnician(args.technicianId);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Technician ${args.technicianId} deleted successfully`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_get_available_technicians',
|
||||
description: 'Get technicians available on a specific date, optionally filtered by skills',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
date: { type: 'string', description: 'Date (YYYY-MM-DD)' },
|
||||
skills: { type: 'array', items: { type: 'string' }, description: 'Required skills (optional)' },
|
||||
},
|
||||
required: ['date'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const technicians = await client.getAvailableTechnicians(args.date, args.skills);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Available technicians (${technicians.length}):\n${JSON.stringify(technicians, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'fieldedge_update_technician_status',
|
||||
description: 'Update a technician\'s status',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
technicianId: { type: 'string', description: 'Technician ID' },
|
||||
status: { type: 'string', enum: ['active', 'inactive', 'on-leave'], description: 'New status' },
|
||||
},
|
||||
required: ['technicianId', 'status'],
|
||||
},
|
||||
handler: async (args: any, client: FieldEdgeClient) => {
|
||||
const technician = await client.updateTechnicianStatus(args.technicianId, args.status);
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: `Technician status updated to ${args.status}:\n${JSON.stringify(technician, null, 2)}`,
|
||||
}],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
380
servers/toast/README.md
Normal file
380
servers/toast/README.md
Normal file
@ -0,0 +1,380 @@
|
||||
# Toast MCP Server
|
||||
|
||||
A complete Model Context Protocol (MCP) server for Toast POS integration, providing comprehensive access to orders, menus, employees, labor, payments, inventory, customers, and reporting.
|
||||
|
||||
## Features
|
||||
|
||||
### 🔧 50+ MCP Tools
|
||||
|
||||
#### Orders (9 tools)
|
||||
- `toast_list_orders` - List orders with date range filtering
|
||||
- `toast_get_order` - Get order details
|
||||
- `toast_create_order` - Create new orders
|
||||
- `toast_update_order` - Update order details
|
||||
- `toast_add_order_item` - Add items to orders
|
||||
- `toast_remove_order_item` - Remove items from orders
|
||||
- `toast_apply_discount` - Apply discounts
|
||||
- `toast_void_order` - Void orders
|
||||
- `toast_list_order_checks` - List order checks
|
||||
|
||||
#### Menus (8 tools)
|
||||
- `toast_list_menus` - List all menus
|
||||
- `toast_get_menu` - Get menu details
|
||||
- `toast_list_menu_groups` - List menu groups
|
||||
- `toast_get_menu_group` - Get group details
|
||||
- `toast_list_menu_items` - List menu items
|
||||
- `toast_get_menu_item` - Get item details
|
||||
- `toast_list_item_modifiers` - List item modifiers
|
||||
- `toast_update_item_price` - Update item pricing
|
||||
|
||||
#### Employees (10 tools)
|
||||
- `toast_list_employees` - List all employees
|
||||
- `toast_get_employee` - Get employee details
|
||||
- `toast_create_employee` - Create new employees
|
||||
- `toast_update_employee` - Update employee info
|
||||
- `toast_delete_employee` - Delete employees
|
||||
- `toast_list_employee_jobs` - List employee jobs
|
||||
- `toast_list_employee_shifts` - List employee shifts
|
||||
- `toast_clock_in` - Clock in employees
|
||||
- `toast_clock_out` - Clock out employees
|
||||
- `toast_list_time_entries` - List time entries
|
||||
|
||||
#### Labor (5 tools)
|
||||
- `toast_list_shifts` - List all shifts
|
||||
- `toast_get_shift` - Get shift details
|
||||
- `toast_list_shift_breaks` - List shift breaks
|
||||
- `toast_get_labor_cost` - Get labor cost reports
|
||||
- `toast_list_jobs` - List job positions
|
||||
|
||||
#### Restaurant (5 tools)
|
||||
- `toast_get_restaurant_info` - Get restaurant info
|
||||
- `toast_list_revenue_centers` - List revenue centers
|
||||
- `toast_list_dining_options` - List dining options
|
||||
- `toast_list_service_areas` - List service areas
|
||||
- `toast_list_tables` - List tables
|
||||
|
||||
#### Payments (5 tools)
|
||||
- `toast_list_payments` - List payments
|
||||
- `toast_get_payment` - Get payment details
|
||||
- `toast_void_payment` - Void payments
|
||||
- `toast_refund_payment` - Process refunds
|
||||
- `toast_list_tips` - List tips
|
||||
|
||||
#### Inventory (5 tools)
|
||||
- `toast_list_inventory_items` - List inventory
|
||||
- `toast_get_inventory_item` - Get item details
|
||||
- `toast_update_inventory_count` - Update counts
|
||||
- `toast_list_vendors` - List vendors
|
||||
- `toast_create_purchase_order` - Create POs
|
||||
|
||||
#### Customers (6 tools)
|
||||
- `toast_list_customers` - List customers
|
||||
- `toast_get_customer` - Get customer details
|
||||
- `toast_create_customer` - Create customers
|
||||
- `toast_update_customer` - Update customer info
|
||||
- `toast_list_customer_loyalty` - List loyalty info
|
||||
- `toast_add_loyalty_points` - Add loyalty points
|
||||
|
||||
#### Reporting (5 tools)
|
||||
- `toast_sales_summary` - Sales summary reports
|
||||
- `toast_labor_cost_report` - Labor cost analysis
|
||||
- `toast_menu_item_performance` - Menu performance
|
||||
- `toast_revenue_by_hour` - Hourly revenue
|
||||
- `toast_tip_summary` - Tip summaries
|
||||
|
||||
#### Cash Management (2 tools)
|
||||
- `toast_list_cash_entries` - List cash entries
|
||||
- `toast_get_drawer_status` - Get drawer status
|
||||
|
||||
### 📊 18 MCP Apps
|
||||
|
||||
1. **order-dashboard** - Real-time order monitoring
|
||||
2. **order-detail** - Detailed order view
|
||||
3. **order-grid** - Searchable order grid
|
||||
4. **menu-manager** - Menu management interface
|
||||
5. **menu-item-detail** - Item detail view
|
||||
6. **employee-dashboard** - Employee management
|
||||
7. **employee-schedule** - Schedule planning
|
||||
8. **labor-dashboard** - Labor analytics
|
||||
9. **restaurant-overview** - Restaurant config
|
||||
10. **table-map** - Interactive floor plan
|
||||
11. **payment-history** - Payment tracking
|
||||
12. **inventory-tracker** - Inventory management
|
||||
13. **customer-detail** - Customer profiles
|
||||
14. **customer-loyalty** - Loyalty program
|
||||
15. **sales-dashboard** - Sales analytics
|
||||
16. **menu-performance** - Menu analytics
|
||||
17. **tip-summary** - Tip tracking
|
||||
18. **revenue-by-hour** - Hourly revenue analysis
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run build
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Set the following environment variables:
|
||||
|
||||
```bash
|
||||
export TOAST_API_TOKEN="your-toast-api-token"
|
||||
export TOAST_RESTAURANT_GUID="your-restaurant-guid"
|
||||
export TOAST_BASE_URL="https://ws-api.toasttab.com" # Optional, defaults to production
|
||||
```
|
||||
|
||||
### Getting Toast API Credentials
|
||||
|
||||
1. Log in to Toast Web Admin
|
||||
2. Navigate to Integrations → API
|
||||
3. Create a new API token
|
||||
4. Copy your Restaurant GUID from Settings → Restaurant Info
|
||||
|
||||
## Usage
|
||||
|
||||
### As MCP Server
|
||||
|
||||
Add to your MCP client configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"toast": {
|
||||
"command": "node",
|
||||
"args": ["/path/to/toast/dist/main.js"],
|
||||
"env": {
|
||||
"TOAST_API_TOKEN": "your-token",
|
||||
"TOAST_RESTAURANT_GUID": "your-guid"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Direct Execution
|
||||
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
## API Client Features
|
||||
|
||||
- ✅ Bearer token authentication
|
||||
- ✅ Restaurant GUID injection
|
||||
- ✅ Automatic pagination handling
|
||||
- ✅ Comprehensive error handling
|
||||
- ✅ Rate limit awareness
|
||||
- ✅ Retry logic
|
||||
- ✅ Request/response logging
|
||||
|
||||
## Tool Examples
|
||||
|
||||
### List Today's Orders
|
||||
|
||||
```typescript
|
||||
{
|
||||
"name": "toast_list_orders",
|
||||
"arguments": {
|
||||
"startDate": "2025-01-28T00:00:00Z",
|
||||
"endDate": "2025-01-28T23:59:59Z"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Create New Order
|
||||
|
||||
```typescript
|
||||
{
|
||||
"name": "toast_create_order",
|
||||
"arguments": {
|
||||
"diningOptionGuid": "abc-123",
|
||||
"tableGuid": "table-5",
|
||||
"numberOfGuests": 4
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Add Item to Order
|
||||
|
||||
```typescript
|
||||
{
|
||||
"name": "toast_add_order_item",
|
||||
"arguments": {
|
||||
"orderId": "order-123",
|
||||
"checkGuid": "check-456",
|
||||
"itemGuid": "item-789",
|
||||
"quantity": 2,
|
||||
"modifiers": [
|
||||
{ "guid": "mod-1", "quantity": 1 }
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Clock In Employee
|
||||
|
||||
```typescript
|
||||
{
|
||||
"name": "toast_clock_in",
|
||||
"arguments": {
|
||||
"employeeGuid": "emp-123",
|
||||
"jobGuid": "job-server"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Get Sales Summary
|
||||
|
||||
```typescript
|
||||
{
|
||||
"name": "toast_sales_summary",
|
||||
"arguments": {
|
||||
"startDate": "2025-01-28T00:00:00Z",
|
||||
"endDate": "2025-01-28T23:59:59Z"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## MCP App Access
|
||||
|
||||
Access apps via MCP resources:
|
||||
|
||||
```
|
||||
toast://apps/order-dashboard
|
||||
toast://apps/sales-dashboard
|
||||
toast://apps/menu-manager
|
||||
toast://apps/employee-schedule
|
||||
toast://apps/table-map
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
toast/
|
||||
├── src/
|
||||
│ ├── api-client.ts # Toast API client with auth & pagination
|
||||
│ ├── server.ts # MCP server implementation
|
||||
│ ├── main.ts # Entry point
|
||||
│ ├── types/
|
||||
│ │ └── index.ts # TypeScript type definitions
|
||||
│ ├── tools/
|
||||
│ │ ├── orders-tools.ts # Order management tools
|
||||
│ │ ├── menus-tools.ts # Menu management tools
|
||||
│ │ ├── employees-tools.ts # Employee management tools
|
||||
│ │ ├── labor-tools.ts # Labor tracking tools
|
||||
│ │ ├── restaurant-tools.ts # Restaurant config tools
|
||||
│ │ ├── payments-tools.ts # Payment processing tools
|
||||
│ │ ├── inventory-tools.ts # Inventory management tools
|
||||
│ │ ├── customers-tools.ts # Customer management tools
|
||||
│ │ ├── reporting-tools.ts # Reporting & analytics tools
|
||||
│ │ └── cash-tools.ts # Cash management tools
|
||||
│ └── apps/
|
||||
│ └── index.ts # MCP app definitions
|
||||
├── package.json
|
||||
├── tsconfig.json
|
||||
└── README.md
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
All tools return structured error responses:
|
||||
|
||||
```json
|
||||
{
|
||||
"content": [{
|
||||
"type": "text",
|
||||
"text": "Error: Order not found (404)"
|
||||
}],
|
||||
"isError": true
|
||||
}
|
||||
```
|
||||
|
||||
## Pagination
|
||||
|
||||
Tools support automatic pagination:
|
||||
|
||||
```typescript
|
||||
{
|
||||
"name": "toast_list_orders",
|
||||
"arguments": {
|
||||
"page": 2,
|
||||
"pageSize": 50
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
npm install
|
||||
|
||||
# Build TypeScript
|
||||
npm run build
|
||||
|
||||
# Watch mode for development
|
||||
npm run dev
|
||||
|
||||
# Start server
|
||||
npm start
|
||||
```
|
||||
|
||||
## API Documentation
|
||||
|
||||
Toast API documentation: https://doc.toasttab.com/
|
||||
|
||||
### Key Endpoints
|
||||
|
||||
- **Orders**: `/orders/v2/orders`
|
||||
- **Menus**: `/menus/v2/menus`
|
||||
- **Labor**: `/labor/v1/employees`
|
||||
- **Payments**: `/payments/v1/payments`
|
||||
- **Restaurant**: `/restaurants/v1/restaurants`
|
||||
|
||||
## Security
|
||||
|
||||
- API tokens stored in environment variables
|
||||
- No credentials in code or logs
|
||||
- Bearer token authentication
|
||||
- HTTPS-only communication
|
||||
- Restaurant GUID scoping
|
||||
|
||||
## Support
|
||||
|
||||
For Toast API support: https://central.toasttab.com/s/support
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
## Contributing
|
||||
|
||||
1. Fork the repository
|
||||
2. Create a feature branch
|
||||
3. Commit your changes
|
||||
4. Push to the branch
|
||||
5. Create a Pull Request
|
||||
|
||||
## Roadmap
|
||||
|
||||
- [ ] WebSocket support for real-time updates
|
||||
- [ ] Advanced reporting with custom date ranges
|
||||
- [ ] Menu optimization recommendations
|
||||
- [ ] Labor cost forecasting
|
||||
- [ ] Inventory auto-reordering
|
||||
- [ ] Customer segmentation
|
||||
- [ ] A/B testing for menu items
|
||||
- [ ] Integration with third-party delivery platforms
|
||||
- [ ] Multi-location support
|
||||
- [ ] Advanced analytics dashboards
|
||||
|
||||
## Version History
|
||||
|
||||
### 1.0.0 (2025-01-28)
|
||||
- Initial release
|
||||
- 50+ MCP tools
|
||||
- 18 MCP apps
|
||||
- Complete Toast API integration
|
||||
- Comprehensive type definitions
|
||||
- Error handling and pagination
|
||||
97
servers/toast/dist/api-client.d.ts
vendored
Normal file
97
servers/toast/dist/api-client.d.ts
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
import { AxiosRequestConfig } from 'axios';
|
||||
import type { ToastConfig, PaginationParams, PaginatedResponse } from './types/index.js';
|
||||
export declare class ToastAPIError extends Error {
|
||||
statusCode?: number | undefined;
|
||||
response?: any | undefined;
|
||||
constructor(message: string, statusCode?: number | undefined, response?: any | undefined);
|
||||
}
|
||||
export declare class ToastAPIClient {
|
||||
private client;
|
||||
private config;
|
||||
constructor(config: ToastConfig);
|
||||
get<T>(endpoint: string, params?: Record<string, any>, config?: AxiosRequestConfig): Promise<T>;
|
||||
post<T>(endpoint: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
||||
put<T>(endpoint: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
||||
patch<T>(endpoint: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
||||
delete<T>(endpoint: string, config?: AxiosRequestConfig): Promise<T>;
|
||||
getPaginated<T>(endpoint: string, pagination?: PaginationParams, additionalParams?: Record<string, any>): Promise<PaginatedResponse<T>>;
|
||||
getAllPages<T>(endpoint: string, pageSize?: number, additionalParams?: Record<string, any>): Promise<T[]>;
|
||||
orders: {
|
||||
list: (params?: {
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
pagination?: PaginationParams;
|
||||
}) => Promise<PaginatedResponse<unknown>>;
|
||||
get: (orderId: string) => Promise<unknown>;
|
||||
create: (orderData: any) => Promise<unknown>;
|
||||
update: (orderId: string, orderData: any) => Promise<unknown>;
|
||||
void: (orderId: string, voidReason?: string) => Promise<unknown>;
|
||||
listChecks: (orderId: string) => Promise<unknown>;
|
||||
addItem: (orderId: string, checkId: string, itemData: any) => Promise<unknown>;
|
||||
removeItem: (orderId: string, checkId: string, selectionId: string) => Promise<unknown>;
|
||||
applyDiscount: (orderId: string, checkId: string, discountData: any) => Promise<unknown>;
|
||||
};
|
||||
menus: {
|
||||
list: () => Promise<unknown>;
|
||||
get: (menuId: string) => Promise<unknown>;
|
||||
listGroups: (menuId: string) => Promise<unknown>;
|
||||
getGroup: (menuId: string, groupId: string) => Promise<unknown>;
|
||||
listItems: (menuId: string, groupId?: string) => Promise<unknown>;
|
||||
getItem: (menuId: string, itemId: string) => Promise<unknown>;
|
||||
listModifiers: (menuId: string, itemId: string) => Promise<unknown>;
|
||||
updatePrice: (menuId: string, itemId: string, price: number) => Promise<unknown>;
|
||||
};
|
||||
employees: {
|
||||
list: (pagination?: PaginationParams) => Promise<PaginatedResponse<unknown>>;
|
||||
get: (employeeId: string) => Promise<unknown>;
|
||||
create: (employeeData: any) => Promise<unknown>;
|
||||
update: (employeeId: string, employeeData: any) => Promise<unknown>;
|
||||
delete: (employeeId: string) => Promise<unknown>;
|
||||
listJobs: (employeeId: string) => Promise<unknown>;
|
||||
listShifts: (employeeId: string, startDate: string, endDate: string) => Promise<unknown>;
|
||||
clockIn: (employeeId: string, jobId: string) => Promise<unknown>;
|
||||
clockOut: (employeeId: string, timeEntryId: string) => Promise<unknown>;
|
||||
listTimeEntries: (employeeId: string, startDate: string, endDate: string) => Promise<unknown>;
|
||||
};
|
||||
labor: {
|
||||
listShifts: (startDate: string, endDate: string, pagination?: PaginationParams) => Promise<PaginatedResponse<unknown>>;
|
||||
getShift: (shiftId: string) => Promise<unknown>;
|
||||
listBreaks: (shiftId: string) => Promise<unknown>;
|
||||
getLaborCost: (businessDate: string) => Promise<unknown>;
|
||||
listJobs: () => Promise<unknown>;
|
||||
};
|
||||
restaurant: {
|
||||
getInfo: () => Promise<unknown>;
|
||||
listRevenueCenters: () => Promise<unknown>;
|
||||
listDiningOptions: () => Promise<unknown>;
|
||||
listServiceAreas: () => Promise<unknown>;
|
||||
listTables: (serviceAreaId?: string) => Promise<unknown>;
|
||||
};
|
||||
payments: {
|
||||
list: (startDate: string, endDate: string, pagination?: PaginationParams) => Promise<PaginatedResponse<unknown>>;
|
||||
get: (paymentId: string) => Promise<unknown>;
|
||||
void: (paymentId: string, voidReason?: string) => Promise<unknown>;
|
||||
refund: (paymentId: string, refundAmount: number, refundReason?: string) => Promise<unknown>;
|
||||
listTips: (startDate: string, endDate: string) => Promise<unknown>;
|
||||
};
|
||||
inventory: {
|
||||
listItems: (pagination?: PaginationParams) => Promise<PaginatedResponse<unknown>>;
|
||||
getItem: (itemId: string) => Promise<unknown>;
|
||||
updateCount: (itemId: string, quantity: number) => Promise<unknown>;
|
||||
listVendors: () => Promise<unknown>;
|
||||
createPurchaseOrder: (poData: any) => Promise<unknown>;
|
||||
};
|
||||
customers: {
|
||||
list: (pagination?: PaginationParams) => Promise<PaginatedResponse<unknown>>;
|
||||
get: (customerId: string) => Promise<unknown>;
|
||||
create: (customerData: any) => Promise<unknown>;
|
||||
update: (customerId: string, customerData: any) => Promise<unknown>;
|
||||
listLoyalty: (customerId: string) => Promise<unknown>;
|
||||
addLoyaltyPoints: (customerId: string, points: number) => Promise<unknown>;
|
||||
};
|
||||
cash: {
|
||||
listEntries: (startDate: string, endDate: string, pagination?: PaginationParams) => Promise<PaginatedResponse<unknown>>;
|
||||
getDrawerStatus: (drawerId: string) => Promise<unknown>;
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=api-client.d.ts.map
|
||||
1
servers/toast/dist/api-client.d.ts.map
vendored
Normal file
1
servers/toast/dist/api-client.d.ts.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA,OAAc,EAA6B,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEzF,qBAAa,aAAc,SAAQ,KAAK;IAG7B,UAAU,CAAC,EAAE,MAAM;IACnB,QAAQ,CAAC,EAAE,GAAG;gBAFrB,OAAO,EAAE,MAAM,EACR,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,QAAQ,CAAC,EAAE,GAAG,YAAA;CAKxB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,MAAM,CAAc;gBAEhB,MAAM,EAAE,WAAW;IAqCzB,GAAG,CAAC,CAAC,EACT,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC5B,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,CAAC,CAAC;IASP,IAAI,CAAC,CAAC,EACV,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,GAAG,EACV,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,CAAC,CAAC;IAMP,GAAG,CAAC,CAAC,EACT,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,GAAG,EACV,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,CAAC,CAAC;IAMP,KA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AgB,GAAG;6BAGzB,MAAM;+BAGJ,MAAM;iCAGJ,MAAM,aAAa,MAAM,WAAW,MAAM;8BAG7C,MAAM,SAAS,MAAM;+BAMpB,MAAM,eAAe,MAAM;sCAKpB,MAAM,aAAa,MAAM,WAAW,MAAM;MAExE;IAGF,KAAK;gCACqB,MAAM,WAAW,MAAM,eAAe,gBAAgB;4BAG1D,MAAM;8BAGJ,MAAM;qCAGC,MAAM;;MAKnC;IAGF,UAAU;;;;;qCAaqB,MAAM;MAInC;IAGF,QAAQ;0BACY,MAAM,WAAW,MAAM,eAAe,gBAAgB;yBAGvD,MAAM;0BAGL,MAAM,eAAe,MAAM;4BAGzB,MAAM,gBAAgB,MAAM,iBAAiB,MAAM;8BAMjD,MAAM,WAAW,MAAM;MAE7C;IAGF,SAAS;iCACkB,gBAAgB;0BAGvB,MAAM;8BAGF,MAAM,YAAY,MAAM;;sCAMhB,GAAG;MAEjC;IAGF,SAAS;4BACa,gBAAgB;0BAGlB,MAAM;+BAGD,GAAG;6BAGL,MAAM,gBAAgB,GAAG;kCAGpB,MAAM;uCAGD,MAAM,UAAU,MAAM;MAErD;IAGF,IAAI;iCACuB,MAAM,WAAW,MAAM,eAAe,gBAAgB;oCAGnD,MAAM;MAElC;CACH"}
|
||||
201
servers/toast/dist/api-client.js
vendored
Normal file
201
servers/toast/dist/api-client.js
vendored
Normal file
@ -0,0 +1,201 @@
|
||||
import axios from 'axios';
|
||||
export class ToastAPIError extends Error {
|
||||
statusCode;
|
||||
response;
|
||||
constructor(message, statusCode, response) {
|
||||
super(message);
|
||||
this.statusCode = statusCode;
|
||||
this.response = response;
|
||||
this.name = 'ToastAPIError';
|
||||
}
|
||||
}
|
||||
export class ToastAPIClient {
|
||||
client;
|
||||
config;
|
||||
constructor(config) {
|
||||
this.config = {
|
||||
baseUrl: config.baseUrl || 'https://ws-api.toasttab.com',
|
||||
...config,
|
||||
};
|
||||
this.client = axios.create({
|
||||
baseURL: this.config.baseUrl,
|
||||
headers: {
|
||||
'Authorization': `Bearer ${this.config.apiToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
'Toast-Restaurant-External-ID': this.config.restaurantGuid,
|
||||
},
|
||||
timeout: 30000,
|
||||
});
|
||||
// Response interceptor for error handling
|
||||
this.client.interceptors.response.use((response) => response, (error) => {
|
||||
if (error.response) {
|
||||
const errorData = error.response.data;
|
||||
throw new ToastAPIError(errorData?.message || error.message, error.response.status, error.response.data);
|
||||
}
|
||||
else if (error.request) {
|
||||
throw new ToastAPIError('No response received from Toast API');
|
||||
}
|
||||
else {
|
||||
throw new ToastAPIError(error.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Generic GET request with pagination support
|
||||
async get(endpoint, params, config) {
|
||||
const response = await this.client.get(endpoint, {
|
||||
params,
|
||||
...config,
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
// Generic POST request
|
||||
async post(endpoint, data, config) {
|
||||
const response = await this.client.post(endpoint, data, config);
|
||||
return response.data;
|
||||
}
|
||||
// Generic PUT request
|
||||
async put(endpoint, data, config) {
|
||||
const response = await this.client.put(endpoint, data, config);
|
||||
return response.data;
|
||||
}
|
||||
// Generic PATCH request
|
||||
async patch(endpoint, data, config) {
|
||||
const response = await this.client.patch(endpoint, data, config);
|
||||
return response.data;
|
||||
}
|
||||
// Generic DELETE request
|
||||
async delete(endpoint, config) {
|
||||
const response = await this.client.delete(endpoint, config);
|
||||
return response.data;
|
||||
}
|
||||
// Paginated GET request
|
||||
async getPaginated(endpoint, pagination, additionalParams) {
|
||||
const params = {
|
||||
page: pagination?.page || 1,
|
||||
pageSize: pagination?.pageSize || 100,
|
||||
...additionalParams,
|
||||
};
|
||||
const response = await this.get(endpoint, params);
|
||||
// If the API returns pagination metadata, use it
|
||||
// Otherwise, create a simple paginated response
|
||||
return {
|
||||
data: Array.isArray(response) ? response : [],
|
||||
page: params.page,
|
||||
pageSize: params.pageSize,
|
||||
totalPages: 1,
|
||||
totalCount: Array.isArray(response) ? response.length : 0,
|
||||
};
|
||||
}
|
||||
// Get all pages automatically
|
||||
async getAllPages(endpoint, pageSize = 100, additionalParams) {
|
||||
const allData = [];
|
||||
let page = 1;
|
||||
let hasMore = true;
|
||||
while (hasMore) {
|
||||
const response = await this.getPaginated(endpoint, { page, pageSize }, additionalParams);
|
||||
allData.push(...response.data);
|
||||
// Check if there are more pages
|
||||
hasMore = response.data.length === pageSize && page < response.totalPages;
|
||||
page++;
|
||||
}
|
||||
return allData;
|
||||
}
|
||||
// Orders API
|
||||
orders = {
|
||||
list: (params) => this.getPaginated('/orders/v2/orders', params?.pagination, {
|
||||
startDate: params?.startDate,
|
||||
endDate: params?.endDate,
|
||||
}),
|
||||
get: (orderId) => this.get(`/orders/v2/orders/${orderId}`),
|
||||
create: (orderData) => this.post('/orders/v2/orders', orderData),
|
||||
update: (orderId, orderData) => this.put(`/orders/v2/orders/${orderId}`, orderData),
|
||||
void: (orderId, voidReason) => this.post(`/orders/v2/orders/${orderId}/void`, { voidReason }),
|
||||
listChecks: (orderId) => this.get(`/orders/v2/orders/${orderId}/checks`),
|
||||
addItem: (orderId, checkId, itemData) => this.post(`/orders/v2/orders/${orderId}/checks/${checkId}/selections`, itemData),
|
||||
removeItem: (orderId, checkId, selectionId) => this.delete(`/orders/v2/orders/${orderId}/checks/${checkId}/selections/${selectionId}`),
|
||||
applyDiscount: (orderId, checkId, discountData) => this.post(`/orders/v2/orders/${orderId}/checks/${checkId}/appliedDiscounts`, discountData),
|
||||
};
|
||||
// Menus API
|
||||
menus = {
|
||||
list: () => this.get('/menus/v2/menus'),
|
||||
get: (menuId) => this.get(`/menus/v2/menus/${menuId}`),
|
||||
listGroups: (menuId) => this.get(`/menus/v2/menus/${menuId}/groups`),
|
||||
getGroup: (menuId, groupId) => this.get(`/menus/v2/menus/${menuId}/groups/${groupId}`),
|
||||
listItems: (menuId, groupId) => groupId
|
||||
? this.get(`/menus/v2/menus/${menuId}/groups/${groupId}/items`)
|
||||
: this.get(`/menus/v2/menus/${menuId}/items`),
|
||||
getItem: (menuId, itemId) => this.get(`/menus/v2/menus/${menuId}/items/${itemId}`),
|
||||
listModifiers: (menuId, itemId) => this.get(`/menus/v2/menus/${menuId}/items/${itemId}/modifierGroups`),
|
||||
updatePrice: (menuId, itemId, price) => this.patch(`/menus/v2/menus/${menuId}/items/${itemId}`, { price }),
|
||||
};
|
||||
// Employees API
|
||||
employees = {
|
||||
list: (pagination) => this.getPaginated('/labor/v1/employees', pagination),
|
||||
get: (employeeId) => this.get(`/labor/v1/employees/${employeeId}`),
|
||||
create: (employeeData) => this.post('/labor/v1/employees', employeeData),
|
||||
update: (employeeId, employeeData) => this.put(`/labor/v1/employees/${employeeId}`, employeeData),
|
||||
delete: (employeeId) => this.delete(`/labor/v1/employees/${employeeId}`),
|
||||
listJobs: (employeeId) => this.get(`/labor/v1/employees/${employeeId}/jobs`),
|
||||
listShifts: (employeeId, startDate, endDate) => this.get(`/labor/v1/employees/${employeeId}/shifts`, { startDate, endDate }),
|
||||
clockIn: (employeeId, jobId) => this.post(`/labor/v1/employees/${employeeId}/timeEntries`, {
|
||||
jobGuid: jobId,
|
||||
inDate: new Date().toISOString(),
|
||||
}),
|
||||
clockOut: (employeeId, timeEntryId) => this.patch(`/labor/v1/employees/${employeeId}/timeEntries/${timeEntryId}`, {
|
||||
outDate: new Date().toISOString(),
|
||||
}),
|
||||
listTimeEntries: (employeeId, startDate, endDate) => this.get(`/labor/v1/employees/${employeeId}/timeEntries`, { startDate, endDate }),
|
||||
};
|
||||
// Labor API
|
||||
labor = {
|
||||
listShifts: (startDate, endDate, pagination) => this.getPaginated('/labor/v1/shifts', pagination, { startDate, endDate }),
|
||||
getShift: (shiftId) => this.get(`/labor/v1/shifts/${shiftId}`),
|
||||
listBreaks: (shiftId) => this.get(`/labor/v1/shifts/${shiftId}/breaks`),
|
||||
getLaborCost: (businessDate) => this.get('/labor/v1/laborCost', { businessDate }),
|
||||
listJobs: () => this.get('/labor/v1/jobs'),
|
||||
};
|
||||
// Restaurant API
|
||||
restaurant = {
|
||||
getInfo: () => this.get('/restaurants/v1/restaurants/' + this.config.restaurantGuid),
|
||||
listRevenueCenters: () => this.get('/restaurants/v1/restaurants/' + this.config.restaurantGuid + '/revenueCenters'),
|
||||
listDiningOptions: () => this.get('/restaurants/v1/restaurants/' + this.config.restaurantGuid + '/diningOptions'),
|
||||
listServiceAreas: () => this.get('/restaurants/v1/restaurants/' + this.config.restaurantGuid + '/serviceAreas'),
|
||||
listTables: (serviceAreaId) => serviceAreaId
|
||||
? this.get(`/restaurants/v1/restaurants/${this.config.restaurantGuid}/serviceAreas/${serviceAreaId}/tables`)
|
||||
: this.get(`/restaurants/v1/restaurants/${this.config.restaurantGuid}/tables`),
|
||||
};
|
||||
// Payments API
|
||||
payments = {
|
||||
list: (startDate, endDate, pagination) => this.getPaginated('/payments/v1/payments', pagination, { startDate, endDate }),
|
||||
get: (paymentId) => this.get(`/payments/v1/payments/${paymentId}`),
|
||||
void: (paymentId, voidReason) => this.post(`/payments/v1/payments/${paymentId}/void`, { voidReason }),
|
||||
refund: (paymentId, refundAmount, refundReason) => this.post(`/payments/v1/payments/${paymentId}/refund`, {
|
||||
refundAmount,
|
||||
refundReason,
|
||||
}),
|
||||
listTips: (startDate, endDate) => this.get('/payments/v1/tips', { startDate, endDate }),
|
||||
};
|
||||
// Inventory API (Note: Toast may not have full inventory API, these are examples)
|
||||
inventory = {
|
||||
listItems: (pagination) => this.getPaginated('/inventory/v1/items', pagination),
|
||||
getItem: (itemId) => this.get(`/inventory/v1/items/${itemId}`),
|
||||
updateCount: (itemId, quantity) => this.patch(`/inventory/v1/items/${itemId}`, { currentQuantity: quantity }),
|
||||
listVendors: () => this.get('/inventory/v1/vendors'),
|
||||
createPurchaseOrder: (poData) => this.post('/inventory/v1/purchaseOrders', poData),
|
||||
};
|
||||
// Customers API (Note: Toast may not have full customer API, these are examples)
|
||||
customers = {
|
||||
list: (pagination) => this.getPaginated('/customers/v1/customers', pagination),
|
||||
get: (customerId) => this.get(`/customers/v1/customers/${customerId}`),
|
||||
create: (customerData) => this.post('/customers/v1/customers', customerData),
|
||||
update: (customerId, customerData) => this.put(`/customers/v1/customers/${customerId}`, customerData),
|
||||
listLoyalty: (customerId) => this.get(`/customers/v1/customers/${customerId}/loyalty`),
|
||||
addLoyaltyPoints: (customerId, points) => this.post(`/customers/v1/customers/${customerId}/loyalty/points`, { points }),
|
||||
};
|
||||
// Cash Management API
|
||||
cash = {
|
||||
listEntries: (startDate, endDate, pagination) => this.getPaginated('/cash/v1/entries', pagination, { startDate, endDate }),
|
||||
getDrawerStatus: (drawerId) => this.get(`/cash/v1/drawers/${drawerId}`),
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=api-client.js.map
|
||||
1
servers/toast/dist/api-client.js.map
vendored
Normal file
1
servers/toast/dist/api-client.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
123
servers/toast/dist/apps/index.d.ts
vendored
Normal file
123
servers/toast/dist/apps/index.d.ts
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
export declare const apps: ({
|
||||
name: string;
|
||||
description: string;
|
||||
version: string;
|
||||
ui: {
|
||||
type: string;
|
||||
layout: string;
|
||||
sections: ({
|
||||
id: string;
|
||||
title: string;
|
||||
type: string;
|
||||
dataSource: string;
|
||||
} | {
|
||||
id: string;
|
||||
title: string;
|
||||
type: string;
|
||||
dataSource?: undefined;
|
||||
})[];
|
||||
features?: undefined;
|
||||
columns?: undefined;
|
||||
filters?: undefined;
|
||||
actions?: undefined;
|
||||
views?: undefined;
|
||||
dataSource?: undefined;
|
||||
statusColors?: undefined;
|
||||
};
|
||||
} | {
|
||||
name: string;
|
||||
description: string;
|
||||
version: string;
|
||||
ui: {
|
||||
type: string;
|
||||
sections: ({
|
||||
id: string;
|
||||
title: string;
|
||||
type: string;
|
||||
dataSource?: undefined;
|
||||
} | {
|
||||
id: string;
|
||||
title: string;
|
||||
type: string;
|
||||
dataSource: string;
|
||||
})[];
|
||||
layout?: undefined;
|
||||
features?: undefined;
|
||||
columns?: undefined;
|
||||
filters?: undefined;
|
||||
actions?: undefined;
|
||||
views?: undefined;
|
||||
dataSource?: undefined;
|
||||
statusColors?: undefined;
|
||||
};
|
||||
} | {
|
||||
name: string;
|
||||
description: string;
|
||||
version: string;
|
||||
ui: {
|
||||
type: string;
|
||||
features: string[];
|
||||
columns: string[];
|
||||
filters: string[];
|
||||
actions: string[];
|
||||
layout?: undefined;
|
||||
sections?: undefined;
|
||||
views?: undefined;
|
||||
dataSource?: undefined;
|
||||
statusColors?: undefined;
|
||||
};
|
||||
} | {
|
||||
name: string;
|
||||
description: string;
|
||||
version: string;
|
||||
ui: {
|
||||
type: string;
|
||||
views: string[];
|
||||
features: string[];
|
||||
dataSource: string;
|
||||
layout?: undefined;
|
||||
sections?: undefined;
|
||||
columns?: undefined;
|
||||
filters?: undefined;
|
||||
actions?: undefined;
|
||||
statusColors?: undefined;
|
||||
};
|
||||
} | {
|
||||
name: string;
|
||||
description: string;
|
||||
version: string;
|
||||
ui: {
|
||||
type: string;
|
||||
features: string[];
|
||||
dataSource: string;
|
||||
statusColors: {
|
||||
available: string;
|
||||
occupied: string;
|
||||
reserved: string;
|
||||
cleaning: string;
|
||||
};
|
||||
layout?: undefined;
|
||||
sections?: undefined;
|
||||
columns?: undefined;
|
||||
filters?: undefined;
|
||||
actions?: undefined;
|
||||
views?: undefined;
|
||||
};
|
||||
} | {
|
||||
name: string;
|
||||
description: string;
|
||||
version: string;
|
||||
ui: {
|
||||
type: string;
|
||||
features: string[];
|
||||
columns: string[];
|
||||
filters: string[];
|
||||
dataSource: string;
|
||||
layout?: undefined;
|
||||
sections?: undefined;
|
||||
actions?: undefined;
|
||||
views?: undefined;
|
||||
statusColors?: undefined;
|
||||
};
|
||||
})[];
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
servers/toast/dist/apps/index.d.ts.map
vendored
Normal file
1
servers/toast/dist/apps/index.d.ts.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apps/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6PhB,CAAC"}
|
||||
256
servers/toast/dist/apps/index.js
vendored
Normal file
256
servers/toast/dist/apps/index.js
vendored
Normal file
@ -0,0 +1,256 @@
|
||||
// MCP Apps for Toast Server
|
||||
export const apps = [
|
||||
{
|
||||
name: 'order-dashboard',
|
||||
description: 'Real-time order dashboard showing active orders, status, and timeline',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'dashboard',
|
||||
layout: 'grid',
|
||||
sections: [
|
||||
{ id: 'active-orders', title: 'Active Orders', type: 'list', dataSource: 'toast_list_orders' },
|
||||
{ id: 'order-stats', title: 'Order Statistics', type: 'metrics' },
|
||||
{ id: 'recent-activity', title: 'Recent Activity', type: 'timeline' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'order-detail',
|
||||
description: 'Detailed order view with items, payments, and modification history',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'detail',
|
||||
sections: [
|
||||
{ id: 'order-info', title: 'Order Information', type: 'info-panel' },
|
||||
{ id: 'order-items', title: 'Order Items', type: 'table', dataSource: 'toast_list_order_checks' },
|
||||
{ id: 'order-payments', title: 'Payments', type: 'table' },
|
||||
{ id: 'order-actions', title: 'Actions', type: 'action-panel' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'order-grid',
|
||||
description: 'Searchable grid view of all orders with filters and bulk actions',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'grid',
|
||||
features: ['search', 'filter', 'sort', 'export', 'bulk-actions'],
|
||||
columns: ['orderNumber', 'date', 'customer', 'total', 'status', 'server'],
|
||||
filters: ['dateRange', 'status', 'diningOption', 'server'],
|
||||
actions: ['view', 'edit', 'void', 'print'],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'menu-manager',
|
||||
description: 'Menu management interface for viewing and editing menus, groups, and items',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'tree-view',
|
||||
sections: [
|
||||
{ id: 'menu-tree', title: 'Menu Structure', type: 'hierarchical-tree' },
|
||||
{ id: 'item-editor', title: 'Item Editor', type: 'form' },
|
||||
{ id: 'price-manager', title: 'Price Management', type: 'batch-editor' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'menu-item-detail',
|
||||
description: 'Detailed menu item view with pricing, modifiers, sales data, and images',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'detail',
|
||||
sections: [
|
||||
{ id: 'item-info', title: 'Item Information', type: 'info-panel' },
|
||||
{ id: 'item-pricing', title: 'Pricing & Cost', type: 'pricing-panel' },
|
||||
{ id: 'item-modifiers', title: 'Modifiers', type: 'table', dataSource: 'toast_list_item_modifiers' },
|
||||
{ id: 'item-performance', title: 'Sales Performance', type: 'chart' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'employee-dashboard',
|
||||
description: 'Employee management dashboard with roster, schedules, and performance',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'dashboard',
|
||||
layout: 'grid',
|
||||
sections: [
|
||||
{ id: 'employee-list', title: 'Employees', type: 'list', dataSource: 'toast_list_employees' },
|
||||
{ id: 'employee-stats', title: 'Statistics', type: 'metrics' },
|
||||
{ id: 'clock-status', title: 'Clock Status', type: 'status-board' },
|
||||
{ id: 'employee-actions', title: 'Quick Actions', type: 'action-panel' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'employee-schedule',
|
||||
description: 'Weekly/monthly schedule view with shift planning and time-off management',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'calendar',
|
||||
views: ['week', 'month'],
|
||||
features: ['drag-drop', 'shift-swap', 'time-off-requests'],
|
||||
dataSource: 'toast_list_shifts',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'labor-dashboard',
|
||||
description: 'Labor cost and productivity dashboard with real-time metrics',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'dashboard',
|
||||
layout: 'grid',
|
||||
sections: [
|
||||
{ id: 'labor-cost', title: 'Labor Cost', type: 'metrics', dataSource: 'toast_get_labor_cost' },
|
||||
{ id: 'hours-breakdown', title: 'Hours Breakdown', type: 'chart' },
|
||||
{ id: 'overtime-tracker', title: 'Overtime', type: 'alert-panel' },
|
||||
{ id: 'productivity', title: 'Productivity Metrics', type: 'scorecard' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'restaurant-overview',
|
||||
description: 'Restaurant configuration overview with settings and operational status',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'overview',
|
||||
sections: [
|
||||
{ id: 'restaurant-info', title: 'Restaurant Info', type: 'info-panel', dataSource: 'toast_get_restaurant_info' },
|
||||
{ id: 'revenue-centers', title: 'Revenue Centers', type: 'list', dataSource: 'toast_list_revenue_centers' },
|
||||
{ id: 'dining-options', title: 'Dining Options', type: 'list', dataSource: 'toast_list_dining_options' },
|
||||
{ id: 'service-areas', title: 'Service Areas', type: 'list', dataSource: 'toast_list_service_areas' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'table-map',
|
||||
description: 'Interactive floor plan showing table status, occupancy, and server assignments',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'floor-plan',
|
||||
features: ['interactive', 'real-time-status', 'drag-drop-assignment'],
|
||||
dataSource: 'toast_list_tables',
|
||||
statusColors: {
|
||||
available: 'green',
|
||||
occupied: 'red',
|
||||
reserved: 'yellow',
|
||||
cleaning: 'blue',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'payment-history',
|
||||
description: 'Payment transaction history with search, filters, and export',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'grid',
|
||||
features: ['search', 'filter', 'sort', 'export'],
|
||||
columns: ['date', 'orderId', 'paymentType', 'amount', 'tip', 'status'],
|
||||
filters: ['dateRange', 'paymentType', 'status', 'server'],
|
||||
dataSource: 'toast_list_payments',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'inventory-tracker',
|
||||
description: 'Inventory tracking with stock levels, alerts, and purchase order management',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'dashboard',
|
||||
layout: 'grid',
|
||||
sections: [
|
||||
{ id: 'inventory-list', title: 'Inventory Items', type: 'table', dataSource: 'toast_list_inventory_items' },
|
||||
{ id: 'low-stock-alerts', title: 'Low Stock Alerts', type: 'alert-panel' },
|
||||
{ id: 'purchase-orders', title: 'Purchase Orders', type: 'list' },
|
||||
{ id: 'inventory-actions', title: 'Actions', type: 'action-panel' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'customer-detail',
|
||||
description: 'Customer profile with order history, preferences, and contact information',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'detail',
|
||||
sections: [
|
||||
{ id: 'customer-info', title: 'Customer Information', type: 'info-panel' },
|
||||
{ id: 'order-history', title: 'Order History', type: 'table' },
|
||||
{ id: 'customer-stats', title: 'Customer Statistics', type: 'metrics' },
|
||||
{ id: 'customer-actions', title: 'Actions', type: 'action-panel' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'customer-loyalty',
|
||||
description: 'Loyalty program dashboard with points, rewards, and tier status',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'dashboard',
|
||||
layout: 'grid',
|
||||
sections: [
|
||||
{ id: 'loyalty-overview', title: 'Loyalty Overview', type: 'metrics' },
|
||||
{ id: 'points-history', title: 'Points History', type: 'timeline' },
|
||||
{ id: 'rewards-available', title: 'Available Rewards', type: 'card-grid' },
|
||||
{ id: 'tier-progress', title: 'Tier Progress', type: 'progress-bar' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'sales-dashboard',
|
||||
description: 'Comprehensive sales analytics with charts, trends, and comparisons',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'dashboard',
|
||||
layout: 'grid',
|
||||
sections: [
|
||||
{ id: 'sales-overview', title: 'Sales Overview', type: 'metrics', dataSource: 'toast_sales_summary' },
|
||||
{ id: 'sales-chart', title: 'Sales Trend', type: 'line-chart' },
|
||||
{ id: 'category-breakdown', title: 'Sales by Category', type: 'pie-chart' },
|
||||
{ id: 'payment-types', title: 'Payment Methods', type: 'bar-chart' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'menu-performance',
|
||||
description: 'Menu item performance analytics with best/worst sellers and profitability',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'analytics',
|
||||
sections: [
|
||||
{ id: 'top-items', title: 'Top Selling Items', type: 'ranked-list', dataSource: 'toast_menu_item_performance' },
|
||||
{ id: 'item-trends', title: 'Item Sales Trends', type: 'multi-line-chart' },
|
||||
{ id: 'profitability', title: 'Profitability Analysis', type: 'table' },
|
||||
{ id: 'recommendations', title: 'Recommendations', type: 'insight-panel' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'tip-summary',
|
||||
description: 'Tip tracking and distribution dashboard with employee breakdown',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'dashboard',
|
||||
layout: 'grid',
|
||||
sections: [
|
||||
{ id: 'tip-overview', title: 'Tip Overview', type: 'metrics', dataSource: 'toast_tip_summary' },
|
||||
{ id: 'tip-by-employee', title: 'Tips by Employee', type: 'table' },
|
||||
{ id: 'tip-trends', title: 'Tip Trends', type: 'line-chart' },
|
||||
{ id: 'tip-percentage', title: 'Average Tip %', type: 'gauge' },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'revenue-by-hour',
|
||||
description: 'Hourly revenue breakdown showing peak times and patterns',
|
||||
version: '1.0.0',
|
||||
ui: {
|
||||
type: 'analytics',
|
||||
sections: [
|
||||
{ id: 'hourly-chart', title: 'Revenue by Hour', type: 'bar-chart', dataSource: 'toast_revenue_by_hour' },
|
||||
{ id: 'peak-times', title: 'Peak Times', type: 'highlight-panel' },
|
||||
{ id: 'day-comparison', title: 'Day-over-Day Comparison', type: 'comparison-chart' },
|
||||
{ id: 'hourly-metrics', title: 'Hourly Metrics', type: 'table' },
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
servers/toast/dist/apps/index.js.map
vendored
Normal file
1
servers/toast/dist/apps/index.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
3
servers/toast/dist/main.d.ts
vendored
Normal file
3
servers/toast/dist/main.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env node
|
||||
export {};
|
||||
//# sourceMappingURL=main.d.ts.map
|
||||
1
servers/toast/dist/main.d.ts.map
vendored
Normal file
1
servers/toast/dist/main.d.ts.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":""}
|
||||
14
servers/toast/dist/main.js
vendored
Normal file
14
servers/toast/dist/main.js
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env node
|
||||
import { ToastMCPServer } from './server.js';
|
||||
async function main() {
|
||||
try {
|
||||
const server = new ToastMCPServer();
|
||||
await server.start();
|
||||
}
|
||||
catch (error) {
|
||||
console.error('Failed to start Toast MCP Server:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
main();
|
||||
//# sourceMappingURL=main.js.map
|
||||
1
servers/toast/dist/main.js.map
vendored
Normal file
1
servers/toast/dist/main.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;QACpC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;QAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
||||
9
servers/toast/dist/server.d.ts
vendored
Normal file
9
servers/toast/dist/server.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
export declare class ToastMCPServer {
|
||||
private server;
|
||||
private client;
|
||||
private tools;
|
||||
constructor();
|
||||
private setupHandlers;
|
||||
start(): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=server.d.ts.map
|
||||
1
servers/toast/dist/server.d.ts.map
vendored
Normal file
1
servers/toast/dist/server.d.ts.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAqBA,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,KAAK,CAAQ;;IAkDrB,OAAO,CAAC,aAAa;IA0Ef,KAAK;CAKZ"}
|
||||
130
servers/toast/dist/server.js
vendored
Normal file
130
servers/toast/dist/server.js
vendored
Normal file
@ -0,0 +1,130 @@
|
||||
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
||||
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
||||
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
||||
import { ToastAPIClient } from './api-client.js';
|
||||
import { registerOrdersTools } from './tools/orders-tools.js';
|
||||
import { registerMenusTools } from './tools/menus-tools.js';
|
||||
import { registerEmployeesTools } from './tools/employees-tools.js';
|
||||
import { registerLaborTools } from './tools/labor-tools.js';
|
||||
import { registerRestaurantTools } from './tools/restaurant-tools.js';
|
||||
import { registerPaymentsTools } from './tools/payments-tools.js';
|
||||
import { registerInventoryTools } from './tools/inventory-tools.js';
|
||||
import { registerCustomersTools } from './tools/customers-tools.js';
|
||||
import { registerReportingTools } from './tools/reporting-tools.js';
|
||||
import { registerCashTools } from './tools/cash-tools.js';
|
||||
import { apps } from './apps/index.js';
|
||||
export class ToastMCPServer {
|
||||
server;
|
||||
client;
|
||||
tools;
|
||||
constructor() {
|
||||
// Get configuration from environment
|
||||
const apiToken = process.env.TOAST_API_TOKEN;
|
||||
const restaurantGuid = process.env.TOAST_RESTAURANT_GUID;
|
||||
const baseUrl = process.env.TOAST_BASE_URL;
|
||||
if (!apiToken || !restaurantGuid) {
|
||||
throw new Error('TOAST_API_TOKEN and TOAST_RESTAURANT_GUID environment variables are required');
|
||||
}
|
||||
// Initialize Toast API client
|
||||
this.client = new ToastAPIClient({
|
||||
apiToken,
|
||||
restaurantGuid,
|
||||
baseUrl,
|
||||
});
|
||||
// Initialize MCP server
|
||||
this.server = new Server({
|
||||
name: 'toast-mcp-server',
|
||||
version: '1.0.0',
|
||||
}, {
|
||||
capabilities: {
|
||||
tools: {},
|
||||
resources: {},
|
||||
},
|
||||
});
|
||||
// Register all tools
|
||||
this.tools = [
|
||||
...registerOrdersTools(this.client),
|
||||
...registerMenusTools(this.client),
|
||||
...registerEmployeesTools(this.client),
|
||||
...registerLaborTools(this.client),
|
||||
...registerRestaurantTools(this.client),
|
||||
...registerPaymentsTools(this.client),
|
||||
...registerInventoryTools(this.client),
|
||||
...registerCustomersTools(this.client),
|
||||
...registerReportingTools(this.client),
|
||||
...registerCashTools(this.client),
|
||||
];
|
||||
this.setupHandlers();
|
||||
}
|
||||
setupHandlers() {
|
||||
// List available tools
|
||||
this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
||||
tools: this.tools.map((tool) => ({
|
||||
name: tool.name,
|
||||
description: tool.description,
|
||||
inputSchema: tool.inputSchema,
|
||||
})),
|
||||
}));
|
||||
// Execute tool calls
|
||||
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
const tool = this.tools.find((t) => t.name === request.params.name);
|
||||
if (!tool) {
|
||||
throw new Error(`Tool not found: ${request.params.name}`);
|
||||
}
|
||||
try {
|
||||
return await tool.execute(request.params.arguments);
|
||||
}
|
||||
catch (error) {
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: `Error executing ${request.params.name}: ${error.message}`,
|
||||
},
|
||||
],
|
||||
isError: true,
|
||||
};
|
||||
}
|
||||
});
|
||||
// List resources (MCP apps)
|
||||
this.server.setRequestHandler(ListResourcesRequestSchema, async () => ({
|
||||
resources: apps.map((app) => ({
|
||||
uri: `toast://apps/${app.name}`,
|
||||
name: app.name,
|
||||
description: app.description,
|
||||
mimeType: 'application/json',
|
||||
})),
|
||||
}));
|
||||
// Read resource (get app definition)
|
||||
this.server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
||||
const appName = request.params.uri.replace('toast://apps/', '');
|
||||
const app = apps.find((a) => a.name === appName);
|
||||
if (!app) {
|
||||
throw new Error(`App not found: ${appName}`);
|
||||
}
|
||||
return {
|
||||
contents: [
|
||||
{
|
||||
uri: request.params.uri,
|
||||
mimeType: 'application/json',
|
||||
text: JSON.stringify(app, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
// Error handling
|
||||
this.server.onerror = (error) => {
|
||||
console.error('[MCP Error]', error);
|
||||
};
|
||||
process.on('SIGINT', async () => {
|
||||
await this.server.close();
|
||||
process.exit(0);
|
||||
});
|
||||
}
|
||||
async start() {
|
||||
const transport = new StdioServerTransport();
|
||||
await this.server.connect(transport);
|
||||
console.error('Toast MCP Server running on stdio');
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=server.js.map
|
||||
1
servers/toast/dist/server.js.map
vendored
Normal file
1
servers/toast/dist/server.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,MAAM,OAAO,cAAc;IACjB,MAAM,CAAS;IACf,MAAM,CAAiB;IACvB,KAAK,CAAQ;IAErB;QACE,qCAAqC;QACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;QAC7C,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;QACzD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc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QAC7C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACrD,CAAC;CACF"}
|
||||
45
servers/toast/dist/tools/cash-tools.d.ts
vendored
Normal file
45
servers/toast/dist/tools/cash-tools.d.ts
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
import { z } from 'zod';
|
||||
import type { ToastAPIClient } from '../api-client.js';
|
||||
export declare function registerCashTools(client: ToastAPIClient): ({
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
startDate: z.ZodString;
|
||||
endDate: z.ZodString;
|
||||
page: z.ZodOptional<z.ZodNumber>;
|
||||
pageSize: z.ZodOptional<z.ZodNumber>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
page?: number | undefined;
|
||||
pageSize?: number | undefined;
|
||||
}, {
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
page?: number | undefined;
|
||||
pageSize?: number | undefined;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
} | {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
drawerGuid: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
drawerGuid: string;
|
||||
}, {
|
||||
drawerGuid: string;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
})[];
|
||||
//# sourceMappingURL=cash-tools.d.ts.map
|
||||
1
servers/toast/dist/tools/cash-tools.d.ts.map
vendored
Normal file
1
servers/toast/dist/tools/cash-tools.d.ts.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"cash-tools.d.ts","sourceRoot":"","sources":["../../src/tools/cash-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc;;;;;;;;;;;;;;;;;;;oBAW5B,GAAG;;;;;;;;;;;;;;;;oBAqBH,GAAG;;;;;;KAa9B"}
|
||||
48
servers/toast/dist/tools/cash-tools.js
vendored
Normal file
48
servers/toast/dist/tools/cash-tools.js
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
import { z } from 'zod';
|
||||
export function registerCashTools(client) {
|
||||
return [
|
||||
{
|
||||
name: 'toast_list_cash_entries',
|
||||
description: 'List cash entries (paid in/paid out) for a date range',
|
||||
inputSchema: z.object({
|
||||
startDate: z.string().describe('Start date (ISO 8601 format)'),
|
||||
endDate: z.string().describe('End date (ISO 8601 format)'),
|
||||
page: z.number().optional().describe('Page number (default: 1)'),
|
||||
pageSize: z.number().optional().describe('Items per page (default: 100)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.cash.listEntries(args.startDate, args.endDate, {
|
||||
page: args.page,
|
||||
pageSize: args.pageSize,
|
||||
});
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_get_drawer_status',
|
||||
description: 'Get current status of a cash drawer',
|
||||
inputSchema: z.object({
|
||||
drawerGuid: z.string().describe('Cash drawer GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.cash.getDrawerStatus(args.drawerGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
//# sourceMappingURL=cash-tools.js.map
|
||||
1
servers/toast/dist/tools/cash-tools.js.map
vendored
Normal file
1
servers/toast/dist/tools/cash-tools.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"cash-tools.js","sourceRoot":"","sources":["../../src/tools/cash-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,iBAAiB,CAAC,MAAsB;IACtD,OAAO;QACL;YACE,IAAI,EAAE,yBAAyB;YAC/B,WAAW,EAAE,uDAAuD;YACpE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;gBACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;gBAC9D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;gBAC1D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;gBAChE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;aAC1E,CAAC;YACF,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;gBAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE;oBACzE,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;iBACxB,CAAC,CAAC;gBACH,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBACtC;qBACF;iBACF,CAAC;YACJ,CAAC;SACF;QACD;YACE,IAAI,EAAE,yBAAyB;YAC/B,WAAW,EAAE,qCAAqC;YAClD,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;gBACpB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;aACpD,CAAC;YACF,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;gBAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAClE,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBACtC;qBACF;iBACF,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
||||
67
servers/toast/dist/tools/customers-tools.d.ts
vendored
Normal file
67
servers/toast/dist/tools/customers-tools.d.ts
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
import { z } from 'zod';
|
||||
import type { ToastAPIClient } from '../api-client.js';
|
||||
export declare function registerCustomersTools(client: ToastAPIClient): ({
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
page: z.ZodOptional<z.ZodNumber>;
|
||||
pageSize: z.ZodOptional<z.ZodNumber>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
page?: number | undefined;
|
||||
pageSize?: number | undefined;
|
||||
}, {
|
||||
page?: number | undefined;
|
||||
pageSize?: number | undefined;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
} | {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
customerGuid: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
customerGuid: string;
|
||||
}, {
|
||||
customerGuid: string;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
} | {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
firstName: z.ZodString;
|
||||
lastName: z.ZodString;
|
||||
email: z.ZodOptional<z.ZodString>;
|
||||
phone: z.ZodOptional<z.ZodString>;
|
||||
company: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
email?: string | undefined;
|
||||
phone?: string | undefined;
|
||||
company?: string | undefined;
|
||||
}, {
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
email?: string | undefined;
|
||||
phone?: string | undefined;
|
||||
company?: string | undefined;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
})[];
|
||||
//# sourceMappingURL=customers-tools.d.ts.map
|
||||
1
servers/toast/dist/tools/customers-tools.d.ts.map
vendored
Normal file
1
servers/toast/dist/tools/customers-tools.d.ts.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"customers-tools.d.ts","sourceRoot":"","sources":["../../src/tools/customers-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc;;;;;;;;;;;;;oBASjC,GAAG;;;;;;;;;;;;;;;;oBAqBH,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAsBH,GAAG;;;;;;KAuF9B"}
|
||||
146
servers/toast/dist/tools/customers-tools.js
vendored
Normal file
146
servers/toast/dist/tools/customers-tools.js
vendored
Normal file
@ -0,0 +1,146 @@
|
||||
import { z } from 'zod';
|
||||
export function registerCustomersTools(client) {
|
||||
return [
|
||||
{
|
||||
name: 'toast_list_customers',
|
||||
description: 'List all customers',
|
||||
inputSchema: z.object({
|
||||
page: z.number().optional().describe('Page number (default: 1)'),
|
||||
pageSize: z.number().optional().describe('Items per page (default: 100)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.customers.list({
|
||||
page: args.page,
|
||||
pageSize: args.pageSize,
|
||||
});
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_get_customer',
|
||||
description: 'Get details of a specific customer',
|
||||
inputSchema: z.object({
|
||||
customerGuid: z.string().describe('Customer GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.customers.get(args.customerGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_create_customer',
|
||||
description: 'Create a new customer',
|
||||
inputSchema: z.object({
|
||||
firstName: z.string().describe('First name'),
|
||||
lastName: z.string().describe('Last name'),
|
||||
email: z.string().optional().describe('Email address'),
|
||||
phone: z.string().optional().describe('Phone number'),
|
||||
company: z.string().optional().describe('Company name'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const customerData = {
|
||||
firstName: args.firstName,
|
||||
lastName: args.lastName,
|
||||
...(args.email && { email: args.email }),
|
||||
...(args.phone && { phone: args.phone }),
|
||||
...(args.company && { company: args.company }),
|
||||
};
|
||||
const result = await client.customers.create(customerData);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_update_customer',
|
||||
description: 'Update an existing customer',
|
||||
inputSchema: z.object({
|
||||
customerGuid: z.string().describe('Customer GUID'),
|
||||
firstName: z.string().optional().describe('First name'),
|
||||
lastName: z.string().optional().describe('Last name'),
|
||||
email: z.string().optional().describe('Email address'),
|
||||
phone: z.string().optional().describe('Phone number'),
|
||||
company: z.string().optional().describe('Company name'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const updateData = {};
|
||||
if (args.firstName)
|
||||
updateData.firstName = args.firstName;
|
||||
if (args.lastName)
|
||||
updateData.lastName = args.lastName;
|
||||
if (args.email)
|
||||
updateData.email = args.email;
|
||||
if (args.phone)
|
||||
updateData.phone = args.phone;
|
||||
if (args.company)
|
||||
updateData.company = args.company;
|
||||
const result = await client.customers.update(args.customerGuid, updateData);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_customer_loyalty',
|
||||
description: 'List loyalty information for a customer',
|
||||
inputSchema: z.object({
|
||||
customerGuid: z.string().describe('Customer GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.customers.listLoyalty(args.customerGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_add_loyalty_points',
|
||||
description: 'Add loyalty points to a customer account',
|
||||
inputSchema: z.object({
|
||||
customerGuid: z.string().describe('Customer GUID'),
|
||||
points: z.number().describe('Points to add'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.customers.addLoyaltyPoints(args.customerGuid, args.points);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
//# sourceMappingURL=customers-tools.js.map
|
||||
1
servers/toast/dist/tools/customers-tools.js.map
vendored
Normal file
1
servers/toast/dist/tools/customers-tools.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{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AS,EAAE,EAAE;gBAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;gBACvF,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBACtC;qBACF;iBACF,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
||||
73
servers/toast/dist/tools/employees-tools.d.ts
vendored
Normal file
73
servers/toast/dist/tools/employees-tools.d.ts
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
import { z } from 'zod';
|
||||
import type { ToastAPIClient } from '../api-client.js';
|
||||
export declare function registerEmployeesTools(client: ToastAPIClient): ({
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
page: z.ZodOptional<z.ZodNumber>;
|
||||
pageSize: z.ZodOptional<z.ZodNumber>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
page?: number | undefined;
|
||||
pageSize?: number | undefined;
|
||||
}, {
|
||||
page?: number | undefined;
|
||||
pageSize?: number | undefined;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
} | {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
employeeGuid: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
employeeGuid: string;
|
||||
}, {
|
||||
employeeGuid: string;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
} | {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
firstName: z.ZodString;
|
||||
lastName: z.ZodString;
|
||||
email: z.ZodOptional<z.ZodString>;
|
||||
phoneNumber: z.ZodOptional<z.ZodString>;
|
||||
externalEmployeeId: z.ZodOptional<z.ZodString>;
|
||||
chosenName: z.ZodOptional<z.ZodString>;
|
||||
passcode: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
email?: string | undefined;
|
||||
phoneNumber?: string | undefined;
|
||||
externalEmployeeId?: string | undefined;
|
||||
chosenName?: string | undefined;
|
||||
passcode?: string | undefined;
|
||||
}, {
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
email?: string | undefined;
|
||||
phoneNumber?: string | undefined;
|
||||
externalEmployeeId?: string | undefined;
|
||||
chosenName?: string | undefined;
|
||||
passcode?: string | undefined;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
})[];
|
||||
//# sourceMappingURL=employees-tools.d.ts.map
|
||||
1
servers/toast/dist/tools/employees-tools.d.ts.map
vendored
Normal file
1
servers/toast/dist/tools/employees-tools.d.ts.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"employees-tools.d.ts","sourceRoot":"","sources":["../../src/tools/employees-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc;;;;;;;;;;;;;oBASjC,GAAG;;;;;;;;;;;;;;;;oBAqBH,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAwBH,GAAG;;;;;;KAgL9B"}
|
||||
230
servers/toast/dist/tools/employees-tools.js
vendored
Normal file
230
servers/toast/dist/tools/employees-tools.js
vendored
Normal file
@ -0,0 +1,230 @@
|
||||
import { z } from 'zod';
|
||||
export function registerEmployeesTools(client) {
|
||||
return [
|
||||
{
|
||||
name: 'toast_list_employees',
|
||||
description: 'List all employees',
|
||||
inputSchema: z.object({
|
||||
page: z.number().optional().describe('Page number (default: 1)'),
|
||||
pageSize: z.number().optional().describe('Items per page (default: 100)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.employees.list({
|
||||
page: args.page,
|
||||
pageSize: args.pageSize,
|
||||
});
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_get_employee',
|
||||
description: 'Get details of a specific employee',
|
||||
inputSchema: z.object({
|
||||
employeeGuid: z.string().describe('Employee GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.employees.get(args.employeeGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_create_employee',
|
||||
description: 'Create a new employee',
|
||||
inputSchema: z.object({
|
||||
firstName: z.string().describe('First name'),
|
||||
lastName: z.string().describe('Last name'),
|
||||
email: z.string().optional().describe('Email address'),
|
||||
phoneNumber: z.string().optional().describe('Phone number'),
|
||||
externalEmployeeId: z.string().optional().describe('External employee ID'),
|
||||
chosenName: z.string().optional().describe('Chosen/preferred name'),
|
||||
passcode: z.string().optional().describe('Employee passcode'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const employeeData = {
|
||||
firstName: args.firstName,
|
||||
lastName: args.lastName,
|
||||
...(args.email && { email: args.email }),
|
||||
...(args.phoneNumber && { phoneNumber: args.phoneNumber }),
|
||||
...(args.externalEmployeeId && { externalEmployeeId: args.externalEmployeeId }),
|
||||
...(args.chosenName && { chosenName: args.chosenName }),
|
||||
...(args.passcode && { passcode: args.passcode }),
|
||||
};
|
||||
const result = await client.employees.create(employeeData);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_update_employee',
|
||||
description: 'Update an existing employee',
|
||||
inputSchema: z.object({
|
||||
employeeGuid: z.string().describe('Employee GUID'),
|
||||
firstName: z.string().optional().describe('First name'),
|
||||
lastName: z.string().optional().describe('Last name'),
|
||||
email: z.string().optional().describe('Email address'),
|
||||
phoneNumber: z.string().optional().describe('Phone number'),
|
||||
chosenName: z.string().optional().describe('Chosen/preferred name'),
|
||||
disabled: z.boolean().optional().describe('Disabled status'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const updateData = {};
|
||||
if (args.firstName)
|
||||
updateData.firstName = args.firstName;
|
||||
if (args.lastName)
|
||||
updateData.lastName = args.lastName;
|
||||
if (args.email)
|
||||
updateData.email = args.email;
|
||||
if (args.phoneNumber)
|
||||
updateData.phoneNumber = args.phoneNumber;
|
||||
if (args.chosenName)
|
||||
updateData.chosenName = args.chosenName;
|
||||
if (args.disabled !== undefined)
|
||||
updateData.disabled = args.disabled;
|
||||
const result = await client.employees.update(args.employeeGuid, updateData);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_delete_employee',
|
||||
description: 'Delete an employee',
|
||||
inputSchema: z.object({
|
||||
employeeGuid: z.string().describe('Employee GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.employees.delete(args.employeeGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: 'Employee deleted successfully',
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_employee_jobs',
|
||||
description: 'List all jobs for an employee',
|
||||
inputSchema: z.object({
|
||||
employeeGuid: z.string().describe('Employee GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.employees.listJobs(args.employeeGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_employee_shifts',
|
||||
description: 'List shifts for an employee within a date range',
|
||||
inputSchema: z.object({
|
||||
employeeGuid: z.string().describe('Employee GUID'),
|
||||
startDate: z.string().describe('Start date (ISO 8601 format)'),
|
||||
endDate: z.string().describe('End date (ISO 8601 format)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.employees.listShifts(args.employeeGuid, args.startDate, args.endDate);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_clock_in',
|
||||
description: 'Clock in an employee for a job',
|
||||
inputSchema: z.object({
|
||||
employeeGuid: z.string().describe('Employee GUID'),
|
||||
jobGuid: z.string().describe('Job GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.employees.clockIn(args.employeeGuid, args.jobGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_clock_out',
|
||||
description: 'Clock out an employee from a time entry',
|
||||
inputSchema: z.object({
|
||||
employeeGuid: z.string().describe('Employee GUID'),
|
||||
timeEntryGuid: z.string().describe('Time entry GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.employees.clockOut(args.employeeGuid, args.timeEntryGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_time_entries',
|
||||
description: 'List time entries for an employee within a date range',
|
||||
inputSchema: z.object({
|
||||
employeeGuid: z.string().describe('Employee GUID'),
|
||||
startDate: z.string().describe('Start date (ISO 8601 format)'),
|
||||
endDate: z.string().describe('End date (ISO 8601 format)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.employees.listTimeEntries(args.employeeGuid, args.startDate, args.endDate);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
//# sourceMappingURL=employees-tools.js.map
|
||||
1
servers/toast/dist/tools/employees-tools.js.map
vendored
Normal file
1
servers/toast/dist/tools/employees-tools.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
14
servers/toast/dist/tools/inventory-tools.d.ts
vendored
Normal file
14
servers/toast/dist/tools/inventory-tools.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import { z } from 'zod';
|
||||
import type { ToastAPIClient } from '../api-client.js';
|
||||
export declare function registerInventoryTools(client: ToastAPIClient): {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
}[];
|
||||
//# sourceMappingURL=inventory-tools.d.ts.map
|
||||
1
servers/toast/dist/tools/inventory-tools.d.ts.map
vendored
Normal file
1
servers/toast/dist/tools/inventory-tools.d.ts.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"inventory-tools.d.ts","sourceRoot":"","sources":["../../src/tools/inventory-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc;;;;oBAiEjC,GAAG;;;;;;IA+C9B"}
|
||||
115
servers/toast/dist/tools/inventory-tools.js
vendored
Normal file
115
servers/toast/dist/tools/inventory-tools.js
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
import { z } from 'zod';
|
||||
export function registerInventoryTools(client) {
|
||||
return [
|
||||
{
|
||||
name: 'toast_list_inventory_items',
|
||||
description: 'List all inventory items',
|
||||
inputSchema: z.object({
|
||||
page: z.number().optional().describe('Page number (default: 1)'),
|
||||
pageSize: z.number().optional().describe('Items per page (default: 100)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.inventory.listItems({
|
||||
page: args.page,
|
||||
pageSize: args.pageSize,
|
||||
});
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_get_inventory_item',
|
||||
description: 'Get details of a specific inventory item',
|
||||
inputSchema: z.object({
|
||||
itemGuid: z.string().describe('Inventory item GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.inventory.getItem(args.itemGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_update_inventory_count',
|
||||
description: 'Update the current quantity of an inventory item',
|
||||
inputSchema: z.object({
|
||||
itemGuid: z.string().describe('Inventory item GUID'),
|
||||
quantity: z.number().describe('New quantity'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.inventory.updateCount(args.itemGuid, args.quantity);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_vendors',
|
||||
description: 'List all vendors',
|
||||
inputSchema: z.object({}),
|
||||
execute: async (args) => {
|
||||
const result = await client.inventory.listVendors();
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_create_purchase_order',
|
||||
description: 'Create a new purchase order',
|
||||
inputSchema: z.object({
|
||||
vendorGuid: z.string().describe('Vendor GUID'),
|
||||
expectedDeliveryDate: z.string().optional().describe('Expected delivery date (ISO 8601)'),
|
||||
items: z.array(z.object({
|
||||
itemGuid: z.string(),
|
||||
quantity: z.number(),
|
||||
unitCost: z.number(),
|
||||
})).describe('Purchase order items'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const poData = {
|
||||
vendor: { guid: args.vendorGuid },
|
||||
...(args.expectedDeliveryDate && { expectedDeliveryDate: args.expectedDeliveryDate }),
|
||||
items: args.items.map((item) => ({
|
||||
inventoryItem: { guid: item.itemGuid },
|
||||
quantity: item.quantity,
|
||||
unitCost: item.unitCost,
|
||||
totalCost: item.quantity * item.unitCost,
|
||||
})),
|
||||
};
|
||||
const result = await client.inventory.createPurchaseOrder(poData);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
//# sourceMappingURL=inventory-tools.js.map
|
||||
1
servers/toast/dist/tools/inventory-tools.js.map
vendored
Normal file
1
servers/toast/dist/tools/inventory-tools.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"inventory-tools.js","sourceRoot":"","sources":["../../src/tools/inventory-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,sBAAsB,CAAC,MAAsB;IAC3D,OAAO;QACL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al file
14
servers/toast/dist/tools/labor-tools.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import { z } from 'zod';
|
||||
import type { ToastAPIClient } from '../api-client.js';
|
||||
export declare function registerLaborTools(client: ToastAPIClient): {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
}[];
|
||||
//# sourceMappingURL=labor-tools.d.ts.map
|
||||
1
servers/toast/dist/tools/labor-tools.d.ts.map
vendored
Normal file
1
servers/toast/dist/tools/labor-tools.d.ts.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"labor-tools.d.ts","sourceRoot":"","sources":["../../src/tools/labor-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc;;;;oBAoF7B,GAAG;;;;;;IAa9B"}
|
||||
100
servers/toast/dist/tools/labor-tools.js
vendored
Normal file
100
servers/toast/dist/tools/labor-tools.js
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
import { z } from 'zod';
|
||||
export function registerLaborTools(client) {
|
||||
return [
|
||||
{
|
||||
name: 'toast_list_shifts',
|
||||
description: 'List all shifts within a date range',
|
||||
inputSchema: z.object({
|
||||
startDate: z.string().describe('Start date (ISO 8601 format)'),
|
||||
endDate: z.string().describe('End date (ISO 8601 format)'),
|
||||
page: z.number().optional().describe('Page number (default: 1)'),
|
||||
pageSize: z.number().optional().describe('Items per page (default: 100)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.labor.listShifts(args.startDate, args.endDate, {
|
||||
page: args.page,
|
||||
pageSize: args.pageSize,
|
||||
});
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_get_shift',
|
||||
description: 'Get details of a specific shift',
|
||||
inputSchema: z.object({
|
||||
shiftGuid: z.string().describe('Shift GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.labor.getShift(args.shiftGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_shift_breaks',
|
||||
description: 'List all breaks for a specific shift',
|
||||
inputSchema: z.object({
|
||||
shiftGuid: z.string().describe('Shift GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.labor.listBreaks(args.shiftGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_get_labor_cost',
|
||||
description: 'Get labor cost summary for a business date',
|
||||
inputSchema: z.object({
|
||||
businessDate: z.string().describe('Business date (YYYYMMDD format)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.labor.getLaborCost(args.businessDate);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_jobs',
|
||||
description: 'List all available jobs/positions',
|
||||
inputSchema: z.object({}),
|
||||
execute: async (args) => {
|
||||
const result = await client.labor.listJobs();
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
//# sourceMappingURL=labor-tools.js.map
|
||||
1
servers/toast/dist/tools/labor-tools.js.map
vendored
Normal file
1
servers/toast/dist/tools/labor-tools.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"labor-tools.js","sourceRoot":"","sources":["../../src/tools/labor-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,kBAAkB,CAAC,MAAsB;IACvD,OAAO;QACL;YACE,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,qCAAqC;YAClD,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;gBACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;gBAC9D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;gBAC1D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;gBAChE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;aAC1E,CAAC;YACF,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;gBAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE;oBACzE,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;iBACxB,CAAC,CAAC;gBACH,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBACtC;qBACF;iBACF,CAAC;YACJ,CAAC;SACF;QACD;YACE,IAAI,EAAE,iBAAiB;YAC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,EAAE;gBAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAClE,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBACtC;qBACF;iBACF,CAAC;YACJ,CAAC;SACF;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,mCAAmC;YAChD,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;gBAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;gBAC7C,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBACtC;qBACF;iBACF,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
||||
14
servers/toast/dist/tools/menus-tools.d.ts
vendored
Normal file
14
servers/toast/dist/tools/menus-tools.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import { z } from 'zod';
|
||||
import type { ToastAPIClient } from '../api-client.js';
|
||||
export declare function registerMenusTools(client: ToastAPIClient): {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
}[];
|
||||
//# sourceMappingURL=menus-tools.d.ts.map
|
||||
1
servers/toast/dist/tools/menus-tools.d.ts.map
vendored
Normal file
1
servers/toast/dist/tools/menus-tools.d.ts.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"menus-tools.d.ts","sourceRoot":"","sources":["../../src/tools/menus-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc;;;;oBAM7B,GAAG;;;;;;IAiJ9B"}
|
||||
154
servers/toast/dist/tools/menus-tools.js
vendored
Normal file
154
servers/toast/dist/tools/menus-tools.js
vendored
Normal file
@ -0,0 +1,154 @@
|
||||
import { z } from 'zod';
|
||||
export function registerMenusTools(client) {
|
||||
return [
|
||||
{
|
||||
name: 'toast_list_menus',
|
||||
description: 'List all menus for the restaurant',
|
||||
inputSchema: z.object({}),
|
||||
execute: async (args) => {
|
||||
const result = await client.menus.list();
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_get_menu',
|
||||
description: 'Get details of a specific menu',
|
||||
inputSchema: z.object({
|
||||
menuGuid: z.string().describe('Menu GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.menus.get(args.menuGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_menu_groups',
|
||||
description: 'List all groups in a menu',
|
||||
inputSchema: z.object({
|
||||
menuGuid: z.string().describe('Menu GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.menus.listGroups(args.menuGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_get_menu_group',
|
||||
description: 'Get details of a specific menu group',
|
||||
inputSchema: z.object({
|
||||
menuGuid: z.string().describe('Menu GUID'),
|
||||
groupGuid: z.string().describe('Menu group GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.menus.getGroup(args.menuGuid, args.groupGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_menu_items',
|
||||
description: 'List all items in a menu or menu group',
|
||||
inputSchema: z.object({
|
||||
menuGuid: z.string().describe('Menu GUID'),
|
||||
groupGuid: z.string().optional().describe('Menu group GUID (optional)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.menus.listItems(args.menuGuid, args.groupGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_get_menu_item',
|
||||
description: 'Get details of a specific menu item',
|
||||
inputSchema: z.object({
|
||||
menuGuid: z.string().describe('Menu GUID'),
|
||||
itemGuid: z.string().describe('Menu item GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.menus.getItem(args.menuGuid, args.itemGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_item_modifiers',
|
||||
description: 'List all modifier groups for a menu item',
|
||||
inputSchema: z.object({
|
||||
menuGuid: z.string().describe('Menu GUID'),
|
||||
itemGuid: z.string().describe('Menu item GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.menus.listModifiers(args.menuGuid, args.itemGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_update_item_price',
|
||||
description: 'Update the price of a menu item',
|
||||
inputSchema: z.object({
|
||||
menuGuid: z.string().describe('Menu GUID'),
|
||||
itemGuid: z.string().describe('Menu item GUID'),
|
||||
price: z.number().describe('New price in cents (e.g., 1299 for $12.99)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.menus.updatePrice(args.menuGuid, args.itemGuid, args.price);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
//# sourceMappingURL=menus-tools.js.map
|
||||
1
servers/toast/dist/tools/menus-tools.js.map
vendored
Normal file
1
servers/toast/dist/tools/menus-tools.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"menus-tools.js","sourceRoot":"","sources":["../../src/tools/menus-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,kBAAkB,CAAC,MAAsB;IACvD,OAAO;QACL;YACE,IAAI,EAAE,kBAAkB;YACxB,WAAW,EAAE,mCAAmC;YAChD,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;gBAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;gBACzC,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBACtC;qBACF;iBACF,CAAC;YACJ,CAAC;SACF;QACD;YACE,IAAI,EAAE,gBAAgB;YACtB,WAA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,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBAC/C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;aACzE,CAAC;YACF,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;gBAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;gBACxF,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBACtC;qBACF;iBACF,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
||||
73
servers/toast/dist/tools/orders-tools.d.ts
vendored
Normal file
73
servers/toast/dist/tools/orders-tools.d.ts
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
import { z } from 'zod';
|
||||
import type { ToastAPIClient } from '../api-client.js';
|
||||
export declare function registerOrdersTools(client: ToastAPIClient): ({
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
startDate: z.ZodOptional<z.ZodString>;
|
||||
endDate: z.ZodOptional<z.ZodString>;
|
||||
page: z.ZodOptional<z.ZodNumber>;
|
||||
pageSize: z.ZodOptional<z.ZodNumber>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
page?: number | undefined;
|
||||
pageSize?: number | undefined;
|
||||
startDate?: string | undefined;
|
||||
endDate?: string | undefined;
|
||||
}, {
|
||||
page?: number | undefined;
|
||||
pageSize?: number | undefined;
|
||||
startDate?: string | undefined;
|
||||
endDate?: string | undefined;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
} | {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
orderId: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
orderId: string;
|
||||
}, {
|
||||
orderId: string;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
} | {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
diningOptionGuid: z.ZodString;
|
||||
revenueCenterGuid: z.ZodOptional<z.ZodString>;
|
||||
tableGuid: z.ZodOptional<z.ZodString>;
|
||||
numberOfGuests: z.ZodOptional<z.ZodNumber>;
|
||||
estimatedFulfillmentDate: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
diningOptionGuid: string;
|
||||
revenueCenterGuid?: string | undefined;
|
||||
tableGuid?: string | undefined;
|
||||
numberOfGuests?: number | undefined;
|
||||
estimatedFulfillmentDate?: string | undefined;
|
||||
}, {
|
||||
diningOptionGuid: string;
|
||||
revenueCenterGuid?: string | undefined;
|
||||
tableGuid?: string | undefined;
|
||||
numberOfGuests?: number | undefined;
|
||||
estimatedFulfillmentDate?: string | undefined;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
})[];
|
||||
//# sourceMappingURL=orders-tools.d.ts.map
|
||||
1
servers/toast/dist/tools/orders-tools.d.ts.map
vendored
Normal file
1
servers/toast/dist/tools/orders-tools.d.ts.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"orders-tools.d.ts","sourceRoot":"","sources":["../../src/tools/orders-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc;;;;;;;;;;;;;;;;;;;oBAW9B,GAAG;;;;;;;;;;;;;;;;oBAyBH,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAsBH,GAAG;;;;;;KAkK9B"}
|
||||
227
servers/toast/dist/tools/orders-tools.js
vendored
Normal file
227
servers/toast/dist/tools/orders-tools.js
vendored
Normal file
@ -0,0 +1,227 @@
|
||||
import { z } from 'zod';
|
||||
export function registerOrdersTools(client) {
|
||||
return [
|
||||
{
|
||||
name: 'toast_list_orders',
|
||||
description: 'List orders with optional date range filter',
|
||||
inputSchema: z.object({
|
||||
startDate: z.string().optional().describe('Start date (ISO 8601 format)'),
|
||||
endDate: z.string().optional().describe('End date (ISO 8601 format)'),
|
||||
page: z.number().optional().describe('Page number (default: 1)'),
|
||||
pageSize: z.number().optional().describe('Items per page (default: 100)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.orders.list({
|
||||
startDate: args.startDate,
|
||||
endDate: args.endDate,
|
||||
pagination: {
|
||||
page: args.page,
|
||||
pageSize: args.pageSize,
|
||||
},
|
||||
});
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_get_order',
|
||||
description: 'Get details of a specific order by ID',
|
||||
inputSchema: z.object({
|
||||
orderId: z.string().describe('Order GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.orders.get(args.orderId);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_create_order',
|
||||
description: 'Create a new order',
|
||||
inputSchema: z.object({
|
||||
diningOptionGuid: z.string().describe('Dining option GUID'),
|
||||
revenueCenterGuid: z.string().optional().describe('Revenue center GUID'),
|
||||
tableGuid: z.string().optional().describe('Table GUID'),
|
||||
numberOfGuests: z.number().optional().describe('Number of guests'),
|
||||
estimatedFulfillmentDate: z.string().optional().describe('Estimated fulfillment date (ISO 8601)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const orderData = {
|
||||
diningOption: { guid: args.diningOptionGuid },
|
||||
...(args.revenueCenterGuid && { revenueCenterGuid: args.revenueCenterGuid }),
|
||||
...(args.tableGuid && { table: { guid: args.tableGuid } }),
|
||||
...(args.numberOfGuests && { numberOfGuests: args.numberOfGuests }),
|
||||
...(args.estimatedFulfillmentDate && { estimatedFulfillmentDate: args.estimatedFulfillmentDate }),
|
||||
};
|
||||
const result = await client.orders.create(orderData);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_update_order',
|
||||
description: 'Update an existing order',
|
||||
inputSchema: z.object({
|
||||
orderId: z.string().describe('Order GUID'),
|
||||
numberOfGuests: z.number().optional().describe('Number of guests'),
|
||||
tableGuid: z.string().optional().describe('Table GUID'),
|
||||
estimatedFulfillmentDate: z.string().optional().describe('Estimated fulfillment date (ISO 8601)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const updateData = {};
|
||||
if (args.numberOfGuests !== undefined)
|
||||
updateData.numberOfGuests = args.numberOfGuests;
|
||||
if (args.tableGuid)
|
||||
updateData.table = { guid: args.tableGuid };
|
||||
if (args.estimatedFulfillmentDate)
|
||||
updateData.estimatedFulfillmentDate = args.estimatedFulfillmentDate;
|
||||
const result = await client.orders.update(args.orderId, updateData);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_add_order_item',
|
||||
description: 'Add an item to an order check',
|
||||
inputSchema: z.object({
|
||||
orderId: z.string().describe('Order GUID'),
|
||||
checkGuid: z.string().describe('Check GUID'),
|
||||
itemGuid: z.string().describe('Menu item GUID'),
|
||||
quantity: z.number().describe('Quantity'),
|
||||
modifiers: z.array(z.object({
|
||||
guid: z.string(),
|
||||
quantity: z.number().optional(),
|
||||
})).optional().describe('Item modifiers'),
|
||||
specialRequest: z.string().optional().describe('Special instructions'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const itemData = {
|
||||
item: { guid: args.itemGuid },
|
||||
quantity: args.quantity,
|
||||
...(args.modifiers && { modifiers: args.modifiers }),
|
||||
...(args.specialRequest && { specialRequest: args.specialRequest }),
|
||||
};
|
||||
const result = await client.orders.addItem(args.orderId, args.checkGuid, itemData);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_remove_order_item',
|
||||
description: 'Remove an item from an order check',
|
||||
inputSchema: z.object({
|
||||
orderId: z.string().describe('Order GUID'),
|
||||
checkGuid: z.string().describe('Check GUID'),
|
||||
selectionGuid: z.string().describe('Selection GUID to remove'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.orders.removeItem(args.orderId, args.checkGuid, args.selectionGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: 'Item removed successfully',
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_apply_discount',
|
||||
description: 'Apply a discount to an order check',
|
||||
inputSchema: z.object({
|
||||
orderId: z.string().describe('Order GUID'),
|
||||
checkGuid: z.string().describe('Check GUID'),
|
||||
discountGuid: z.string().optional().describe('Discount configuration GUID'),
|
||||
discountAmount: z.number().optional().describe('Discount amount (for fixed amount)'),
|
||||
discountPercent: z.number().optional().describe('Discount percentage (0-100)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const discountData = {};
|
||||
if (args.discountGuid)
|
||||
discountData.guid = args.discountGuid;
|
||||
if (args.discountAmount !== undefined)
|
||||
discountData.amount = args.discountAmount;
|
||||
if (args.discountPercent !== undefined)
|
||||
discountData.discountPercent = args.discountPercent;
|
||||
const result = await client.orders.applyDiscount(args.orderId, args.checkGuid, discountData);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_void_order',
|
||||
description: 'Void an entire order',
|
||||
inputSchema: z.object({
|
||||
orderId: z.string().describe('Order GUID'),
|
||||
voidReason: z.string().optional().describe('Reason for voiding'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.orders.void(args.orderId, args.voidReason);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_order_checks',
|
||||
description: 'List all checks for an order',
|
||||
inputSchema: z.object({
|
||||
orderId: z.string().describe('Order GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.orders.listChecks(args.orderId);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
//# sourceMappingURL=orders-tools.js.map
|
||||
1
servers/toast/dist/tools/orders-tools.js.map
vendored
Normal file
1
servers/toast/dist/tools/orders-tools.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
39
servers/toast/dist/tools/payments-tools.d.ts
vendored
Normal file
39
servers/toast/dist/tools/payments-tools.d.ts
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
import { z } from 'zod';
|
||||
import type { ToastAPIClient } from '../api-client.js';
|
||||
export declare function registerPaymentsTools(client: ToastAPIClient): ({
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
paymentGuid: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
paymentGuid: string;
|
||||
}, {
|
||||
paymentGuid: string;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
} | {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
startDate: z.ZodString;
|
||||
endDate: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
}, {
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
})[];
|
||||
//# sourceMappingURL=payments-tools.d.ts.map
|
||||
1
servers/toast/dist/tools/payments-tools.d.ts.map
vendored
Normal file
1
servers/toast/dist/tools/payments-tools.d.ts.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"payments-tools.d.ts","sourceRoot":"","sources":["../../src/tools/payments-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc;;;;;;;;;;oBAgChC,GAAG;;;;;;;;;;;;;;;;;;;oBA8DH,GAAG;;;;;;KAa9B"}
|
||||
106
servers/toast/dist/tools/payments-tools.js
vendored
Normal file
106
servers/toast/dist/tools/payments-tools.js
vendored
Normal file
@ -0,0 +1,106 @@
|
||||
import { z } from 'zod';
|
||||
export function registerPaymentsTools(client) {
|
||||
return [
|
||||
{
|
||||
name: 'toast_list_payments',
|
||||
description: 'List all payments within a date range',
|
||||
inputSchema: z.object({
|
||||
startDate: z.string().describe('Start date (ISO 8601 format)'),
|
||||
endDate: z.string().describe('End date (ISO 8601 format)'),
|
||||
page: z.number().optional().describe('Page number (default: 1)'),
|
||||
pageSize: z.number().optional().describe('Items per page (default: 100)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.payments.list(args.startDate, args.endDate, {
|
||||
page: args.page,
|
||||
pageSize: args.pageSize,
|
||||
});
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_get_payment',
|
||||
description: 'Get details of a specific payment',
|
||||
inputSchema: z.object({
|
||||
paymentGuid: z.string().describe('Payment GUID'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.payments.get(args.paymentGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_void_payment',
|
||||
description: 'Void a payment',
|
||||
inputSchema: z.object({
|
||||
paymentGuid: z.string().describe('Payment GUID'),
|
||||
voidReason: z.string().optional().describe('Reason for voiding'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.payments.void(args.paymentGuid, args.voidReason);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_refund_payment',
|
||||
description: 'Refund a payment',
|
||||
inputSchema: z.object({
|
||||
paymentGuid: z.string().describe('Payment GUID'),
|
||||
refundAmount: z.number().describe('Amount to refund in cents'),
|
||||
refundReason: z.string().optional().describe('Reason for refund'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.payments.refund(args.paymentGuid, args.refundAmount, args.refundReason);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_tips',
|
||||
description: 'List all tips within a date range',
|
||||
inputSchema: z.object({
|
||||
startDate: z.string().describe('Start date (ISO 8601 format)'),
|
||||
endDate: z.string().describe('End date (ISO 8601 format)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.payments.listTips(args.startDate, args.endDate);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
//# sourceMappingURL=payments-tools.js.map
|
||||
1
servers/toast/dist/tools/payments-tools.js.map
vendored
Normal file
1
servers/toast/dist/tools/payments-tools.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"payments-tools.js","sourceRoot":"","sources":["../../src/tools/payments-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,qBAAqB,CAAC,MAAsB;IAC1D,OAAO;QACL;YACE,IAAI,EAAE,qBAAqB;YAC3B,WAAW,EAAE,uCAAuC;YACpD,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;gBACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;gBAC9D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;gBAC1D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;gBAChE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;aAC1E,CAAC;YACF,OAAO,EAAE,KAA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AAQ,CAAC,8BAA8B,CAAC;gBAC9D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;aAC3D,CAAC;YACF,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;gBAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC5E,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBACtC;qBACF;iBACF,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
||||
39
servers/toast/dist/tools/reporting-tools.d.ts
vendored
Normal file
39
servers/toast/dist/tools/reporting-tools.d.ts
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
import { z } from 'zod';
|
||||
import type { ToastAPIClient } from '../api-client.js';
|
||||
export declare function registerReportingTools(client: ToastAPIClient): ({
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
startDate: z.ZodString;
|
||||
endDate: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
}, {
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
} | {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{
|
||||
businessDate: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
businessDate: string;
|
||||
}, {
|
||||
businessDate: string;
|
||||
}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
})[];
|
||||
//# sourceMappingURL=reporting-tools.d.ts.map
|
||||
1
servers/toast/dist/tools/reporting-tools.d.ts.map
vendored
Normal file
1
servers/toast/dist/tools/reporting-tools.d.ts.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"reporting-tools.d.ts","sourceRoot":"","sources":["../../src/tools/reporting-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc;;;;;;;;;;;;;oBASjC,GAAG;;;;;;;;;;;;;;;;oBAqCH,GAAG;;;;;;KA4F9B"}
|
||||
133
servers/toast/dist/tools/reporting-tools.js
vendored
Normal file
133
servers/toast/dist/tools/reporting-tools.js
vendored
Normal file
@ -0,0 +1,133 @@
|
||||
import { z } from 'zod';
|
||||
export function registerReportingTools(client) {
|
||||
return [
|
||||
{
|
||||
name: 'toast_sales_summary',
|
||||
description: 'Get sales summary report for a date range',
|
||||
inputSchema: z.object({
|
||||
startDate: z.string().describe('Start date (ISO 8601 format)'),
|
||||
endDate: z.string().describe('End date (ISO 8601 format)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
// This would aggregate data from orders and payments
|
||||
const orders = await client.orders.list({
|
||||
startDate: args.startDate,
|
||||
endDate: args.endDate,
|
||||
});
|
||||
const payments = await client.payments.list(args.startDate, args.endDate);
|
||||
// Calculate summary metrics
|
||||
const summary = {
|
||||
dateRange: { startDate: args.startDate, endDate: args.endDate },
|
||||
orders: orders.data,
|
||||
payments: payments.data,
|
||||
summary: {
|
||||
totalOrders: orders.totalCount,
|
||||
totalPayments: payments.totalCount,
|
||||
message: 'Sales summary data retrieved. Process orders and payments to calculate metrics.',
|
||||
},
|
||||
};
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(summary, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_labor_cost_report',
|
||||
description: 'Get labor cost report for a business date',
|
||||
inputSchema: z.object({
|
||||
businessDate: z.string().describe('Business date (YYYYMMDD format)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.labor.getLaborCost(args.businessDate);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_menu_item_performance',
|
||||
description: 'Get menu item sales performance for a date range',
|
||||
inputSchema: z.object({
|
||||
startDate: z.string().describe('Start date (ISO 8601 format)'),
|
||||
endDate: z.string().describe('End date (ISO 8601 format)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
// Fetch orders and aggregate item sales
|
||||
const orders = await client.orders.list({
|
||||
startDate: args.startDate,
|
||||
endDate: args.endDate,
|
||||
});
|
||||
const report = {
|
||||
dateRange: { startDate: args.startDate, endDate: args.endDate },
|
||||
orders: orders.data,
|
||||
message: 'Menu item performance data retrieved. Process order selections to calculate metrics.',
|
||||
};
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(report, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_revenue_by_hour',
|
||||
description: 'Get revenue breakdown by hour for a date range',
|
||||
inputSchema: z.object({
|
||||
startDate: z.string().describe('Start date (ISO 8601 format)'),
|
||||
endDate: z.string().describe('End date (ISO 8601 format)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const orders = await client.orders.list({
|
||||
startDate: args.startDate,
|
||||
endDate: args.endDate,
|
||||
});
|
||||
const report = {
|
||||
dateRange: { startDate: args.startDate, endDate: args.endDate },
|
||||
orders: orders.data,
|
||||
message: 'Hourly revenue data retrieved. Process order timestamps to calculate hourly breakdown.',
|
||||
};
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(report, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_tip_summary',
|
||||
description: 'Get tip summary report for a date range',
|
||||
inputSchema: z.object({
|
||||
startDate: z.string().describe('Start date (ISO 8601 format)'),
|
||||
endDate: z.string().describe('End date (ISO 8601 format)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const tips = await client.payments.listTips(args.startDate, args.endDate);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(tips, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
//# sourceMappingURL=reporting-tools.js.map
|
||||
1
servers/toast/dist/tools/reporting-tools.js.map
vendored
Normal file
1
servers/toast/dist/tools/reporting-tools.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"reporting-tools.js","sourceRoot":"","sources":["../../src/tools/reporting-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,sBAAsB,CAAC,MAAsB;IAC3D,OAAO;QACL;YACE,IAAI,EAAE,qBAAqB;YAC3B,WAAW,EAAE,2CAA2C;YACxD,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;gBACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;gBAC9D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;aAC3D,CAAC;YACF,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;gBAC3B,qDAAqD;gBACrD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;oBACtC,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,OAAO,EAAE,IAAI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file
@ -0,0 +1,14 @@
|
||||
import { z } from 'zod';
|
||||
import type { ToastAPIClient } from '../api-client.js';
|
||||
export declare function registerRestaurantTools(client: ToastAPIClient): {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
||||
execute: (args: any) => Promise<{
|
||||
content: {
|
||||
type: string;
|
||||
text: string;
|
||||
}[];
|
||||
}>;
|
||||
}[];
|
||||
//# sourceMappingURL=restaurant-tools.d.ts.map
|
||||
1
servers/toast/dist/tools/restaurant-tools.d.ts.map
vendored
Normal file
1
servers/toast/dist/tools/restaurant-tools.d.ts.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"restaurant-tools.d.ts","sourceRoot":"","sources":["../../src/tools/restaurant-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,cAAc;;;;oBAMlC,GAAG;;;;;;IA+E9B"}
|
||||
88
servers/toast/dist/tools/restaurant-tools.js
vendored
Normal file
88
servers/toast/dist/tools/restaurant-tools.js
vendored
Normal file
@ -0,0 +1,88 @@
|
||||
import { z } from 'zod';
|
||||
export function registerRestaurantTools(client) {
|
||||
return [
|
||||
{
|
||||
name: 'toast_get_restaurant_info',
|
||||
description: 'Get restaurant information and configuration',
|
||||
inputSchema: z.object({}),
|
||||
execute: async (args) => {
|
||||
const result = await client.restaurant.getInfo();
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_revenue_centers',
|
||||
description: 'List all revenue centers for the restaurant',
|
||||
inputSchema: z.object({}),
|
||||
execute: async (args) => {
|
||||
const result = await client.restaurant.listRevenueCenters();
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_dining_options',
|
||||
description: 'List all dining options (dine-in, takeout, delivery, etc.)',
|
||||
inputSchema: z.object({}),
|
||||
execute: async (args) => {
|
||||
const result = await client.restaurant.listDiningOptions();
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_service_areas',
|
||||
description: 'List all service areas (sections) in the restaurant',
|
||||
inputSchema: z.object({}),
|
||||
execute: async (args) => {
|
||||
const result = await client.restaurant.listServiceAreas();
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'toast_list_tables',
|
||||
description: 'List all tables, optionally filtered by service area',
|
||||
inputSchema: z.object({
|
||||
serviceAreaGuid: z.string().optional().describe('Service area GUID (optional)'),
|
||||
}),
|
||||
execute: async (args) => {
|
||||
const result = await client.restaurant.listTables(args.serviceAreaGuid);
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
//# sourceMappingURL=restaurant-tools.js.map
|
||||
1
servers/toast/dist/tools/restaurant-tools.js.map
vendored
Normal file
1
servers/toast/dist/tools/restaurant-tools.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"restaurant-tools.js","sourceRoot":"","sources":["../../src/tools/restaurant-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,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,EAAE,CAAC,CAAC;yBACtC;qBACF;iBACF,CAAC;YACJ,CAAC;SACF;QACD;YACE,IAAI,EAAE,0BAA0B;YAChC,WAAW,EAAE,qDAAqD;YAClE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;gBAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;gBAC1D,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBACtC;qBACF;iBACF,CAAC;YACJ,CAAC;SACF;QACD;YACE,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,sDAAsD;YACnE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;gBACpB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;aAChF,CAAC;YACF,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;gBAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;gBACxE,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBACtC;qBACF;iBACF,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
||||
533
servers/toast/dist/types/index.d.ts
vendored
Normal file
533
servers/toast/dist/types/index.d.ts
vendored
Normal file
@ -0,0 +1,533 @@
|
||||
export interface ToastConfig {
|
||||
apiToken: string;
|
||||
restaurantGuid: string;
|
||||
baseUrl?: string;
|
||||
}
|
||||
export interface PaginationParams {
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
export interface PaginatedResponse<T> {
|
||||
data: T[];
|
||||
page: number;
|
||||
pageSize: number;
|
||||
totalPages: number;
|
||||
totalCount: number;
|
||||
}
|
||||
export interface Order {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
externalId?: string;
|
||||
openedDate: string;
|
||||
modifiedDate: string;
|
||||
promisedDate?: string;
|
||||
closedDate?: string;
|
||||
deletedDate?: string;
|
||||
deleted: boolean;
|
||||
businessDate: number;
|
||||
server?: Employee;
|
||||
pricingFeatures: string[];
|
||||
source: string;
|
||||
duration: number;
|
||||
diningOption: DiningOption;
|
||||
checks: Check[];
|
||||
table?: Table;
|
||||
serviceArea?: ServiceArea;
|
||||
restaurantService: string;
|
||||
revenueCenterGuid: string;
|
||||
voided: boolean;
|
||||
voidDate?: string;
|
||||
voidBusinessDate?: number;
|
||||
voidUser?: Employee;
|
||||
approvalStatus: string;
|
||||
deliveryInfo?: DeliveryInfo;
|
||||
numberOfGuests?: number;
|
||||
estimatedFulfillmentDate?: string;
|
||||
curbsidePickupInfo?: CurbsidePickupInfo;
|
||||
}
|
||||
export interface Check {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
externalId?: string;
|
||||
openedDate: string;
|
||||
modifiedDate: string;
|
||||
deletedDate?: string;
|
||||
deleted: boolean;
|
||||
selections: Selection[];
|
||||
customer?: Customer;
|
||||
appliedDiscounts: Discount[];
|
||||
amount: number;
|
||||
taxAmount: number;
|
||||
totalAmount: number;
|
||||
payments: Payment[];
|
||||
tabName?: string;
|
||||
paymentStatus: string;
|
||||
closedDate?: string;
|
||||
voided: boolean;
|
||||
voidDate?: string;
|
||||
voidUser?: Employee;
|
||||
}
|
||||
export interface Selection {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
externalId?: string;
|
||||
itemGroup?: MenuGroup;
|
||||
item: MenuItem;
|
||||
optionGroups?: OptionGroup[];
|
||||
modifiers?: Modifier[];
|
||||
quantity: number;
|
||||
unitOfMeasure: string;
|
||||
price: number;
|
||||
tax: number;
|
||||
voided: boolean;
|
||||
voidDate?: string;
|
||||
voidBusinessDate?: number;
|
||||
voidUser?: Employee;
|
||||
displayName: string;
|
||||
preDiscountPrice: number;
|
||||
appliedDiscounts: Discount[];
|
||||
diningOption: DiningOption;
|
||||
salesCategory: SalesCategory;
|
||||
fulfillmentStatus: string;
|
||||
seat?: number;
|
||||
}
|
||||
export interface Discount {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
externalId?: string;
|
||||
name: string;
|
||||
amount: number;
|
||||
discountType: string;
|
||||
discountPercent?: number;
|
||||
nonTaxDiscountAmount?: number;
|
||||
approvalStatus: string;
|
||||
processingState: string;
|
||||
}
|
||||
export interface Menu {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
externalId?: string;
|
||||
name: string;
|
||||
visibility: string;
|
||||
groups: MenuGroup[];
|
||||
}
|
||||
export interface MenuGroup {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
externalId?: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
items: MenuItem[];
|
||||
visibility: string;
|
||||
}
|
||||
export interface MenuItem {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
externalId?: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
sku?: string;
|
||||
plu?: string;
|
||||
price: number;
|
||||
calories?: number;
|
||||
visibility: string;
|
||||
salesCategory?: SalesCategory;
|
||||
optionGroups?: OptionGroup[];
|
||||
modifierGroups?: ModifierGroup[];
|
||||
images?: Image[];
|
||||
tags?: string[];
|
||||
isDiscountable: boolean;
|
||||
unitOfMeasure: string;
|
||||
}
|
||||
export interface OptionGroup {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
minSelections: number;
|
||||
maxSelections: number;
|
||||
options: Option[];
|
||||
}
|
||||
export interface Option {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
price: number;
|
||||
isDefault: boolean;
|
||||
}
|
||||
export interface ModifierGroup {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
minSelections: number;
|
||||
maxSelections: number;
|
||||
modifiers: Modifier[];
|
||||
}
|
||||
export interface Modifier {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
price: number;
|
||||
calories?: number;
|
||||
}
|
||||
export interface SalesCategory {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
}
|
||||
export interface Image {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
url: string;
|
||||
}
|
||||
export interface Employee {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
externalId?: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
email?: string;
|
||||
phoneNumber?: string;
|
||||
externalEmployeeId?: string;
|
||||
chosenName?: string;
|
||||
passcode?: string;
|
||||
createdDate: string;
|
||||
modifiedDate: string;
|
||||
deletedDate?: string;
|
||||
deleted: boolean;
|
||||
disabled: boolean;
|
||||
jobs: Job[];
|
||||
}
|
||||
export interface Job {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
title: string;
|
||||
wage: number;
|
||||
wageType: string;
|
||||
}
|
||||
export interface Shift {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
createdDate: string;
|
||||
modifiedDate: string;
|
||||
deletedDate?: string;
|
||||
deleted: boolean;
|
||||
businessDate: number;
|
||||
inDate: string;
|
||||
outDate?: string;
|
||||
employee: Employee;
|
||||
job: Job;
|
||||
breaks: Break[];
|
||||
regularHours: number;
|
||||
overtimeHours: number;
|
||||
totalHours: number;
|
||||
laborCost: number;
|
||||
tips?: number;
|
||||
declaredTips?: number;
|
||||
}
|
||||
export interface Break {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
inDate: string;
|
||||
outDate?: string;
|
||||
isPaid: boolean;
|
||||
duration: number;
|
||||
}
|
||||
export interface TimeEntry {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
createdDate: string;
|
||||
businessDate: number;
|
||||
inDate: string;
|
||||
outDate?: string;
|
||||
employee: Employee;
|
||||
job: Job;
|
||||
hourlyWage: number;
|
||||
}
|
||||
export interface LaborEntry {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
businessDate: number;
|
||||
employee: Employee;
|
||||
job: Job;
|
||||
regularHours: number;
|
||||
overtimeHours: number;
|
||||
doubleOvertimeHours: number;
|
||||
totalHours: number;
|
||||
regularPay: number;
|
||||
overtimePay: number;
|
||||
doubleOvertimePay: number;
|
||||
totalPay: number;
|
||||
}
|
||||
export interface Restaurant {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
timeZone: string;
|
||||
closeoutHour: number;
|
||||
managementGroupGuid: string;
|
||||
externalGroupRef?: string;
|
||||
locationName?: string;
|
||||
locationCode?: string;
|
||||
address1?: string;
|
||||
address2?: string;
|
||||
city?: string;
|
||||
stateCode?: string;
|
||||
zipCode?: string;
|
||||
country?: string;
|
||||
phone?: string;
|
||||
createdDate: string;
|
||||
modifiedDate: string;
|
||||
}
|
||||
export interface RevenueCenter {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
}
|
||||
export interface DiningOption {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
behavior: string;
|
||||
curbside: boolean;
|
||||
}
|
||||
export interface ServiceArea {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
tables: Table[];
|
||||
}
|
||||
export interface Table {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
seatingCapacity: number;
|
||||
serviceArea?: ServiceArea;
|
||||
}
|
||||
export interface Payment {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
externalId?: string;
|
||||
paymentDate: string;
|
||||
businessDate: number;
|
||||
amount: number;
|
||||
tipAmount: number;
|
||||
amountTendered: number;
|
||||
cardEntryMode?: string;
|
||||
last4Digits?: string;
|
||||
paymentType: string;
|
||||
paymentStatus: string;
|
||||
voidInfo?: VoidInfo;
|
||||
refundInfo?: RefundInfo;
|
||||
originalProcessingFee?: number;
|
||||
server?: Employee;
|
||||
cashDrawer?: CashDrawer;
|
||||
otherPayment?: OtherPayment;
|
||||
houseAccount?: HouseAccount;
|
||||
cardType?: string;
|
||||
}
|
||||
export interface VoidInfo {
|
||||
voidDate: string;
|
||||
voidBusinessDate: number;
|
||||
voidUser: Employee;
|
||||
voidApprover?: Employee;
|
||||
voidReason?: string;
|
||||
}
|
||||
export interface RefundInfo {
|
||||
refundDate: string;
|
||||
refundBusinessDate: number;
|
||||
refundAmount: number;
|
||||
refundUser: Employee;
|
||||
refundReason?: string;
|
||||
}
|
||||
export interface OtherPayment {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
isDefaultForTakeout: boolean;
|
||||
}
|
||||
export interface HouseAccount {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
}
|
||||
export interface InventoryItem {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
unitOfMeasure: string;
|
||||
currentQuantity: number;
|
||||
parLevel?: number;
|
||||
reorderPoint?: number;
|
||||
cost: number;
|
||||
vendor?: Vendor;
|
||||
lastCountDate?: string;
|
||||
}
|
||||
export interface Vendor {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
contactName?: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
address?: string;
|
||||
}
|
||||
export interface PurchaseOrder {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
orderNumber: string;
|
||||
vendor: Vendor;
|
||||
orderDate: string;
|
||||
expectedDeliveryDate?: string;
|
||||
status: string;
|
||||
items: PurchaseOrderItem[];
|
||||
totalAmount: number;
|
||||
}
|
||||
export interface PurchaseOrderItem {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
inventoryItem: InventoryItem;
|
||||
quantity: number;
|
||||
unitCost: number;
|
||||
totalCost: number;
|
||||
}
|
||||
export interface Customer {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
company?: string;
|
||||
createdDate: string;
|
||||
modifiedDate: string;
|
||||
loyaltyPoints?: number;
|
||||
totalVisits?: number;
|
||||
totalSpent?: number;
|
||||
}
|
||||
export interface LoyaltyAccount {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
customer: Customer;
|
||||
points: number;
|
||||
tier?: string;
|
||||
enrollmentDate: string;
|
||||
lastActivityDate?: string;
|
||||
}
|
||||
export interface CashDrawer {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
name: string;
|
||||
employee?: Employee;
|
||||
openedDate?: string;
|
||||
closedDate?: string;
|
||||
status: string;
|
||||
openingFloat: number;
|
||||
closingCash: number;
|
||||
expectedCash: number;
|
||||
variance: number;
|
||||
}
|
||||
export interface CashEntry {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
entryDate: string;
|
||||
businessDate: number;
|
||||
amount: number;
|
||||
type: string;
|
||||
reason?: string;
|
||||
employee: Employee;
|
||||
cashDrawer: CashDrawer;
|
||||
}
|
||||
export interface SalesSummary {
|
||||
businessDate: number;
|
||||
netSales: number;
|
||||
grossSales: number;
|
||||
discounts: number;
|
||||
refunds: number;
|
||||
tax: number;
|
||||
tips: number;
|
||||
totalPayments: number;
|
||||
guestCount: number;
|
||||
checkCount: number;
|
||||
averageCheck: number;
|
||||
averageGuest: number;
|
||||
salesByHour: HourlySales[];
|
||||
salesByCategory: CategorySales[];
|
||||
paymentsByType: PaymentTypeSales[];
|
||||
}
|
||||
export interface HourlySales {
|
||||
hour: number;
|
||||
netSales: number;
|
||||
grossSales: number;
|
||||
checkCount: number;
|
||||
guestCount: number;
|
||||
}
|
||||
export interface CategorySales {
|
||||
category: string;
|
||||
netSales: number;
|
||||
quantity: number;
|
||||
percentOfTotal: number;
|
||||
}
|
||||
export interface PaymentTypeSales {
|
||||
paymentType: string;
|
||||
amount: number;
|
||||
count: number;
|
||||
percentOfTotal: number;
|
||||
}
|
||||
export interface LaborCostReport {
|
||||
businessDate: number;
|
||||
totalHours: number;
|
||||
totalLaborCost: number;
|
||||
salesAmount: number;
|
||||
laborCostPercent: number;
|
||||
employeeCount: number;
|
||||
averageHourlyRate: number;
|
||||
overtimeHours: number;
|
||||
overtimeCost: number;
|
||||
}
|
||||
export interface MenuItemPerformance {
|
||||
item: MenuItem;
|
||||
quantitySold: number;
|
||||
netSales: number;
|
||||
grossSales: number;
|
||||
costOfGoods?: number;
|
||||
grossProfit?: number;
|
||||
grossProfitMargin?: number;
|
||||
percentOfTotalSales: number;
|
||||
}
|
||||
export interface TipSummary {
|
||||
businessDate: number;
|
||||
totalTips: number;
|
||||
cashTips: number;
|
||||
cardTips: number;
|
||||
declaredTips: number;
|
||||
tipsByEmployee: EmployeeTips[];
|
||||
averageTipPercent: number;
|
||||
}
|
||||
export interface EmployeeTips {
|
||||
employee: Employee;
|
||||
totalTips: number;
|
||||
cashTips: number;
|
||||
cardTips: number;
|
||||
hoursWorked: number;
|
||||
tipsPerHour: number;
|
||||
}
|
||||
export interface DeliveryInfo {
|
||||
address1: string;
|
||||
address2?: string;
|
||||
city: string;
|
||||
state: string;
|
||||
zipCode: string;
|
||||
deliveryNotes?: string;
|
||||
estimatedDeliveryTime?: string;
|
||||
deliveryEmployee?: Employee;
|
||||
deliveryFee?: number;
|
||||
}
|
||||
export interface CurbsidePickupInfo {
|
||||
transportDescription?: string;
|
||||
transportColor?: string;
|
||||
notes?: string;
|
||||
arrivedDate?: string;
|
||||
}
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
servers/toast/dist/types/index.d.ts.map
vendored
Normal file
1
servers/toast/dist/types/index.d.ts.map
vendored
Normal file
File diff suppressed because one or more lines are too long
3
servers/toast/dist/types/index.js
vendored
Normal file
3
servers/toast/dist/types/index.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// Toast API Types
|
||||
export {};
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
servers/toast/dist/types/index.js.map
vendored
Normal file
1
servers/toast/dist/types/index.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,kBAAkB"}
|
||||
1313
servers/toast/package-lock.json
generated
Normal file
1313
servers/toast/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -37,8 +37,9 @@ export class ToastAPIClient {
|
||||
(response) => response,
|
||||
(error: AxiosError) => {
|
||||
if (error.response) {
|
||||
const errorData = error.response.data as any;
|
||||
throw new ToastAPIError(
|
||||
error.response.data?.message || error.message,
|
||||
errorData?.message || error.message,
|
||||
error.response.status,
|
||||
error.response.data
|
||||
);
|
||||
|
||||
@ -79,7 +79,7 @@ export interface Selection {
|
||||
guid: string;
|
||||
entityType: string;
|
||||
externalId?: string;
|
||||
itemGroup: ItemGroup;
|
||||
itemGroup?: MenuGroup;
|
||||
item: MenuItem;
|
||||
optionGroups?: OptionGroup[];
|
||||
modifiers?: Modifier[];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user