Skip to main content
Glama

search_regulations

Read-only

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);
Behavior4/5

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

Beyond the readOnlyHint annotation, the description adds valuable behavioral context: it discloses the return format ('articles with snippets highlighting matches'), specifies the truncation behavior ('32-token snippets'), and explains the impact on context window ('safe for context'). It does not mention error states or pagination, but covers output characteristics well.

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?

Three sentences with zero waste: sentence 1 states purpose, sentence 2 describes output, sentence 3 explains efficiency constraints. Information is front-loaded and every sentence earns its place.

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

Completeness5/5

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

Given the absence of an output schema, the description appropriately compensates by explaining what the tool returns (articles with snippets) and critical behavioral constraints (32-token limit). Combined with complete input schema and annotations, this provides sufficient context for invocation.

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?

With 100% schema description coverage, the structured fields adequately document all three parameters. The description mentions 'matching a query' and 'across all EU regulations' which loosely map to the 'query' and 'regulations' parameters, but does not add semantic details beyond what the schema already provides. Baseline 3 is appropriate for high schema coverage.

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?

The description states a specific verb ('Search'), resource ('EU regulations'), and scope ('across all'). It distinguishes from siblings like 'get_article' (implies specific retrieval) by emphasizing 'matching a query' and from 'list_regulations' by targeting 'articles' within regulations.

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 implies usage through 'matching a query' (use when searching rather than retrieving known content) and mentions 'Token-efficient' (use when context limits are a concern). However, it lacks explicit when/when-not guidance or named alternatives compared to siblings like 'get_article'.

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