Skip to main content
Glama

get_recital

Retrieve specific recital text from EU regulations like GDPR or AI Act to understand legal context and interpretation guidance for articles.

Instructions

Retrieve the full text of a specific recital from a regulation. Recitals provide context and interpretation guidance for articles.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regulationYesRegulation ID (e.g., "GDPR", "NIS2", "DORA")
recital_numberYesRecital number (e.g., 1, 83)

Implementation Reference

  • The implementation of the getRecital tool handler which queries the database for a specific recital.
    export async function getRecital(
      db: DatabaseAdapter,
      input: GetRecitalInput
    ): Promise<Recital | null> {
      const { regulation, recital_number } = input;
    
      // Validate recital_number is a safe integer
      if (!Number.isInteger(recital_number) || !Number.isFinite(recital_number)) {
        return null;
      }
    
      // Reject negative or unrealistic recital numbers
      if (recital_number < 1 || recital_number > 10000) {
        return null;
      }
    
      const sql = `
        SELECT
          regulation,
          recital_number,
          text,
          related_articles
        FROM recitals
        WHERE regulation = $1 AND recital_number = $2
      `;
    
      const result = await db.query(sql, [regulation, recital_number]);
    
      if (result.rows.length === 0) {
        return null;
      }
    
      const row = result.rows[0] as {
        regulation: string;
        recital_number: number;
        text: string;
        related_articles: string | null;
      };
    
      return {
        regulation: row.regulation,
        recital_number: row.recital_number,
        text: row.text,
        related_articles: row.related_articles ? JSON.parse(row.related_articles) : null,
      };
    }
  • The registration of the get_recital tool in the central registry, mapping it to the handler.
      name: 'get_recital',
      description: 'Retrieve the full text of a specific recital from a regulation. Recitals provide context and interpretation guidance for articles.',
      inputSchema: {
        type: 'object',
        properties: {
          regulation: {
            type: 'string',
            description: 'Regulation ID (e.g., "GDPR", "NIS2", "DORA")',
          },
          recital_number: {
            type: 'number',
            description: 'Recital number (e.g., 1, 83)',
          },
        },
        required: ['regulation', 'recital_number'],
      },
      handler: async (db, args) => {
        const input = args as unknown as GetRecitalInput;
        const recital = await getRecital(db, input);
        if (!recital) {
          throw new Error(`Recital ${input.recital_number} not found in ${input.regulation}`);
        }
        return recital;
      },
    },

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