create_goal
Define and manage software development goals by specifying descriptions and project names to streamline task organization and progress tracking in the Task Orchestration system.
Instructions
Create a new goal
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | The software development goal description (string) | |
| repoName | No | Please give the name of the project that you are currently working on (string) |
Implementation Reference
- src/storage.ts:101-125 (handler)The core handler function that creates a new Goal instance, inserts it into the LokiJS 'goals' collection, initializes per-goal task ID tracking in metadata, saves the database, strips internal Loki fields, and returns the Goal object.async createGoal(description: string, repoName: string): Promise<Goal> { const goal: Goal = { id: this.goals.count() + 1, repoName, description, createdAt: new Date().toISOString(), }; this.goals.insert(goal as LokiGoal); // Initialize nextTaskId for the new goal const metadataCollection = this.db.getCollection('metadata'); const metadata = metadataCollection.findOne({}); if (metadata) { if (!metadata.nextTaskId) { metadata.nextTaskId = {}; } metadata.nextTaskId[goal.id] = { root: 0 }; // Initialize root counter for the new goal metadataCollection.update(metadata); } await this.save(); const { $loki, meta, ...goalResponse } = goal as LokiGoal; return goalResponse; }
- src/index.ts:40-57 (schema)The tool registration including name, description, and input schema definition for 'create_goal' in the ListTools response.{ name: 'create_goal', description: 'Create a new goal', inputSchema: { type: 'object', properties: { description: { type: 'string', description: 'The software development goal description (string)', }, repoName: { type: 'string', description: 'Please give the name of the project that you are currently working on (string)', }, }, required: ['description'], }, },
- src/index.ts:199-213 (registration)The dispatch handler in the CallToolRequestSchema that extracts arguments, calls storage.createGoal, sets currentGoal, creates a plan, and returns the goal ID.case 'create_goal': { const { description, repoName } = request.params.arguments as { description: string; repoName: string }; const goal = await storage.createGoal(description, repoName); this.currentGoal = goal; await storage.createPlan(goal.id); return { content: [ { type: 'text', text: JSON.stringify({ goalId: goal.id }), }, ], }; }
- src/types.ts:22-27 (schema)TypeScript interface defining the structure of a Goal object used by createGoal.export interface Goal { id: number; repoName: string; description: string; createdAt: string; }