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
| Name | Required | Description | Default |
|---|---|---|---|
| term | Yes | Term to look up (e.g., "personal data", "incident", "processing") | |
| regulation | No | Optional: filter to specific regulation | |
| limit | No | Maximum results to return (default: 50) |
Implementation Reference
- src/tools/definitions.ts:17-57 (handler)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, })); } - src/tools/definitions.ts:3-7 (schema)Input schema for the get_definitions tool.
export interface DefinitionsInput { term: string; regulation?: string; limit?: number; } - src/tools/registry.ts:265-289 (registration)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); }, },