search_definitions
Search FedRAMP definitions by term to find official definitions and alternate terms from FRD documents for compliance and security analysis.
Instructions
Search FedRAMP definitions (FRD document) by term. Returns matching definitions with their full text and any alternate terms.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| term | Yes | Search term to find in definitions | |
| limit | No |
Implementation Reference
- src/tools/search_definitions.ts:27-50 (handler)The execute handler implementing the core logic: retrieves FRD document, filters definitions matching the term in term, definition, or alts, and returns paginated results.execute: async (input) => { const frdDoc = getFrmrDocuments().find((doc) => doc.type === "FRD"); if (!frdDoc || !frdDoc.raw) { return { total: 0, definitions: [] }; } const raw = frdDoc.raw as Record<string, unknown>; const frd = raw.FRD as Record<string, unknown> | undefined; const allDefs = (frd?.ALL as Definition[]) ?? []; const searchLower = input.term.toLowerCase(); const matches = allDefs.filter((def) => { if (def.term?.toLowerCase().includes(searchLower)) return true; if (def.definition?.toLowerCase().includes(searchLower)) return true; if (def.alts?.some((alt) => alt.toLowerCase().includes(searchLower))) return true; return false; }); return { total: matches.length, definitions: matches.slice(0, input.limit), }; },
- Input schema using Zod: requires 'term' string, optional 'limit' number (1-100, default 20).const schema = z.object({ term: z.string().describe("Search term to find in definitions"), limit: z.number().int().min(1).max(100).default(20), });
- src/tools/register.ts:43-43 (registration)Registers the searchDefinitionsTool by including it in the array passed to registerToolDefs in registerTools function.searchDefinitionsTool,
- src/tools/search_definitions.ts:6-12 (helper)TypeScript interface defining the structure of a definition object used in filtering and output.interface Definition { id: string; term: string; definition: string; alts?: string[]; note?: string; }
- Complete ToolDefinition export including name, description, schema, and execute handler.export const searchDefinitionsTool: ToolDefinition< typeof schema, { total: number; definitions: Definition[] } > = { name: "search_definitions", description: "Search FedRAMP definitions (FRD document) by term. Returns matching definitions with their full text and any alternate terms.", schema, execute: async (input) => { const frdDoc = getFrmrDocuments().find((doc) => doc.type === "FRD"); if (!frdDoc || !frdDoc.raw) { return { total: 0, definitions: [] }; } const raw = frdDoc.raw as Record<string, unknown>; const frd = raw.FRD as Record<string, unknown> | undefined; const allDefs = (frd?.ALL as Definition[]) ?? []; const searchLower = input.term.toLowerCase(); const matches = allDefs.filter((def) => { if (def.term?.toLowerCase().includes(searchLower)) return true; if (def.definition?.toLowerCase().includes(searchLower)) return true; if (def.alts?.some((alt) => alt.toLowerCase().includes(searchLower))) return true; return false; }); return { total: matches.length, definitions: matches.slice(0, input.limit), }; }, };