@dav3/mcp-dynamics365-server
Version:
Generic MCP server for Dynamics 365 CRM operations (AI-generated side project with limited maintenance)
28 lines (27 loc) • 970 B
JavaScript
import { entityTools, handleEntityTools } from "./entity-tools.js";
import { handleQueryTools, queryTools } from "./query-tools.js";
import { handleSchemaTools, schemaTools } from "./schema-tools.js";
// Export all tools
export const allTools = [
...schemaTools,
...entityTools,
...queryTools,
];
// Main tool handler
export async function handleToolCall(name, args, apiClient) {
// Schema tools
if (schemaTools.some(tool => tool.name === name)) {
return await handleSchemaTools(name, args, apiClient);
}
// Entity tools
if (entityTools.some(tool => tool.name === name)) {
return await handleEntityTools(name, args, apiClient);
}
// Query tools
if (queryTools.some(tool => tool.name === name)) {
return await handleQueryTools(name, args, apiClient);
}
throw new Error(`Unknown tool: ${name}`);
}
// Export individual tool arrays for convenience
export { entityTools, queryTools, schemaTools };