Skip to main content
Glama
noodlemctwoodle

Sentinel Solutions MCP Server

validate_connector

Validates a connector JSON definition and extracts associated Log Analytics tables for Microsoft Sentinel integration.

Instructions

Validate a connector JSON definition and extract tables

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the validate_connector tool. Parses connector JSON, validates required fields (id, title), extracts tables using extractTablesFromConnector, and returns validation result with errors, warnings, and extracted tables.
    export const validateConnectorTool = {
      name: 'validate_connector',
      description: 'Validate a connector JSON definition and extract tables',
      inputSchema: z.object({
        connector_json: z.string().describe('Connector JSON content to validate'),
      }),
      execute: async (args: { connector_json: string }): Promise<ValidationResult> => {
        const errors: string[] = [];
        const warnings: string[] = [];
        const extractedTables: string[] = [];
    
        // Try to parse JSON
        const parseResult = parseJsonTolerant(args.connector_json);
    
        if (parseResult.error || !parseResult.data) {
          errors.push(parseResult.error || 'Failed to parse JSON');
          return { isValid: false, errors, warnings, extractedTables };
        }
    
        const connector = parseResult.data;
    
        // Validate required fields
        if (!connector.id) {
          errors.push('Missing required field: id');
        }
    
        if (!connector.title) {
          warnings.push('Missing recommended field: title');
        }
    
        // Extract tables
        try {
          const extraction = extractTablesFromConnector(connector);
    
          extraction.tables.forEach((_, tableName) => {
            extractedTables.push(tableName);
          });
    
          if (extractedTables.length === 0 && extraction.parserReferences.size === 0) {
            warnings.push('No table references found in connector definition');
          }
    
          if (extraction.parserReferences.size > 0) {
            warnings.push(
              `Parser references found (not resolved): ${Array.from(extraction.parserReferences).join(', ')}`
            );
          }
        } catch (error) {
          errors.push(`Error extracting tables: ${error}`);
        }
    
        return {
          isValid: errors.length === 0,
          errors,
          warnings,
          extractedTables,
        };
      },
    };
  • Type definition for the validation result returned by validate_connector tool.
    export interface ValidationResult {
      isValid: boolean;
      errors: string[];
      warnings: string[];
      extractedTables: string[];
    }
  • Registration of validateConnectorTool in the solutionTools array.
    export const solutionTools = [
      analyzeSolutionsTool,
      getConnectorTablesTool,
      searchSolutionsTool,
      getSolutionDetailsTool,
      listTablesTool,
      validateConnectorTool,
    ];
  • Helper used by validate_connector to parse connector JSON with tolerance for comments and trailing commas.
    export function parseJsonTolerant<T = any>(content: string): JsonParseResult<T> {
      // Strategy 1: Standard JSON.parse
      try {
        const data = JSON.parse(content);
        return { data };
      } catch (error) {
        // Continue to fallback strategies
      }
    
      // Strategy 2: Strip JavaScript-style comments (preserving URLs)
      try {
        const withoutComments = stripComments(content);
        const data = JSON.parse(withoutComments);
        return { data };
      } catch (error) {
        // Continue to fallback strategies
      }
    
      // Strategy 3: Remove trailing commas
      try {
        const withoutTrailingCommas = removeTrailingCommas(content);
        const data = JSON.parse(withoutTrailingCommas);
        return { data };
      } catch (error) {
        // Continue to fallback strategies
      }
    
      // Strategy 4: Combined - strip comments AND remove trailing commas
      try {
        const cleaned = removeTrailingCommas(stripComments(content));
        const data = JSON.parse(cleaned);
        return { data };
      } catch (error) {
        return {
          error: `Failed to parse JSON after all attempts: ${error}`,
        };
      }
    }
  • Helper used by validate_connector to extract tables from the connector definition using 6 detection methods.
    export function extractTablesFromConnector(
      connector: ConnectorDefinition
    ): ExtractionResult {
      const tables = new Map<string, string>();
      const parserReferences = new Set<string>();
      const variables: Record<string, string> = {};
    
      // Extract ARM template variables first
      extractVariables(connector, variables);
    
      // Method 1: graphQueries.{index}.baseQuery
      if (connector.graphQueries) {
        connector.graphQueries.forEach((query, index) => {
          if (query.baseQuery) {
            const extracted = extractTablesFromQuery(query.baseQuery, variables);
            extracted.forEach((table) => {
              const method = `graphQueries.${index}.baseQuery`;
              recordTable(tables, table, method, parserReferences);
            });
          }
        });
      }
    
      // Method 2: sampleQueries.{index}.query
      if (connector.sampleQueries) {
        connector.sampleQueries.forEach((query, index) => {
          if (query.query) {
            const extracted = extractTablesFromQuery(query.query, variables);
            extracted.forEach((table) => {
              const method = `sampleQueries.${index}.query`;
              recordTable(tables, table, method, parserReferences);
            });
          }
        });
      }
    
      // Method 3: dataTypes.{index}.lastDataReceivedQuery
      if (connector.dataTypes) {
        connector.dataTypes.forEach((dataType, index) => {
          if (dataType.lastDataReceivedQuery) {
            const extracted = extractTablesFromQuery(
              dataType.lastDataReceivedQuery,
              variables
            );
            extracted.forEach((table) => {
              const method = `dataTypes.${index}.lastDataReceivedQuery`;
              recordTable(tables, table, method, parserReferences);
            });
          }
        });
      }
    
      // Method 4: connectivityCriterias.{index}.value
      if (connector.connectivityCriterias) {
        connector.connectivityCriterias.forEach((criteria, index) => {
          if (criteria.value) {
            const values = Array.isArray(criteria.value)
              ? criteria.value
              : [criteria.value];
    
            values.forEach((value) => {
              if (typeof value === 'string') {
                const extracted = extractTablesFromQuery(value, variables);
                extracted.forEach((table) => {
                  const method = `connectivityCriterias.${index}.value`;
                  recordTable(tables, table, method, parserReferences);
                });
              }
            });
          }
        });
      }
    
      // Method 5: ARM template logAnalyticsTableId variable
      if (variables.logAnalyticsTableId) {
        const method = 'variables.logAnalyticsTableId';
        recordTable(tables, variables.logAnalyticsTableId, method, parserReferences);
      }
    
      // Method 6: Parser function references
      // Note: Actual parser resolution happens in parserResolver.ts
      // Here we just identify potential parser references
    
      return { tables, parserReferences, variables };
    }
Behavior2/5

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

No annotations are provided, and the description only states the basic action. It fails to disclose behavioral traits such as what happens on invalid input, side effects, or limitations.

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

Conciseness4/5

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

The description is a single concise sentence with no wasted words. However, it could be slightly enriched to improve structure.

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 lack of output schema and annotations, the description is minimal. It does not explain what 'extract tables' means or what the return value looks like, leaving gaps.

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 coverage is 100% with a single parameter. The description adds 'connector JSON definition' which is slightly more descriptive but essentially repeats the schema. Baseline score is appropriate.

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 action (validate) and the resource (connector JSON definition), and mentions an additional function (extract tables). It distinguishes itself from siblings like list_data_connectors and get_connector_tables.

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?

No guidance on when to use this tool versus alternatives. It does not specify prerequisites or context, leaving the agent to infer.

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/noodlemctwoodle/sentinel-solutions-mcp'

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