Skip to main content
Glama

track_document_work

Track development work to identify required documentation updates, ensuring code changes align with project documentation requirements.

Instructions

Track the relationship between development work and documentation requirements

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workTypeYesType of development work
workDescriptionYesDescription of the work being done
filePathsYesFile paths involved in the work
expectedDocumentsNoExpected documentation to be updated

Implementation Reference

  • The main handler function that executes the track_document_work tool. It logs the work, finds relevant documents, creates a work-document connection, optionally performs AI analysis to update connection strength, checks for missing docs, and returns a success response with details.
    tools.set('track_document_work', async (args: any) => {
      try {
        logger.info(`Tracking work: ${args.workType} - ${args.workDescription}`);
        
        // Find relevant existing documents
        const relevantDocs = await findRelevantDocuments(args.workType, args.filePaths, lifecycleService);
        
        // Create work-document connection
        const connection = await connectionService.createConnection({
          workType: args.workType,
          workDescription: args.workDescription,
          filePaths: args.filePaths,
          connectedDocuments: relevantDocs.map(doc => doc.id),
          connectionStrength: 0.8, // Will be updated by AI analysis
          lastSyncedAt: dateTimeService.getCurrentTimestamp()
        });
        
        // Perform AI analysis if enabled
        let aiInsights: string[] = [];
        if (config.ai.enabled && aiService) {
          const analysis = await aiService.calculateRelevance(
            args.filePaths.join(', '), 
            args.workDescription
          );
          aiInsights = analysis.insights;
          
          // Update connection strength based on AI analysis
          await connectionService.updateConnectionStrength(
            connection.id, 
            analysis.score
          );
        }
        
        // Check for missing documentation
        const missingDocs = args.expectedDocuments 
          ? args.expectedDocuments.filter((doc: string) => !relevantDocs.find(existing => existing.title.includes(doc)))
          : [];
        
        return {
          success: true,
          connectionId: connection.id,
          connectedDocuments: relevantDocs.length,
          connectionStrength: Math.round(connection.connectionStrength * 100),
          aiInsights,
          missingDocs,
          message: `Work-document connection tracked successfully`
        };
      } catch (error) {
        logger.error('Failed to track document work:', error);
        throw error;
      }
    });
  • Zod input schema for validating arguments to the track_document_work tool, defining workType enum, required description and filePaths, optional expectedDocuments.
    export const TrackDocumentWorkSchema = z.object({
      workType: z.enum(['frontend', 'backend', 'database', 'electron', 'testing', 'deployment']),
      workDescription: z.string(),
      filePaths: z.array(z.string()),
      expectedDocuments: z.array(z.string()).optional(),
    });
  • MCPTool definition object registering the track_document_work tool with name, description, and JSON schema for input validation, returned by registerEnhancedTools.
    {
      name: 'track_document_work',
      description: 'Track the relationship between development work and documentation requirements',
      inputSchema: {
        type: 'object',
        properties: {
          workType: {
            type: 'string',
            enum: ['frontend', 'backend', 'database', 'electron', 'testing', 'deployment'],
            description: 'Type of development work'
          },
          workDescription: {
            type: 'string',
            description: 'Description of the work being done'
          },
          filePaths: {
            type: 'array',
            items: { type: 'string' },
            description: 'File paths involved in the work'
          },
          expectedDocuments: {
            type: 'array',
            items: { type: 'string' },
            description: 'Expected documentation to be updated'
          }
        },
        required: ['workType', 'workDescription', 'filePaths']
      }
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Track' suggests a read-only or monitoring operation, but the description doesn't clarify whether this creates records, updates existing ones, or merely logs information. It also omits details like authentication needs, rate limits, or what the tool actually returns (since there's no output schema). For a tool with 4 parameters and no annotations, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly. Every part of the sentence earns its place by conveying essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (4 parameters, no annotations, no output schema, and 15 sibling tools), the description is incomplete. It doesn't explain what the tool returns, how it differs from siblings, or the behavioral implications of 'tracking' (e.g., whether it's idempotent or has side effects). For a tool in this context, more detail is needed to guide effective agent usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, meaning all parameters are documented in the schema itself. The description adds no additional meaning about the parameters beyond what's in the schema (e.g., it doesn't explain how 'workType' relates to 'expectedDocuments' or provide examples). With high schema coverage, the baseline score is 3, as the description doesn't need to compensate but also doesn't enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Track the relationship between development work and documentation requirements.' It specifies the verb ('track') and the resource ('relationship between development work and documentation requirements'), which is more specific than just restating the name. However, it doesn't explicitly distinguish this tool from its many siblings (e.g., docs_update, generate_documentation_report), which would require a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With 15 sibling tools on the server (including docs_update, generate_documentation_report, and update_document_lifecycle), there's no indication of when tracking relationships is appropriate versus updating documents directly or generating reports. This leaves the agent without context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/Ghostseller/CastPlan_mcp'

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