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 ServicesTool Selection Guide
For Classification Tasks
| Scenario | Tool | Notes |
|---|---|---|
| Single business description | classify_business | Returns detailed reasoning |
| Multiple descriptions | classify_batch | Up to 100 at once |
| Quick search | search_naics_codes | Faster, less detail |
| Known terminology | search_index_terms | 20,398 official terms |
For Exploration
| Scenario | Tool | Notes |
|---|---|---|
| Understand a code | get_code_hierarchy | Shows full ancestor chain |
| Find sub-categories | get_children | Lists immediate children |
| Find alternatives | get_siblings or find_similar_industries | Related codes |
| Compare options | compare_codes | Side-by-side comparison |
For Validation
| Scenario | Tool | Notes |
|---|---|---|
| Check exclusions | get_cross_references | Critical for accuracy |
| Validate a code | validate_classification | Is this code correct? |
For Diagnostics
| Scenario | Tool | Notes |
|---|---|---|
| Quick health check | ping | Is server alive? |
| Component status | get_server_health | Detailed diagnostics |
| Workflow guidance | get_workflow_guide | Classification workflows |
Recommended 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 neededExploratory 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 contextValidation 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 exclusionsHandling Edge Cases
Multiple Business Activities
When a business does multiple things:
- Identify the primary activity (generates most revenue)
- Classify the primary activity
- Note that secondary activities may need separate codes
- Use cross-reference checks to identify boundaries
Vague Descriptions
If the description is too vague:
- Ask the user for clarification:
- “What is the primary product or service?”
- “Who are the customers (businesses or consumers)?”
- “How is revenue generated?”
- Use
search_naics_codeswith strategy=“semantic” for broader matches
Low Confidence Results
When confidence is below 0.5:
- Present the top 3-5 results
- Explain why each might apply
- Ask clarifying questions
- 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_healthfor details