@noanswer/context-compose
Version:
Orchestrate complex AI interactions with Context Compose. A powerful CLI and server for building, validating, and managing context for large language models using the Model Context Protocol (MCP).
30 lines • 1.18 kB
JavaScript
import { executeInitTool } from '../../../src/core/tools/init.js';
import { InitToolSchema } from '../../../src/schemas/init.js';
import logger from '../logger.js';
/**
* Register Init tool with MCP server
* @param server - FastMCP server instance
*/
export function registerInitTool(server) {
server.addTool({
name: 'init',
description: 'Initialize Context Compose project (copy assets directory to .contextcompose). You must specify the project root directory with the projectRoot parameter.',
parameters: InitToolSchema,
execute: async (args) => {
try {
logger.info('Executing Init tool', args);
// Use common business logic
const result = await executeInitTool(args);
logger.info('Init tool completed', { result });
return JSON.stringify(result);
}
catch (error) {
logger.error('Error executing Init tool', {
error: error instanceof Error ? error.message : String(error),
});
throw error;
}
},
});
}
//# sourceMappingURL=init.js.map