Skip to main content
Glama
refactorWorkflow.ts•1.57 kB
import { Tool } from '@modelcontextprotocol/sdk/types.js'; import { SessionManager } from '../session/SessionManager'; import { executeWorkflow } from '../workflows/WorkflowHandler'; export function createRefactorWorkflowTool(): Tool { return { name: 'refactor_workflow', description: 'Start a structured refactoring workflow to improve existing code without changing functionality', inputSchema: { type: 'object', properties: { task: { type: 'string', description: 'Description of what you want to refactor' }, context: { type: 'object', description: 'Additional context (optional)', properties: { targetFiles: { type: 'array', items: { type: 'string' }, description: 'Specific files to refactor' }, scope: { type: 'string', enum: ['file', 'directory', 'project'], description: 'The scope of the refactoring' }, constraints: { type: 'array', items: { type: 'string' }, description: 'Any constraints or requirements' } } } }, required: ['task'] } }; } export async function handleRefactorWorkflow( params: { task: string; context?: any }, sessionManager: SessionManager ) { return executeWorkflow( { task: params.task, workflowType: 'refactor', context: params.context }, sessionManager ); }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kingdomseed/structured-workflow-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server