Skip to main content
Glama

create_next_step

Create and define a new project step with a title, description, priority, and dependencies to ensure structured task progression and efficient workflow management.

Instructions

Create a new next step in a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dependenciesNoIDs of steps that must be completed first
descriptionYesDetailed description of work
parentStepIdNoID of parent step if this is a substep
priorityYesImplementation priority level
projectIdYesProject identifier
titleYesBrief title of the next step

Implementation Reference

  • Core handler function in ProjectManager that validates the step, checks dependencies, creates the new NextStep object with ID and timestamps, appends to project data, and saves to storage.
    async createNextStep(projectId: string, step: Omit<NextStep, 'id' | 'created' | 'lastModified'>): Promise<NextStep> { this.validateTemplate('next_step', step); const data = await this.loadProjectData(projectId); const newStep: NextStep = { ...step, id: `step_${Date.now()}`, created: new Date().toISOString(), lastModified: new Date().toISOString(), }; // Validate dependencies exist if (step.dependencies?.length) { const missingDeps = step.dependencies.filter( depId => !data.nextSteps.some(s => s.id === depId) ); if (missingDeps.length > 0) { throw new ProjectError(`Dependencies not found: ${missingDeps.join(', ')}`, projectId); } } data.nextSteps.push(newStep); await this.saveProjectData(projectId, data); return newStep; }
  • src/index.ts:323-345 (registration)
    Tool registration in the listTools response, including name, description, and input schema definition.
    name: "create_next_step", description: "Create a new next step in a project", inputSchema: { type: "object", properties: { projectId: { type: "string", description: "Project identifier" }, title: { type: "string", description: "Brief title of the next step" }, description: { type: "string", description: "Detailed description of work" }, priority: { type: "string", enum: ["core-critical", "full-required", "enhancement"], description: "Implementation priority level" }, parentStepId: { type: "string", description: "ID of parent step if this is a substep" }, dependencies: { type: "array", items: { type: "string" }, description: "IDs of steps that must be completed first" } }, required: ["projectId", "title", "description", "priority"] } },
  • MCP CallToolRequest handler case that parses arguments, calls the ProjectManager.createNextStep method, and returns the result as text content.
    case "create_next_step": const step = await projectManager.createNextStep( args.projectId as string, { projectId: args.projectId as string, title: args.title as string, description: args.description as string, priority: args.priority as NextStep['priority'], parentStepId: args.parentStepId as string, dependencies: args.dependencies as string[] || [], status: 'open' } ); return { content: [{ type: "text", text: JSON.stringify(step, null, 2) }] };
  • Input schema definition for the create_next_step tool, specifying parameters, types, enums, and required fields.
    inputSchema: { type: "object", properties: { projectId: { type: "string", description: "Project identifier" }, title: { type: "string", description: "Brief title of the next step" }, description: { type: "string", description: "Detailed description of work" }, priority: { type: "string", enum: ["core-critical", "full-required", "enhancement"], description: "Implementation priority level" }, parentStepId: { type: "string", description: "ID of parent step if this is a substep" }, dependencies: { type: "array", items: { type: "string" }, description: "IDs of steps that must be completed first" } }, required: ["projectId", "title", "description", "priority"] }
  • Helper method used by createNextStep to validate required fields against templates for 'next_step' type.
    private validateTemplate(type: string, data: Record<string, any>): void { const template = HANDOFF_TEMPLATES[type]; if (!template) return; // Non-templated types are valid const missingFields = template.fields .filter(field => field.required) .filter(field => { const fieldName = field.name.toLowerCase().replace(/\s+/g, '_'); return !data[fieldName] && !data[field.name]; }); if (missingFields.length > 0) { throw new ProjectError( `Missing required fields for ${type}: ${missingFields.map(f => f.name).join(', ')}`, data.projectId || 'validation' ); } }

Other Tools

Related Tools

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/davidorex/project-handoffs'

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