Skip to main content
Glama

validate_security_ssl_labs

Analyze SSL/TLS configuration and certificate security for websites using SSL Labs API to identify vulnerabilities and ensure proper encryption protocols.

Instructions

Analyze SSL/TLS configuration using SSL Labs. Comprehensive certificate and protocol analysis. Long-running (may take minutes).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
emailYesYour email (required by API)
maxAgeNoMax cached report age in hours
startNewNoForce new assessment
waitForCompleteNoWait for completion (default: false)
maxWaitMinutesNoMax wait time in minutes (default: 5)

Implementation Reference

  • Core handler function that performs the SSL Labs API call to analyze SSL/TLS configuration, processes the response, handles errors, and formats the result.
    export async function analyzeSSLLabs(
      url: string,
      options: SSLLabsOptions
    ): Promise<SSLLabsResult> {
      try {
        // Extract hostname from URL
        const hostname = new URL(url).hostname;
    
        // Build API URL with parameters
        const params = new URLSearchParams({
          host: hostname,
          all: options.all !== false ? 'on' : 'off',
        });
    
        if (options.maxAge !== undefined) {
          params.set('maxAge', options.maxAge.toString());
        }
    
        if (options.startNew) {
          params.set('startNew', 'on');
        }
    
        const apiUrl = `https://api.ssllabs.com/api/v4/analyze?${params.toString()}`;
    
        // Make GET request with email header
        const response = await fetch(apiUrl, {
          method: 'GET',
          headers: {
            'email': options.email,
          },
        });
    
        if (!response.ok) {
          if (response.status === 429) {
            throw new Error('SSL Labs rate limit exceeded. Please wait and try again.');
          }
          throw new Error(`SSL Labs API error: ${response.status} ${response.statusText}`);
        }
    
        const data: SSLLabsResponse = await response.json();
    
        // Check if assessment is complete
        if (data.status === 'ERROR') {
          return {
            tool: 'ssl_labs',
            success: false,
            status: data.status,
            host: hostname,
            endpoints: [],
            error: data.statusMessage || 'Assessment failed',
            raw: data,
          };
        }
    
        // Format endpoints
        const endpoints = (data.endpoints || []).map(ep => ({
          ip: ep.ipAddress,
          grade: ep.grade,
          hasWarnings: ep.hasWarnings,
          progress: ep.progress,
        }));
    
        // Get best grade from all endpoints
        const grades = data.endpoints?.filter(ep => ep.grade).map(ep => ep.grade!) || [];
        const bestGrade = grades.length > 0 ? grades.sort()[0] : undefined;
    
        return {
          tool: 'ssl_labs',
          success: data.status === 'READY',
          status: data.status,
          grade: bestGrade,
          host: hostname,
          endpoints,
          testTime: data.testTime ? new Date(data.testTime).toISOString() : undefined,
          raw: data,
        };
      } catch (error) {
        return {
          tool: 'ssl_labs',
          success: false,
          status: 'ERROR',
          host: new URL(url).hostname,
          endpoints: [],
          error: error instanceof Error ? error.message : String(error),
        };
      }
    }
  • Helper function that polls the SSL Labs API until the assessment is complete or times out.
    export async function analyzeSSLLabsComplete(
      url: string,
      options: SSLLabsOptions,
      maxWaitMinutes: number = 5
    ): Promise<SSLLabsResult> {
      const maxWaitMs = maxWaitMinutes * 60 * 1000;
      const startTime = Date.now();
      const pollInterval = 10000; // 10 seconds
    
      let result = await analyzeSSLLabs(url, options);
    
      // Keep polling until complete or timeout
      while (result.status !== 'READY' && result.status !== 'ERROR') {
        if (Date.now() - startTime > maxWaitMs) {
          return {
            ...result,
            success: false,
            error: `Timeout: Assessment did not complete within ${maxWaitMinutes} minutes`,
          };
        }
    
        // Wait before next poll
        await new Promise(resolve => setTimeout(resolve, pollInterval));
    
        // Poll again (fromCache to get latest status)
        result = await analyzeSSLLabs(url, { ...options, maxAge: 0 });
      }
    
      return result;
    }
  • Zod schema for validating input arguments to the validate_security_ssl_labs tool.
    const SSLLabsArgsSchema = z.object({
      url: z.string().url(),
      email: z.string().email(),
      maxAge: z.number().optional(),
      startNew: z.boolean().optional(),
      waitForComplete: z.boolean().optional(),
      maxWaitMinutes: z.number().optional(),
    });
  • index.ts:214-229 (registration)
    Tool registration object defining name, description, and input schema for the MCP tool.
    {
      name: 'validate_security_ssl_labs',
      description: 'Analyze SSL/TLS configuration using SSL Labs. Comprehensive certificate and protocol analysis. Long-running (may take minutes).',
      inputSchema: {
        type: 'object',
        properties: {
          url: { type: 'string' },
          email: { type: 'string', description: 'Your email (required by API)' },
          maxAge: { type: 'number', description: 'Max cached report age in hours' },
          startNew: { type: 'boolean', description: 'Force new assessment' },
          waitForComplete: { type: 'boolean', description: 'Wait for completion (default: false)' },
          maxWaitMinutes: { type: 'number', description: 'Max wait time in minutes (default: 5)' },
        },
        required: ['url', 'email'],
      },
    },
  • Dispatch handler in main switch that validates args and calls the appropriate SSL Labs analysis function based on waitForComplete flag.
    case 'validate_security_ssl_labs': {
      const validatedArgs = SSLLabsArgsSchema.parse(args);
      const result = validatedArgs.waitForComplete
        ? await analyzeSSLLabsComplete(
            validatedArgs.url,
            { email: validatedArgs.email, maxAge: validatedArgs.maxAge, startNew: validatedArgs.startNew },
            validatedArgs.maxWaitMinutes
          )
        : await analyzeSSLLabs(validatedArgs.url, {
            email: validatedArgs.email,
            maxAge: validatedArgs.maxAge,
            startNew: validatedArgs.startNew,
          });
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
Behavior4/5

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

With no annotations provided, the description carries full burden and adds valuable behavioral context: it discloses the tool's long-running nature ('may take minutes'), which is crucial for agent planning. However, it doesn't mention authentication requirements (email parameter is documented in schema but not explained in description), rate limits, or what happens during the wait period.

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 perfectly concise with three short sentences that each earn their place: first states core purpose, second adds scope detail, third provides crucial behavioral warning. No wasted words and front-loaded with the essential action.

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

Completeness3/5

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

For a 6-parameter tool with no annotations and no output schema, the description provides adequate but incomplete context. It covers the core purpose and a critical behavioral trait (long-running), but lacks information about return values, error conditions, or how results are structured. The high schema coverage helps, but more context would be beneficial given the complexity.

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 high at 83%, so the baseline is 3. The description doesn't add any parameter-specific information beyond what's in the schema (all 6 parameters are documented in schema with descriptions for 5 of them). No additional syntax, format, or usage details are provided in the description text.

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: 'Analyze SSL/TLS configuration using SSL Labs' with specific mention of 'comprehensive certificate and protocol analysis.' It distinguishes from security siblings by specifying SSL Labs as the analysis engine, but doesn't explicitly contrast with validate_security_mozilla_observatory or other security tools.

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 provides implied usage guidance through 'Long-running (may take minutes)' which suggests when to expect delays, but doesn't explicitly state when to use this vs. alternatives like validate_security_mozilla_observatory or validate_all_security. No explicit when-not-to-use or prerequisite guidance is provided.

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/cordlesssteve/webby-mcp'

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