Skip to main content
Glama

tracker_init

Initialize project tracking in Saga MCP by setting up or accessing a structured database for tasks, epics, and decisions across sessions.

Instructions

Initialize the tracker for a project. If the database is empty, creates a project with the given name. If a project already exists, returns its info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_nameNoName for a new project (only used if DB is empty)
project_descriptionNoDescription for the new project

Implementation Reference

  • The handleTrackerInit function handles the initialization logic for the tracker, including creating a new project if the database is empty.
    function handleTrackerInit(args: Record<string, unknown>) {
      const db = getDb();
    
      const existing = db.prepare('SELECT * FROM projects LIMIT 1').get();
      if (existing) {
        return {
          message: 'Tracker already initialized. Returning existing project.',
          project: existing,
        };
      }
    
      const projectName = args.project_name as string | undefined;
      if (!projectName) {
        return {
          message: 'Database is empty. Provide a project_name to create your first project.',
          projects: [],
        };
      }
    
      const description = (args.project_description as string) ?? null;
      const project = db
        .prepare('INSERT INTO projects (name, description) VALUES (?, ?) RETURNING *')
        .get(projectName, description);
    
      const row = project as Record<string, unknown>;
      logActivity(db, 'project', row.id as number, 'created', null, null, null, `Project '${projectName}' initialized`);
    
      return {
        message: `Project '${projectName}' created. Use epic_create to start adding work.`,
        project,
      };
    }
  • Tool definition for 'tracker_init' including input schema.
    {
      name: 'tracker_init',
      description:
        'Initialize the tracker for a project. If the database is empty, creates a project with the given name. If a project already exists, returns its info.',
      annotations: { title: 'Initialize Tracker', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          project_name: { type: 'string', description: 'Name for a new project (only used if DB is empty)' },
          project_description: { type: 'string', description: 'Description for the new project' },
        },
      },
    },
  • Registration of the 'tracker_init' tool in the handlers mapping.
    export const handlers: Record<string, ToolHandler> = {
      tracker_dashboard: handleDashboard,
      tracker_init: handleTrackerInit,
    };

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/spranab/saga-mcp'

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