Skip to main content
Glama

Audit HUMMBL Model References

audit_model_references

Audit HUMMBL model references to verify existence, transformation alignment, and identify duplicates.

Instructions

Audit a list of HUMMBL model references for existence, transformation alignment, and duplicates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodologyIdYes
documentVersionYes
totalReferencesYes
validCountYes
invalidCountYes
issuesYes

Implementation Reference

  • The core audit logic that validates model codes against HUMMBL Base120: checks for existence (NotFound), transformation alignment (WrongTransformation), and duplicates (Duplicate). Returns a MethodologyAuditResult.
    export function auditModelCodes(
      items: AuditInputItem[]
    ): Result<MethodologyAuditResult, DomainError> {
      if (items.length === 0) {
        return err({
          type: "ValidationError",
          field: "codes",
          message: "At least one model code must be provided for audit.",
        });
      }
    
      const normalizedItems = items.map((item) => ({
        code: item.code.toUpperCase(),
        expectedTransformation: item.expectedTransformation,
      }));
    
      const issues: ModelReferenceIssue[] = [];
      let validCount = 0;
    
      const seen = new Map<string, number>();
    
      for (const item of normalizedItems) {
        const currentCount = seen.get(item.code) ?? 0;
        seen.set(item.code, currentCount + 1);
      }
    
      for (const item of normalizedItems) {
        const modelResult = getModelByCode(item.code);
    
        if (!modelResult.ok) {
          issues.push({
            code: item.code,
            issueType: "NotFound",
            message: `Model code '${item.code}' was not found in HUMMBL Base120.`,
          });
          continue;
        }
    
        validCount += 1;
    
        const model = modelResult.value;
    
        const owningTransformationKey = findTransformationKeyForModel(model.code);
    
        if (item.expectedTransformation && owningTransformationKey) {
          if (owningTransformationKey !== item.expectedTransformation) {
            issues.push({
              code: item.code,
              issueType: "WrongTransformation",
              message: `Model '${item.code}' belongs to transformation '${owningTransformationKey}', not '${item.expectedTransformation}'.`,
              expectedTransformation: item.expectedTransformation,
              actualTransformation: owningTransformationKey,
            });
          }
        }
    
        const count = seen.get(item.code) ?? 0;
        if (count > 1) {
          issues.push({
            code: item.code,
            issueType: "Duplicate",
            message: `Model code '${item.code}' appears ${count} times in the provided references.`,
          });
        }
      }
    
      const totalReferences = normalizedItems.length;
      const invalidCount = issues.length;
    
      const result: MethodologyAuditResult = {
        methodologyId: METHODOLOGY_ID,
        documentVersion: METHODOLOGY_VERSION,
        totalReferences,
        validCount,
        invalidCount,
        issues,
      };
    
      return ok(result);
    }
  • MCP tool registration for 'audit_model_references' with inputSchema (array of {code, expectedTransformation}) and outputSchema (methodologyId, counts, issues).
    server.registerTool(
      "audit_model_references",
      {
        title: "Audit HUMMBL Model References",
        description:
          "Audit a list of HUMMBL model references for existence, transformation alignment, and duplicates.",
        inputSchema: z.object({
          items: z
            .array(
              z.object({
                code: z.string().min(2).describe("Model code, e.g., IN11, CO4"),
                expectedTransformation: z
                  .enum(["P", "IN", "CO", "DE", "RE", "SY"])
                  .optional()
                  .describe("Optional expected transformation key for this reference"),
              })
            )
            .min(1),
        }),
        outputSchema: z.object({
          methodologyId: z.string(),
          documentVersion: z.string(),
          totalReferences: z.number(),
          validCount: z.number(),
          invalidCount: z.number(),
          issues: z.array(
            z.object({
              code: z.string(),
              issueType: z.enum(["NotFound", "WrongTransformation", "Duplicate", "Unknown"]),
              message: z.string(),
              expectedTransformation: z.string().optional(),
              actualTransformation: z.string().optional(),
            })
          ),
        }),
  • Helper function findTransformationKeyForModel that scans all transformations to find which one owns a given model code, used during transformation alignment checking.
    function findTransformationKeyForModel(code: string): TransformationType | undefined {
      const transformationResult = getTransformationByKeyForModel(code);
      if (!transformationResult.ok) {
        return undefined;
      }
      return transformationResult.value;
    }
    
    function getTransformationByKeyForModel(code: string): Result<TransformationType, DomainError> {
      // We scan transformations to find which one owns this model.
      // Using base120 helpers keeps all logic in the framework layer.
      const possibleKeys: TransformationType[] = ["P", "IN", "CO", "DE", "RE", "SY"];
    
      for (const key of possibleKeys) {
        const transResult = getTransformationByKey(key);
        if (!transResult.ok) {
          continue;
        }
        const transformation = transResult.value;
        if (transformation.models.some((m) => m.code === code)) {
          return ok(key);
        }
      }
    
      return err({
        type: "NotFound",
        entity: "Transformation",
        code,
      });
    }
  • Type definitions supporting the audit: DialecticalMethodology, ModelReferenceIssue, ModelReferenceIssueType, MethodologyAuditResult, and AuditInputItem interface.
    export interface DialecticalMethodology {
      id: string;
      title: string;
      version: string;
      summary: string;
      documentUrl?: string;
      totalPages?: number;
      modelsReferenced: string[];
      stages: StageModelMapping[];
      metaModels: string[];
    }
    
    export type ModelReferenceIssueType = "NotFound" | "WrongTransformation" | "Duplicate" | "Unknown";
    
    export interface ModelReferenceIssue {
      code: string;
      issueType: ModelReferenceIssueType;
      message: string;
      expectedTransformation?: TransformationType;
      actualTransformation?: TransformationType;
    }
    
    export interface MethodologyAuditResult {
      methodologyId: string;
      documentVersion: string;
      totalReferences: number;
      validCount: number;
      invalidCount: number;
      issues: ModelReferenceIssue[];
    }
    
    /**
     * Domain-wide error type for HUMMBL Base120 operations.
     */
    export type DomainError =
      | { type: "NotFound"; entity: string; code?: string }
      | { type: "ValidationError"; field?: string; message: string }
      | { type: "Conflict"; entity: string; message: string }
      | { type: "Internal"; message: string }
      | { type: "Unknown"; message: string };
    
    /**
     * Result type for type-safe error handling (Railway-Oriented Programming).
     * Uses an `ok` discriminant to align with HUMMBL global patterns.
     */
    export type Result<T, E = DomainError> = { ok: true; value: T } | { ok: false; error: E };
    
    export const ok = <T>(value: T): Result<T, never> => ({
      ok: true,
      value,
    });
    
    export const err = <E>(error: E): Result<never, E> => ({
      ok: false,
      error,
    });
    
    /**
     * Type guard for Result success case.
     */
    export function isOk<T, E>(result: Result<T, E>): result is { ok: true; value: T } {
      return result.ok === true;
    }
    
    /**
     * Type guard for Result error case.
     */
    export function isErr<T, E>(result: Result<T, E>): result is { ok: false; error: E } {
      return result.ok === false;
    }
    
    export function isNotFoundError(
      error: DomainError
    ): error is Extract<DomainError, { type: "NotFound" }> {
      return error.type === "NotFound";
    }
    
    /**
     * API Key tiers with rate limits and permissions
     */
    export type ApiKeyTier = "free" | "pro" | "enterprise";
    
    export interface ApiKeyInfo {
      id: string;
      key: string;
      tier: ApiKeyTier;
      name: string;
      createdAt: string;
      lastUsed?: string;
      usageCount: number;
      rateLimit: {
        requestsPerHour: number;
        requestsPerDay: number;
      };
      permissions: readonly string[];
      isActive: boolean;
    }
    
    /**
     * Authentication result types
     */
    export type AuthResult = Result<ApiKeyInfo, AuthError>;
    
    export type AuthError =
      | { type: "MISSING_AUTH"; message: string }
      | { type: "INVALID_FORMAT"; message: string }
      | { type: "KEY_NOT_FOUND"; message: string }
      | { type: "KEY_INACTIVE"; message: string }
      | { type: "RATE_LIMIT_EXCEEDED"; message: string }
      | { type: "INTERNAL_ERROR"; message: string };
    
    /**
     * Workflow types for guided multi-turn problem solving
     */
    
    export type WorkflowType = "root_cause_analysis" | "strategy_design" | "decision_making";
    
    export interface WorkflowStep {
      stepNumber: number;
      transformation: TransformationType;
      models: string[]; // Model codes to apply
      guidance: string; // What to do in this step
      questions: string[]; // Prompts to guide thinking
      expectedOutput: string; // What should result from this step
    }
    
    export interface WorkflowTemplate {
      name: WorkflowType;
      displayName: string;
      description: string;
      problemTypes: string[]; // When to use this workflow
      steps: WorkflowStep[];
      estimatedDuration: string; // e.g., "15-30 minutes"
    }
    
    export interface WorkflowState {
      workflowName: WorkflowType;
      currentStep: number;
      totalSteps: number;
      startedAt: string;
      lastUpdatedAt: string;
      completed: boolean;
      stepResults: Record<number, string>; // User's insights from each step
    }
    
    export interface WorkflowProgress {
      workflow: WorkflowType;
      displayName: string;
      currentStep: number;
      totalSteps: number;
      transformation: TransformationType;
      guidance: string;
      suggestedModels: string[];
      questions: string[];
      nextAction: string;
      canResume: boolean;
    }
  • src/server.ts:19-27 (registration)
    Server initialization that calls registerMethodologyTools(server) to register the audit_model_references tool on the MCP server.
    export function createServer(): McpServer {
      const server = new McpServer({
        name: "hummbl-mcp-server",
        version: SERVER_VERSION,
      });
    
      // Register all tools
      registerModelTools(server);
      registerMethodologyTools(server);
Behavior2/5

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

With no annotations, the description carries the burden of behavioral disclosure. It mentions checking existence, alignment, and duplicates, but does not disclose side effects, error handling, or whether it is read-only. The transparency is minimal.

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, fully front-loaded sentence. It is appropriately sized with no fluff or redundancy.

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?

The tool has a nested parameter and an output schema, but the description does not mention the return value, error scenarios, or any prerequisites. Information is incomplete for an agent to understand the tool's full behavior.

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

Parameters1/5

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

The description does not explain any parameters. The input schema has a complex nested structure, but the description adds no meaning beyond what the schema provides. Given low schema description coverage, this is a significant gap.

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

Purpose5/5

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

The description clearly states the action (audit), the resource (HUMMBL model references), and the scope (existence, transformation alignment, duplicates). It is specific and distinguishes from sibling tools like get_model or list_all_models.

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

Usage Guidelines3/5

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

The description implies usage when one has a list of model references to check, but it does not provide explicit when-to-use or when-not-to-use guidance, nor does it mention alternatives.

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/hummbl-dev/mcp-server'

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