erp-mecanicas-diesel-backen.../src/modules/mcp/interfaces/mcp-tool.interface.ts
Adrian Flores Cortes 5c7134cc03 [PROP-CORE-004] feat: Add Phase 6 modules from erp-core
Propagated modules:
- payment-terminals: MercadoPago + Clip TPV
- ai: Role-based AI access (ADMIN, JEFE_TALLER, MECANICO, CLIENTE)
- mcp: 18 ERP tools for AI assistants

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 02:45:37 -06:00

63 lines
1.3 KiB
TypeScript

// =====================================================
// Interfaces: MCP Tool
// Modulo: MGN-022
// Version: 1.0.0
// =====================================================
import { McpContext } from './mcp-context.interface';
export interface JSONSchema {
type: string;
properties?: Record<string, JSONSchemaProperty>;
required?: string[];
items?: JSONSchemaProperty;
description?: string;
}
export interface JSONSchemaProperty {
type: string;
description?: string;
format?: string;
enum?: string[];
minimum?: number;
maximum?: number;
default?: any;
items?: JSONSchemaProperty;
properties?: Record<string, JSONSchemaProperty>;
required?: string[];
}
export interface RateLimitConfig {
maxCalls: number;
windowMs: number;
perTenant?: boolean;
}
export type ToolCategory =
| 'products'
| 'inventory'
| 'orders'
| 'customers'
| 'fiados'
| 'system';
export interface McpToolDefinition {
name: string;
description: string;
parameters: JSONSchema;
returns: JSONSchema;
category: ToolCategory;
permissions?: string[];
rateLimit?: RateLimitConfig;
}
export type McpToolHandler<TParams = any, TResult = any> = (
params: TParams,
context: McpContext
) => Promise<TResult>;
export interface McpToolProvider {
getTools(): McpToolDefinition[];
getHandler(toolName: string): McpToolHandler | undefined;
}