Skip to main content
Glama

map_controls

Read-only

Map security framework controls to EU regulation requirements to identify which articles satisfy specific security controls.

Instructions

Map security framework controls to EU regulation requirements. Shows which articles satisfy specific security controls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frameworkYesControl framework: ISO27001 (ISO 27001:2022) or NIST_CSF (NIST Cybersecurity Framework)
controlNoOptional: specific control ID (e.g., "A.5.1" for ISO27001, "PR.AA-01" for NIST CSF 2.0)
regulationNoOptional: filter mappings to specific regulation
limitNoMaximum control groups to return (default: 100)

Implementation Reference

  • The core implementation of the map_controls tool, which executes a SQL query to map security controls to regulations and groups the resulting mappings.
    export async function mapControls(
      db: DatabaseAdapter,
      input: MapControlsInput
    ): Promise<ControlMapping[]> {
      const VALID_FRAMEWORKS = ['ISO27001', 'NIST_CSF'];
      const { framework, control, regulation } = input;
    
      if (!VALID_FRAMEWORKS.includes(framework)) {
        throw new Error(`Invalid framework "${framework}". Must be one of: ${VALID_FRAMEWORKS.join(', ')}`);
      }
    
      let limit = input.limit ?? 100;
      if (!Number.isFinite(limit) || limit < 0) limit = 100;
      limit = Math.min(Math.floor(limit), 1000);
    
      let sql = `
        SELECT
          control_id,
          control_name,
          regulation,
          articles,
          coverage,
          notes
        FROM control_mappings
        WHERE framework = $1
      `;
    
      const params: string[] = [framework];
    
      if (control) {
        sql += ` AND control_id = $${params.length + 1}`;
        params.push(control);
      }
    
      if (regulation) {
        sql += ` AND regulation = $${params.length + 1}`;
        params.push(regulation);
      }
    
      sql += ` ORDER BY control_id, regulation`;
      sql += ` LIMIT $${params.length + 1}`;
      params.push(String(limit));
    
      const result = await db.query(sql, params);
    
      const rows = result.rows as Array<{
        control_id: string;
        control_name: string;
        regulation: string;
        articles: string;
        coverage: 'full' | 'partial' | 'related';
        notes: string | null;
      }>;
    
      // Group by control_id
      const controlMap = new Map<string, ControlMapping>();
    
      for (const row of rows) {
        if (!controlMap.has(row.control_id)) {
          controlMap.set(row.control_id, {
            control_id: row.control_id,
            control_name: row.control_name,
            mappings: [],
          });
        }
    
        controlMap.get(row.control_id)!.mappings.push({
          regulation: row.regulation,
          articles: JSON.parse(row.articles),
          coverage: row.coverage,
          notes: row.notes,
        });
      }
    
      return Array.from(controlMap.values());
    }
  • Schema definition for the map_controls tool input parameters.
    export interface MapControlsInput {
      framework: 'ISO27001' | 'NIST_CSF';
      control?: string;
      regulation?: string;
      limit?: number;
    }
  • Registration of the map_controls tool in the central registry, defining its schema and mapping it to the handler function.
      name: 'map_controls',
      description: 'Map security framework controls to EU regulation requirements. Shows which articles satisfy specific security controls.',
      inputSchema: {
        type: 'object',
        properties: {
          framework: {
            type: 'string',
            enum: ['ISO27001', 'NIST_CSF'],
            description: 'Control framework: ISO27001 (ISO 27001:2022) or NIST_CSF (NIST Cybersecurity Framework)',
          },
          control: {
            type: 'string',
            description: 'Optional: specific control ID (e.g., "A.5.1" for ISO27001, "PR.AA-01" for NIST CSF 2.0)',
          },
          regulation: {
            type: 'string',
            description: 'Optional: filter mappings to specific regulation',
          },
          limit: {
            type: 'number',
            description: 'Maximum control groups to return (default: 100)',
          },
        },
        required: ['framework'],
      },
      handler: async (db, args) => {
        const input = args as unknown as MapControlsInput;
        return await mapControls(db, input);
      },
    },
Behavior3/5

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

Annotations already declare readOnlyHint=true. Description adds mapping directionality (controls→requirements) and relationship type ('satisfy'), but omits pagination behavior, return structure, or filtering logic despite having a limit parameter.

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?

Two efficient sentences with zero waste. First sentence establishes core function; second clarifies the specific relationship (satisfy). Main purpose is front-loaded appropriately.

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

Completeness4/5

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

For a read-only mapping tool with complete parameter schema, description adequately conveys expected output ('which articles satisfy') despite missing output schema. Could improve by noting return structure, but sufficient for agent selection.

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 has 100% description coverage, establishing baseline 3. Description mentions 'security framework controls' and 'specific security controls' reinforcing the framework/control parameters, but adds no syntax details, format examples, or clarifications beyond schema definitions.

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?

Description uses specific verb 'Map' with clear resources ('security framework controls' and 'EU regulation requirements'). Distinct from retrieval siblings (get_article, search_regulations) by specifying cross-reference functionality.

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?

Implied usage is clear from purpose statement (use when correlating security frameworks to EU articles), but lacks explicit when-to-use guidance, prerequisites, or named alternatives (e.g., when to use compare_requirements vs this tool).

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/Ansvar-Systems/eu-regulations'

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