Skip to Content
GuidesFor LLMs

For LLMs

This guide is written for AI assistants using the NAICS MCP Server. It explains the available tools, best practices, and common workflows.

System Prompt

Include this in your system prompt when NAICS classification is a primary task:

You have access to the NAICS MCP Server for industry classification. When classifying businesses: 1. Use `classify_business` for detailed analysis with reasoning 2. Always check cross-references to avoid misclassification 3. Prefer 6-digit codes (most specific) when available 4. If confidence is below 0.7, present alternatives to the user 5. Use `get_code_hierarchy` to explain where a code fits NAICS 2022 has 2,125 codes across 20 sectors. Common sectors: - 31-33: Manufacturing - 44-45: Retail Trade - 54: Professional Services - 72: Accommodation and Food Services

Tool Selection Guide

For Classification Tasks

ScenarioToolNotes
Single business descriptionclassify_businessReturns detailed reasoning
Multiple descriptionsclassify_batchUp to 100 at once
Quick searchsearch_naics_codesFaster, less detail
Known terminologysearch_index_terms20,398 official terms

For Exploration

ScenarioToolNotes
Understand a codeget_code_hierarchyShows full ancestor chain
Find sub-categoriesget_childrenLists immediate children
Find alternativesget_siblings or find_similar_industriesRelated codes
Compare optionscompare_codesSide-by-side comparison

For Validation

ScenarioToolNotes
Check exclusionsget_cross_referencesCritical for accuracy
Validate a codevalidate_classificationIs this code correct?

For Diagnostics

ScenarioToolNotes
Quick health checkpingIs server alive?
Component statusget_server_healthDetailed diagnostics
Workflow guidanceget_workflow_guideClassification workflows

Standard Classification

1. classify_business(description, check_cross_refs=true) 2. If confidence < 0.7: - get_siblings(recommended_code) - Present alternatives to user 3. If cross-reference warnings present: - Explain the exclusion - Suggest separate classification if needed

Exploratory Classification

1. search_naics_codes(description, strategy="hybrid", limit=5) 2. For top 2-3 results: - get_code_hierarchy(code) - get_cross_references(code) 3. Present options with hierarchy context

Validation Workflow

1. validate_classification(description, proposed_code) 2. If not valid: - Explain why - classify_business(description) for alternatives 3. If valid but with warnings: - get_cross_references(code) - Explain any relevant exclusions

Handling Edge Cases

Multiple Business Activities

When a business does multiple things:

  1. Identify the primary activity (generates most revenue)
  2. Classify the primary activity
  3. Note that secondary activities may need separate codes
  4. Use cross-reference checks to identify boundaries

Vague Descriptions

If the description is too vague:

  1. Ask the user for clarification:
    • “What is the primary product or service?”
    • “Who are the customers (businesses or consumers)?”
    • “How is revenue generated?”
  2. Use search_naics_codes with strategy=“semantic” for broader matches

Low Confidence Results

When confidence is below 0.5:

  1. Present the top 3-5 results
  2. Explain why each might apply
  3. Ask clarifying questions
  4. Let the user make the final decision

Cross-Reference Exclusions

When a cross-reference warning appears:

Example: "Retail bakeries are classified in 445291, not 311811" Response: "Based on your description, 311811 (Retail Bakeries) seems appropriate. However, if the business primarily *manufactures* baked goods for wholesale distribution, that would be 311811. If it's a retail store that bakes goods for direct sale to consumers, use 445291 instead."

Response Format Best Practices

Always Include

  • The recommended NAICS code and title
  • Confidence level (interpret the score)
  • Brief explanation of why this code fits
  • Any cross-reference warnings

When Helpful

  • Hierarchy context (sector → code)
  • Alternative codes for consideration
  • Clarifying questions if uncertain

Example Response

Based on your description, I recommend: **311111 - Dog and Cat Food Manufacturing** Confidence: High (0.91) This code covers establishments primarily engaged in manufacturing dog and cat food from grain, meat, and other ingredients. **Hierarchy:** Manufacturing (31-33) → Food Manufacturing (311) → Animal Food (3111) → Dog and Cat Food (311111) **Note:** If the business also operates retail stores selling pet food, that retail activity would be classified separately under 453910 (Pet and Pet Supplies Retailers).

Tool Parameters Quick Reference

search_naics_codes

{ "query": "business description", "strategy": "hybrid|semantic|lexical", "limit": 10, "min_confidence": 0.3, "include_cross_refs": true }

classify_business

{ "description": "detailed business description", "include_reasoning": true, "check_cross_refs": true }

classify_batch

{ "descriptions": ["desc1", "desc2", ...], "include_confidence": true }

Error Handling

Rate Limited

If you receive a rate limit error, wait before retrying:

{ "error": "Rate limit exceeded", "retry_after_seconds": 30 }

Invalid Input

Validate descriptions before sending:

  • Minimum 10 characters
  • Maximum 5,000 characters
  • Non-empty after trimming whitespace

Server Not Ready

If check_readiness returns not_ready:

  • Wait for embeddings to load (first startup)
  • Check get_server_health for details