API Reference
The NAICS MCP Server exposes 20+ tools through the Model Context Protocol. This reference documents each tool’s purpose, parameters, and usage.
Tool Categories
Search Tools
Tools for finding NAICS codes:
| Tool | Purpose |
|---|---|
search_naics_codes | Hybrid semantic + lexical search |
search_index_terms | Search 20,398 official index terms |
Hierarchy Tools
Tools for navigating the NAICS structure:
| Tool | Purpose |
|---|---|
get_code_hierarchy | Full ancestor chain for a code |
get_children | Immediate children of a code |
get_siblings | Same-level codes under parent |
get_parent | Direct parent code |
get_ancestors | All ancestors to sector level |
Classification Tools
Tools for classifying businesses:
| Tool | Purpose |
|---|---|
classify_business | Detailed single classification |
classify_batch | Classify up to 100 descriptions |
validate_classification | Verify a proposed code |
Analytics Tools
Tools for analysis and comparison:
| Tool | Purpose |
|---|---|
compare_codes | Side-by-side code comparison |
find_similar_industries | Find related industries |
get_cross_references | Get exclusions and see-also refs |
get_sector_summary | Sector statistics |
get_similar_codes | Pre-computed similar codes (fast) |
get_cross_sector_alternatives | Find codes in different sectors |
get_relationship_stats | Relationship statistics for a code |
Workbook Tools
Tools for audit trails and documentation:
| Tool | Purpose |
|---|---|
write_to_workbook | Save classification decision |
read_workbook | Retrieve saved classifications |
Diagnostic Tools
Tools for server health and guidance:
| Tool | Purpose |
|---|---|
ping | Quick health check |
get_server_health | Detailed component status |
check_readiness | Kubernetes readiness probe |
get_workflow_guide | Classification workflow guidance |
Common Patterns
Basic Classification
1. classify_business(description)
2. If low confidence → present alternatives
3. If cross-ref warnings → explain exclusionsExploration
1. search_naics_codes(query, limit=5)
2. get_code_hierarchy(top_result)
3. get_cross_references(top_result)Validation
1. validate_classification(description, proposed_code)
2. If invalid → classify_business(description)Error Handling
All tools return structured responses. Errors include:
{
"error": "Error message",
"code": "ERROR_CODE",
"details": { ... }
}Common error codes:
| Code | Meaning |
|---|---|
INVALID_CODE | NAICS code doesn’t exist |
INVALID_INPUT | Missing or malformed parameter |
RATE_LIMITED | Too many requests |
NOT_READY | Server still initializing |