Skip to main content
Glama
xiaolai
by xiaolai

track_concept_evolution

Analyze how a concept's definition changes throughout a manuscript's development to maintain consistency and track evolution.

Instructions

Track how a concept's definition evolved over time

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathNoPath to manuscript directory (defaults to current directory)
concept_nameYesName of the concept to track

Implementation Reference

  • MCP tool handler: extracts concept_name and limit from args, applies pagination limit, delegates to WritersAid.trackConceptEvolution
    private async trackConceptEvolution(args: Record<string, unknown>) {
      const conceptName = args.concept_name as string;
      const limit = resolvePaginationLimit("track_concept_evolution", args.limit as number | undefined);
    
      return this.writersAid.trackConceptEvolution({ conceptName, limit });
    }
  • Core tool logic: calls ConceptTracker.getConceptEvolution, handles not found case, applies limit slicing, formats response with version details
    trackConceptEvolution(options: { conceptName: string; limit?: number }) {
      const evolution = this.conceptTracker.getConceptEvolution(options.conceptName);
    
      if (!evolution) {
        return {
          conceptName: options.conceptName,
          found: false,
          message: "No versions found for this concept",
        };
      }
    
      // Trim versions to limit (default handled by pagination resolver in handler)
      const versionsToReturn = options.limit
        ? evolution.versions.slice(0, options.limit)
        : evolution.versions;
    
      return {
        conceptName: evolution.conceptName,
        found: true,
        versions: versionsToReturn.map((v) => ({
          versionNumber: v.versionNumber,
          definition: v.definition,
          filePath: v.filePath,
          timestamp: new Date(v.timestamp).toISOString(),
          changeRationale: v.changeRationale,
          commitHash: v.commitHash,
        })),
        totalVersions: evolution.totalVersions,
        changeCount: evolution.changeCount,
        firstDefinition: evolution.firstDefinition.definition,
        latestDefinition: evolution.latestDefinition.definition,
      };
    }
  • Input schema definition for the tool, specifying concept_name as required parameter
      name: "track_concept_evolution",
      description: "Track how a concept's definition evolved over time",
      inputSchema: {
        type: "object",
        properties: {
          project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" },
          concept_name: { type: "string", description: "Name of the concept to track" },
        },
        required: ["concept_name"],
      },
    },
  • Database-backed helper: retrieves all versions of a concept, sorts chronologically, computes evolution summary (first/latest defs, change count)
    getConceptEvolution(conceptName: string): ConceptEvolution | undefined {
      const versions = this.getConceptVersions(conceptName);
    
      if (versions.length === 0) {
        return undefined;
      }
    
      // Versions are sorted DESC, so reverse for chronological order
      const chronological = [...versions].reverse();
    
      return {
        conceptName,
        versions: chronological,
        totalVersions: versions.length,
        firstDefinition: chronological[0],
        latestDefinition: versions[0], // Latest is first in DESC order
        changeCount: versions.length - 1,
      };
    }
  • Pagination configuration defining default (10) and max (50) limits for track_concept_evolution tool, used by resolvePaginationLimit
    export const PAGINATION_DEFAULTS: Record<string, { default: number; max: number }> = {
      find_gaps: { default: 20, max: 100 },
      find_todos: { default: 50, max: 200 },
      find_duplicates: { default: 30, max: 100 },
      check_terminology: { default: 20, max: 50 },
      find_broken_links: { default: 50, max: 200 },
      track_concept_evolution: { default: 10, max: 50 },
      suggest_cross_references: { default: 25, max: 100 },
      analyze_link_graph: { default: 100, max: 500 },
    };

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/xiaolai/claude-writers-aid-mcp'

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