Skip to main content
Glama

Get NGSS Standard by Code

get_standard

Look up a middle school NGSS standard by its code (e.g., MS-PS1-1) and choose the level of detail: minimal, summary, or full.

Instructions

Retrieve a specific NGSS standard by its code identifier (e.g., MS-PS1-1, MS-LS2-3, MS-ESS3-1)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesNGSS standard code (format: MS-{PS|LS|ESS}{number}-{number})
detail_levelNoResponse detail level: minimal (code, topic, PE 50 chars), summary (+ keywords top 3, PE 150 chars), full (complete standard)full

Implementation Reference

  • Tool handler for 'get_standard' that looks up an NGSS standard by code, formats the response based on detail level ('minimal', 'summary', 'full'), and returns it with token metadata.
    // Tool 1: get_standard - Lookup standard by code
    server.registerTool(
      'get_standard',
      {
        title: 'Get NGSS Standard by Code',
        description: 'Retrieve a specific NGSS standard by its code identifier (e.g., MS-PS1-1, MS-LS2-3, MS-ESS3-1)',
        inputSchema: {
          code: z.string()
            .regex(/^MS-(PS|LS|ESS)\d+-\d+$/)
            .describe('NGSS standard code (format: MS-{PS|LS|ESS}{number}-{number})'),
          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 ({ code, detail_level }) => {
        try {
          ensureInitialized();
          const db = getDatabase();
          const standard = db.getStandardByCode(code);
    
          if (!standard) {
            return {
              content: [{
                type: 'text',
                text: JSON.stringify({
                  error: 'Not Found',
                  message: `Standard ${code} does not exist in the database`,
                  code: 'STANDARD_NOT_FOUND'
                }, null, 2)
              }],
              isError: true
            };
          }
    
          const formatted = formatResponse(standard, detail_level as DetailLevel);
          const tokens = getTokenMetadata(code, formatted);
    
          return {
            content: [{
              type: 'text',
              text: JSON.stringify({
                ...formatted,
                _metadata: { tokens }
              }, null, 2)
            }]
          };
        } catch (error) {
          console.error('get_standard 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
          };
        }
      }
    );
  • Registration of the 'get_standard' tool on the McpServer instance with input schema and handler.
    // Tool 1: get_standard - Lookup standard by code
    server.registerTool(
      'get_standard',
      {
        title: 'Get NGSS Standard by Code',
        description: 'Retrieve a specific NGSS standard by its code identifier (e.g., MS-PS1-1, MS-LS2-3, MS-ESS3-1)',
        inputSchema: {
          code: z.string()
            .regex(/^MS-(PS|LS|ESS)\d+-\d+$/)
            .describe('NGSS standard code (format: MS-{PS|LS|ESS}{number}-{number})'),
          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 ({ code, detail_level }) => {
        try {
          ensureInitialized();
          const db = getDatabase();
          const standard = db.getStandardByCode(code);
    
          if (!standard) {
            return {
              content: [{
                type: 'text',
                text: JSON.stringify({
                  error: 'Not Found',
                  message: `Standard ${code} does not exist in the database`,
                  code: 'STANDARD_NOT_FOUND'
                }, null, 2)
              }],
              isError: true
            };
          }
    
          const formatted = formatResponse(standard, detail_level as DetailLevel);
          const tokens = getTokenMetadata(code, formatted);
    
          return {
            content: [{
              type: 'text',
              text: JSON.stringify({
                ...formatted,
                _metadata: { tokens }
              }, null, 2)
            }]
          };
        } catch (error) {
          console.error('get_standard 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
          };
        }
      }
    );
  • Input schema for the get_standard tool: 'code' (required, regex-validated) and 'detail_level' (optional enum defaulting to 'full').
    description: 'Retrieve a specific NGSS standard by its code identifier (e.g., MS-PS1-1, MS-LS2-3, MS-ESS3-1)',
    inputSchema: {
      code: z.string()
        .regex(/^MS-(PS|LS|ESS)\d+-\d+$/)
        .describe('NGSS standard code (format: MS-{PS|LS|ESS}{number}-{number})'),
      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)')
    }
  • Database method that validates the code via QueryValidator and performs an O(1) lookup in codeIndex, returning the Standard or null.
    getStandardByCode(code: string): Standard | null {
      // Validate standard code format
      const validation = QueryValidator.validateStandardCode(code);
      if (!validation.isValid) {
        throw new Error(validation.error);
      }
    
      return this.codeIndex.get(validation.sanitized!) || null;
    }
  • Formats the standard response according to detail_level: minimal (truncated PE, 50 chars), summary (+ top 3 keywords, PE 138 chars), or full (complete object).
    export function formatResponse(
      standard: Standard,
      detailLevel: DetailLevel = 'full'
    ): MinimalStandard | SummaryStandard | Standard {
      switch (detailLevel) {
        case 'minimal':
          return {
            code: standard.code,
            topic: standard.topic,
            performance_expectation: truncateAtWordBoundary(standard.performance_expectation, 50)
          };
    
        case 'summary':
          return {
            code: standard.code,
            topic: standard.topic,
            performance_expectation: truncateAtWordBoundary(standard.performance_expectation, 138),
            keywords: limitKeywords(standard.keywords, 3)
          };
    
        case 'full':
        default:
          return standard;
      }
    }
Behavior3/5

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

No annotations are provided, so the description must cover behavioral traits. It states 'Retrieve,' indicating a read-only operation, but does not disclose error behavior (e.g., invalid code), authorization needs, or rate limits. The description is minimal but not misleading.

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?

A single focused sentence that is front-loaded with the action and object. No unnecessary words or repetition. Every token serves a purpose.

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

Completeness3/5

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

Given no output schema, the description does not explain the return format or what 'full' entails. For a tool with two parameters and potential variations in detail_level, more context on output structure would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds value by providing concrete code examples that illustrate valid inputs (e.g., MS-PS1-1). This goes beyond the schema's pattern and description, making parameter usage clearer.

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 clearly states the verb ('Retrieve') and resource ('specific NGSS standard'), and uniquely identifies it by code identifier with concrete examples (e.g., MS-PS1-1). This distinguishes it from sibling search tools and get_3d_components.

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 when you have a known code, but does not explicitly guide when to use this tool versus search alternatives or mention prerequisites. Sibling tools like search_standards are not referenced, so guidance is only implicit.

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/Sallvainian/NGSS-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server