Skip to main content
Glama

mcp_get_security_status

Retrieve current security configuration and status for database operations to monitor access controls and compliance settings.

Instructions

Get current security configuration and status for database operations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that implements the tool logic for mcp_get_security_status, calling getSecurityStatus and formatting the response.
    export const mcp_get_security_status = async (): Promise<ToolResult<any>> => {
      console.log('Executing mcp_get_security_status');
    
      try {
        const status = getSecurityStatus();
        
        const result = {
          security_configuration: {
            modifications_enabled: status.modifications_enabled,
            stored_procedures_enabled: status.stored_procedures_enabled,
            security_level: status.security_level
          },
          environment_variables: {
            DB_ALLOW_MODIFICATIONS: process.env.DB_ALLOW_MODIFICATIONS || 'not set (defaults to false)',
            DB_ALLOW_STORED_PROCEDURES: process.env.DB_ALLOW_STORED_PROCEDURES || 'not set (defaults to false)'
          },
          recommendations: status.recommendations,
          configuration_guide: {
            enable_modifications: 'Set DB_ALLOW_MODIFICATIONS=true in your environment',
            enable_stored_procedures: 'Set DB_ALLOW_STORED_PROCEDURES=true in your environment',
            security_best_practices: [
              'Keep modifications disabled in production environments',
              'Only enable stored procedures when necessary',
              'Review all queries before execution in production',
              'Use read-only database users when possible'
            ]
          }
        };
    
        return { success: true, data: result };
      } catch (error: any) {
        console.error('Error in mcp_get_security_status:', error.message);
        return { success: false, error: error.message };
      }
    };
  • The input schema definition and tool registration entry in the MCP_MSQL_TOOLS array.
    {
      name: "mcp_get_security_status",
      description: "Get current security configuration and status for database operations",
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
    }
  • Re-export of the mcp_get_security_status handler for use in other modules.
    export {
      mcp_get_security_status   // Get current security configuration
    } from './securityOperations.js';
  • Core helper function that computes the security status based on environment variables, used by the tool handler.
    export function getSecurityStatus(): {
      modifications_enabled: boolean;
      stored_procedures_enabled: boolean;
      security_level: string;
      recommendations: string[];
    } {
      const modifications = SECURITY_CONFIG.ALLOW_MODIFICATIONS;
      const storedProcs = SECURITY_CONFIG.ALLOW_STORED_PROCEDURES;
      
      let securityLevel = 'MAXIMUM';
      let recommendations: string[] = [];
      
      if (modifications && storedProcs) {
        securityLevel = 'LOW';
        recommendations.push('[!] Consider disabling modifications in production');
        recommendations.push('[!] Consider disabling stored procedures in production');
      } else if (modifications || storedProcs) {
        securityLevel = 'MEDIUM';
        if (modifications) {
          recommendations.push('[!] Modifications are enabled - use with caution');
        }
        if (storedProcs) {
          recommendations.push('[!] Stored procedures are enabled - use with caution');
        }
      } else {
        recommendations.push('[OK] Optimal security configuration for production');
      }
      
      return {
        modifications_enabled: modifications,
        stored_procedures_enabled: storedProcs,
        security_level: securityLevel,
        recommendations
      };
    }
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 retrieves security configuration and status, implying a read-only operation, but doesn't specify whether it requires special permissions, what format the output is in, or if there are rate limits. This leaves significant gaps for a security-related tool.

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, clear sentence that efficiently conveys the tool's purpose without unnecessary words. It's front-loaded and wastes no space, making it easy for an agent to parse quickly.

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?

Given the tool's complexity (security-related with no output schema) and lack of annotations, the description is minimally adequate but incomplete. It states what the tool does but doesn't cover behavioral aspects like output format or permissions needed, which are crucial for security operations. Without an output schema, more detail on return values would be helpful.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, but since there are no parameters, this is acceptable. Baseline is 4 for 0 parameters, as the schema fully covers the absence of inputs.

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 with a specific verb ('Get') and resource ('current security configuration and status for database operations'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'mcp_get_dependencies' or 'mcp_get_column_stats', which also retrieve metadata but for different aspects.

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. It doesn't mention prerequisites, context for security checks, or comparisons to sibling tools like 'mcp_execute_query' or 'mcp_table_analysis', leaving the agent to infer usage based on the name alone.

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/hendrickcastro/MCPQL'

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