Skip to main content
Glama

get_definitions

Look up official definitions of terms from EU regulations like GDPR, AI Act, and DORA to clarify legal terminology and ensure compliance.

Instructions

Look up official definitions of terms from EU regulations. Terms are defined in each regulation's definitions article.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termYesTerm to look up (e.g., "personal data", "incident", "processing")
regulationNoOptional: filter to specific regulation
limitNoMaximum results to return (default: 50)

Implementation Reference

  • The implementation of the get_definitions tool logic.
    export async function getDefinitions(
      db: DatabaseAdapter,
      input: DefinitionsInput
    ): Promise<Definition[]> {
      const { term, regulation } = input;
      let limit = input.limit ?? 50;
      if (!Number.isFinite(limit) || limit < 0) limit = 50;
      limit = Math.min(Math.floor(limit), 500);
    
      let sql = `
        SELECT
          term,
          regulation,
          article,
          definition
        FROM definitions
        WHERE term ILIKE $1
      `;
    
      // Escape LIKE wildcards in user input to prevent unintended pattern matching
      const escapedTerm = term.replace(/%/g, '\\%').replace(/_/g, '\\_');
      const params: (string | number)[] = [`%${escapedTerm}%`];
    
      if (regulation) {
        sql += ` AND regulation = $2`;
        params.push(regulation);
      }
    
      sql += ` ORDER BY regulation, term`;
      sql += ` LIMIT $${params.length + 1}`;
      params.push(limit);
    
      const result = await db.query(sql, params);
    
      return result.rows.map((row: any) => ({
        term: row.term,
        regulation: row.regulation,
        article: row.article,
        definition: row.definition,
      }));
    }
  • Input schema for the get_definitions tool.
    export interface DefinitionsInput {
      term: string;
      regulation?: string;
      limit?: number;
    }
  • Registration and tool definition for get_definitions within the registry.
      name: 'get_definitions',
      description: 'Look up official definitions of terms from EU regulations. Terms are defined in each regulation\'s definitions article.',
      inputSchema: {
        type: 'object',
        properties: {
          term: {
            type: 'string',
            description: 'Term to look up (e.g., "personal data", "incident", "processing")',
          },
          regulation: {
            type: 'string',
            description: 'Optional: filter to specific regulation',
          },
          limit: {
            type: 'number',
            description: 'Maximum results to return (default: 50)',
          },
        },
        required: ['term'],
      },
      handler: async (db, args) => {
        const input = args as unknown as DefinitionsInput;
        return await getDefinitions(db, input);
      },
    },

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