UNPKG

@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.53 kB
import { executeGetContextTool } from '../../../src/core/tools/get-context.js'; import { GetContextToolSchema } from '../../../src/schemas/get-context.js'; import logger from '../logger.js'; /** * Register Get Context tool with MCP server * @param server - FastMCP server instance */ export function registerGetContextTool(server) { server.addTool({ name: 'get-context', description: 'Get context for a task. Reads <context-id>-context.yaml file from the .contextcompose directory. Combines prompts from all files in the jobs section (workflow, rules, mcps, notify, issue, and other custom sections) to provide context for AI development. The projectRoot parameter must specify the project root directory. The enhancedPrompt option allows you to choose whether to use detailed guidelines.', parameters: GetContextToolSchema, execute: async (args) => { try { logger.info('Executing Get Context tool', args); // Use shared business logic const result = await executeGetContextTool(args); logger.info('Get Context tool completed', { result }); return JSON.stringify(result); } catch (error) { logger.error('Error occurred while executing Get Context tool', { error: error instanceof Error ? error.message : String(error), }); throw error; } }, }); } //# sourceMappingURL=get-context.js.map