Skip to main content
Glama
JoodasCode

SlopWatch MCP Server

slopwatch_claim_and_verify

Register AI implementation claims and verify actual code changes in one step to track promises versus delivered work.

Instructions

Register claim and verify implementation in one call - reduces from 2 tool calls to 1

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
claimYesWhat you implemented
originalFileContentsYesOriginal content of files before implementation (filename -> content)
updatedFileContentsYesUpdated content of files after implementation (filename -> content)

Implementation Reference

  • Primary handler for slopwatch_claim_and_verify tool. Registers claim with file snapshots, calls analysis, stores results, and returns verification status with confidence.
    async handleClaimAndVerify(args) {
      const { claim, originalFileContents, updatedFileContents } = args;
      
      const claimId = Math.random().toString(36).substr(2, 9);
      
      // Create file snapshots from provided content
      const fileSnapshots = {};
      const fileList = Object.keys(originalFileContents);
      
      for (const [filename, content] of Object.entries(originalFileContents)) {
        fileSnapshots[filename] = {
          hash: crypto.createHash('sha256').update(content || '').digest('hex'),
          content: content || '',
          exists: true
        };
      }
      
      const claimRecord = {
        id: claimId,
        claim,
        files: fileList,
        timestamp: new Date().toISOString(),
        status: 'pending',
        fileSnapshots
      };
    
      this.claims.set(claimId, claimRecord);
    
      // Track claim registration
      analytics.trackClaim(claimId, fileList.length, fileList.length > 0);
    
      try {
        const result = await this.analyzeImplementation(claimRecord, updatedFileContents);
        
        // Store verification result
        claimRecord.status = result.isVerified ? 'verified' : 'failed';
        this.verificationResults.push({
          ...result,
          claimId,
          timestamp: new Date().toISOString(),
          claim: claimRecord.claim
        });
    
        // Track verification
        analytics.trackVerification(claimId, result.isVerified, result.confidence);
    
        const statusEmoji = result.isVerified ? '✅' : '❌';
        const statusText = result.isVerified ? 'PASSED' : 'FAILED';
        
        return {
          content: [
            {
              type: 'text',
              text: `${statusEmoji} ${statusText} (${result.confidence}%)`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `❌ Error: ${error.message}`
            }
          ]
        };
      }
    }
  • Input schema defining the parameters for the slopwatch_claim_and_verify tool: claim string and before/after file contents objects.
    inputSchema: {
      type: 'object',
      properties: {
        claim: {
          type: 'string',
          description: 'What you implemented'
        },
        originalFileContents: {
          type: 'object',
          description: 'Original content of files before implementation (filename -> content)',
          additionalProperties: { type: 'string' }
        },
        updatedFileContents: {
          type: 'object',
          description: 'Updated content of files after implementation (filename -> content)',
          additionalProperties: { type: 'string' }
        }
      },
      required: ['claim', 'originalFileContents', 'updatedFileContents']
    }
  • Tool registration in the ListTools response, including name, description, and input schema.
    {
      name: 'slopwatch_claim_and_verify',
      description: 'Register claim and verify implementation in one call - reduces from 2 tool calls to 1',
      inputSchema: {
        type: 'object',
        properties: {
          claim: {
            type: 'string',
            description: 'What you implemented'
          },
          originalFileContents: {
            type: 'object',
            description: 'Original content of files before implementation (filename -> content)',
            additionalProperties: { type: 'string' }
          },
          updatedFileContents: {
            type: 'object',
            description: 'Updated content of files after implementation (filename -> content)',
            additionalProperties: { type: 'string' }
          }
        },
        required: ['claim', 'originalFileContents', 'updatedFileContents']
      }
    },
  • Dispatch registration in the CallToolRequestSchema handler switch statement, routing to the specific handler.
    switch (name) {
      case 'slopwatch_claim_and_verify':
        return await this.handleClaimAndVerify(args);
  • Helper function performing the core verification logic: hashes files, detects changes, extracts keywords from claim, computes confidence score based on changes and keyword matches.
    async analyzeImplementation(claimRecord, updatedFileContents) {
      const { claim, files, fileSnapshots } = claimRecord;
      
      // If no files specified in original claim, but we have updated content, use those files
      const filesToCheck = files.length > 0 ? files : Object.keys(updatedFileContents);
      
      if (filesToCheck.length === 0) {
        return {
          isVerified: false,
          confidence: 0,
          details: 'No files specified for verification',
          analysis: 'Cannot verify implementation without file content'
        };
      }
    
      let changedFiles = 0;
      let totalFiles = filesToCheck.length;
      let analysisDetails = [];
      let keywordMatches = 0;
    
      // Extract keywords from the claim
      const keywords = this.extractKeywords(claim);
      
      for (const filename of filesToCheck) {
        const updatedContent = updatedFileContents[filename] || '';
        const currentHash = crypto.createHash('sha256').update(updatedContent).digest('hex');
        
        const snapshot = fileSnapshots[filename];
        if (!snapshot) {
          // If no snapshot exists, treat empty string as original content
          const originalHash = crypto.createHash('sha256').update('').digest('hex');
          if (originalHash !== currentHash && updatedContent.length > 0) {
            changedFiles++;
            
            // Analyze content for keywords
            const foundKeywords = keywords.filter(keyword => 
              updatedContent.toLowerCase().includes(keyword.toLowerCase())
            );
            
            keywordMatches += foundKeywords.length;
            
            analysisDetails.push(
              `✅ ${filename}: New file created (${foundKeywords.length} keywords found: ${foundKeywords.join(', ')})`
            );
          } else {
            analysisDetails.push(`❌ ${filename}: No content provided`);
          }
          continue;
        }
    
        // Check if file was modified
        if (snapshot.hash !== currentHash) {
          changedFiles++;
          
          // Analyze content changes for keywords
          const addedContent = this.getAddedContent(snapshot.content || '', updatedContent);
          const foundKeywords = keywords.filter(keyword => 
            addedContent.toLowerCase().includes(keyword.toLowerCase())
          );
          
          keywordMatches += foundKeywords.length;
          
          analysisDetails.push(
            `✅ ${filename}: Modified (${foundKeywords.length} keywords found: ${foundKeywords.join(', ')})`
          );
        } else {
          analysisDetails.push(`❌ ${filename}: No changes detected`);
        }
      }
    
      // Calculate confidence based on multiple factors
      const fileChangeScore = (changedFiles / totalFiles) * 60; // 60% weight for file changes
      const keywordScore = Math.min((keywordMatches / keywords.length) * 40, 40); // 40% weight for keyword matches
      const confidence = Math.round(fileChangeScore + keywordScore);
      
      const isVerified = confidence >= 50; // Require at least 50% confidence
      
      return {
        isVerified,
        confidence,
        details: isVerified ? 
          `Implementation verified: ${changedFiles}/${totalFiles} files modified, ${keywordMatches}/${keywords.length} keywords found` :
          `Implementation failed: ${changedFiles}/${totalFiles} files modified, ${keywordMatches}/${keywords.length} keywords found`,
        analysis: analysisDetails.join('\n')
      };
    }
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. It states the tool performs 'register claim and verify implementation', which suggests a mutation operation, but doesn't disclose any behavioral traits such as side effects, error handling, permissions required, or what 'verification' entails. The description is too brief to provide meaningful context beyond the basic operation.

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 extremely concise with only one sentence that directly states the tool's purpose and benefit. It is front-loaded with no wasted words, making it easy to parse quickly. Every part of the sentence earns its place by conveying key information efficiently.

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 implied by a combined 'register and verify' operation with 3 parameters (including nested objects) and no annotations or output schema, the description is insufficient. It lacks details on what the tool actually does, how verification works, what happens on success/failure, or any domain context. The description does not compensate for the missing structured data, making it incomplete for effective use.

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%, with clear descriptions for all 3 parameters (claim, originalFileContents, updatedFileContents). The description adds no additional parameter semantics beyond what the schema provides, such as format details or examples. Given the high schema coverage, the baseline score of 3 is appropriate as the schema handles the documentation adequately.

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

Purpose3/5

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

The description states the tool 'registers claim and verifies implementation in one call', which indicates a combined operation. However, it's vague about what 'claim' and 'verification' specifically entail, and it doesn't clearly distinguish this tool from its siblings (slopwatch_setup_rules, slopwatch_status) beyond mentioning it reduces from 2 tool calls to 1. The purpose is understandable but lacks specificity about the resource or domain context.

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 mentions that this tool 'reduces from 2 tool calls to 1', implying it should be used as a combined alternative to separate operations. However, it doesn't specify what those 2 tool calls are, when to prefer this over them, or any prerequisites. No explicit when/when-not guidance or alternatives are provided, leaving usage context unclear.

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/JoodasCode/SlopWatch'

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