Search Standards by Crosscutting Concept
search_by_crosscutting_conceptFind NGSS standards aligned to a specific Crosscutting Concept, such as Patterns or Cause and Effect, to quickly locate relevant performance expectations.
Instructions
Find all NGSS standards using a specific Crosscutting Concept (CCC). Examples: "Patterns", "Cause and Effect", "Systems and System Models", "Energy and Matter"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| concept | Yes | Crosscutting Concept name | |
| detail_level | No | Response detail level: minimal (code, topic, PE 50 chars), summary (+ keywords top 3, PE 150 chars), full (complete standard) | full |
Implementation Reference
- src/server/index.ts:456-496 (handler)The main handler function for the search_by_crosscutting_concept tool. It takes 'concept' (a CCC value) and optional 'detail_level', fetches all standards from the database, filters by exact CCC match, formats the response, and returns JSON with token metadata.
async ({ concept, detail_level }) => { try { ensureInitialized(); const db = getDatabase(); const allStandards = db.getAllStandards(); // Filter by CCC name (exact match) const filtered = allStandards.filter(s => s.ccc.name === concept); const formattedStandards = formatResponseArray(filtered, detail_level as DetailLevel); const tokens = getTokenMetadata(concept, formattedStandards); const result = { concept, total: filtered.length, standards: formattedStandards, _metadata: { tokens } }; return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { console.error('search_by_crosscutting_concept error:', error); return { content: [{ type: 'text', text: JSON.stringify({ error: 'Internal Error', message: error instanceof Error ? error.message : String(error), code: 'INTERNAL_ERROR' }, null, 2) }], isError: true }; } } ); - src/server/index.ts:442-496 (registration)Registration of the 'search_by_crosscutting_concept' tool with the MCP server, including title, description, and input schema definition.
server.registerTool( 'search_by_crosscutting_concept', { title: 'Search Standards by Crosscutting Concept', description: 'Find all NGSS standards using a specific Crosscutting Concept (CCC). Examples: "Patterns", "Cause and Effect", "Systems and System Models", "Energy and Matter"', inputSchema: { concept: z.enum(CCC_VALUES) .describe('Crosscutting Concept name'), detail_level: z.enum(['minimal', 'summary', 'full']) .optional() .default('full') .describe('Response detail level: minimal (code, topic, PE 50 chars), summary (+ keywords top 3, PE 150 chars), full (complete standard)') } }, async ({ concept, detail_level }) => { try { ensureInitialized(); const db = getDatabase(); const allStandards = db.getAllStandards(); // Filter by CCC name (exact match) const filtered = allStandards.filter(s => s.ccc.name === concept); const formattedStandards = formatResponseArray(filtered, detail_level as DetailLevel); const tokens = getTokenMetadata(concept, formattedStandards); const result = { concept, total: filtered.length, standards: formattedStandards, _metadata: { tokens } }; return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { console.error('search_by_crosscutting_concept error:', error); return { content: [{ type: 'text', text: JSON.stringify({ error: 'Internal Error', message: error instanceof Error ? error.message : String(error), code: 'INTERNAL_ERROR' }, null, 2) }], isError: true }; } } ); - src/server/index.ts:447-454 (schema)Input schema for the tool: 'concept' is a required enum of CCC_VALUES, 'detail_level' is an optional enum ('minimal', 'summary', 'full') defaulting to 'full'.
inputSchema: { concept: z.enum(CCC_VALUES) .describe('Crosscutting Concept name'), detail_level: z.enum(['minimal', 'summary', 'full']) .optional() .default('full') .describe('Response detail level: minimal (code, topic, PE 50 chars), summary (+ keywords top 3, PE 150 chars), full (complete standard)') } - src/server/token-counter.ts:35-48 (helper)Helper function getTokenMetadata used to estimate input/output tokens for the response metadata.
export function getTokenMetadata(input: string, output: unknown): { input_tokens: number; output_tokens: number; total_tokens: number; } { const inputTokens = estimateTokens(input); const outputTokens = estimateTokensForObject(output); return { input_tokens: inputTokens, output_tokens: outputTokens, total_tokens: inputTokens + outputTokens }; } - Helper function formatResponseArray used to format standards based on the requested detail level (minimal, summary, or full).
export function formatResponseArray( standards: Standard[], detailLevel: DetailLevel = 'full' ): (MinimalStandard | SummaryStandard | Standard)[] { return standards.map(standard => formatResponse(standard, detailLevel)); }