Skip to main content
Glama

refactor_workflow

Initiate a structured refactoring workflow to enhance code quality while preserving functionality. Define the task, scope, and constraints for targeted, verified improvements.

Instructions

Start a structured refactoring workflow to improve existing code without changing functionality

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextNoAdditional context (optional)
taskYesDescription of what you want to refactor

Implementation Reference

  • The handleRefactorWorkflow function implements the core execution logic for the 'refactor_workflow' tool by calling executeWorkflow with workflowType: 'refactor'.
    export async function handleRefactorWorkflow( params: { task: string; context?: any }, sessionManager: SessionManager ) { return executeWorkflow( { task: params.task, workflowType: 'refactor', context: params.context }, sessionManager ); }
  • The createRefactorWorkflowTool function returns the Tool object defining the name 'refactor_workflow', description, and inputSchema with required 'task' and optional 'context'.
    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'] } }; }
  • src/index.ts:13-13 (registration)
    Import of the tool creator (createRefactorWorkflowTool) and handler (handleRefactorWorkflow) functions.
    import { createRefactorWorkflowTool, handleRefactorWorkflow } from './tools/refactorWorkflow.js';
  • src/index.ts:139-139 (registration)
    The tool is registered in the main tools array by calling createRefactorWorkflowTool().
    createRefactorWorkflowTool(), // Refactoring workflow
  • src/index.ts:226-232 (registration)
    Dispatch registration: switch case for 'refactor_workflow' invokes the handler function.
    case 'refactor_workflow': return { content: [{ type: 'text', text: JSON.stringify(await handleRefactorWorkflow(args as any, sessionManager), null, 2) }] };

Latest Blog Posts

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