Skip to main content
Glama

create_goal

Define software development objectives for project management, specifying goals and repository names to structure task workflows.

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 handler for the 'create_goal' tool call. It extracts the description and repoName from arguments, creates the goal using storage, sets the current goal, creates an initial plan, and returns the goal ID in the response.
    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/index.ts:40-57 (registration)
    Registration of the 'create_goal' tool in the ListTools response, including its name, description, and input schema definition.
    { 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'], }, },
  • JSON schema defining the input parameters for the 'create_goal' tool: description (required string) and optional repoName (string).
    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'], },
  • Helper function in storage that implements the core logic for creating a new Goal: generates ID, persists to LokiDB goals collection, initializes task ID metadata for the goal, saves the DB, 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; }

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