Skip to main content
Glama

search_regulations

Search EU regulations like GDPR and AI Act to find relevant articles with highlighted matches for compliance queries.

Instructions

Search across all EU regulations for articles matching a query. Returns relevant articles with snippets highlighting matches. Token-efficient: returns 32-token snippets per match (safe for context).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (e.g., "incident reporting", "personal data breach")
regulationsNoOptional: filter to specific regulations (e.g., ["GDPR", "NIS2"])
limitNoMaximum results to return (default: 10)

Implementation Reference

  • The handler function 'searchRegulations' that processes the 'search_regulations' tool requests, delegating to either 'searchSqlite' or 'searchPostgres' based on the database type.
    export async function searchRegulations(
      db: DatabaseAdapter,
      input: SearchInput
    ): Promise<SearchResult[]> {
      let { query, regulations, limit = 10 } = input;
    
      if (!Number.isFinite(limit) || limit < 0) {
        limit = 10;
      }
      limit = Math.min(Math.floor(limit), 1000);
    
      if (!query || query.trim().length === 0) {
        return [];
      }
    
      try {
        if (db.type === 'sqlite') {
          return await searchSqlite(db, query, regulations, limit);
        } else {
          return await searchPostgres(db, query, regulations, limit);
        }
      } catch (error) {
        if (error instanceof Error && (error.message.includes('tsquery') || error.message.includes('MATCH'))) {
          return [];
        }
        throw error;
      }
    }
  • Input interface for the 'search_regulations' tool.
    export interface SearchInput {
      query: string;
      regulations?: string[];
      limit?: number;
    }
  • Registration of the 'search_regulations' tool in the tool registry. Note: The snippet shows the registration structure in src/tools/registry.ts.
    name: 'search_regulations',
    description: 'Search across all EU regulations for articles matching a query. Returns relevant articles with snippets highlighting matches. Token-efficient: returns 32-token snippets per match (safe for context).',
    inputSchema: {
      type: 'object',
      properties: {
        query: {
          type: 'string',
          description: 'Search query (e.g., "incident reporting", "personal data breach")',
        },
        regulations: {
          type: 'array',
          items: { type: 'string' },
          description: 'Optional: filter to specific regulations (e.g., ["GDPR", "NIS2"])',
        },
        limit: {
          type: 'number',
          description: 'Maximum results to return (default: 10)',
        },
      },
      required: ['query'],
    },
    handler: async (db, args) => {
      const input = args as unknown as SearchInput;
      return await searchRegulations(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