Skip to main content
Glama

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
NameRequiredDescriptionDefault
descriptionYesThe software development goal description (string)
repoNameNoPlease give the name of the project that you are currently working on (string)

Implementation Reference

  • 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; }
  • 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 }), }, ], }; }
  • TypeScript interface defining the structure of a Goal object used by createGoal.
    export interface Goal { id: number; repoName: string; description: string; createdAt: string; }

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/hrishirc/task-orchestrator'

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