Skip to Content
API ReferenceOverview

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:

ToolPurpose
search_naics_codesHybrid semantic + lexical search
search_index_termsSearch 20,398 official index terms

Hierarchy Tools

Tools for navigating the NAICS structure:

ToolPurpose
get_code_hierarchyFull ancestor chain for a code
get_childrenImmediate children of a code
get_siblingsSame-level codes under parent
get_parentDirect parent code
get_ancestorsAll ancestors to sector level

Classification Tools

Tools for classifying businesses:

ToolPurpose
classify_businessDetailed single classification
classify_batchClassify up to 100 descriptions
validate_classificationVerify a proposed code

Analytics Tools

Tools for analysis and comparison:

ToolPurpose
compare_codesSide-by-side code comparison
find_similar_industriesFind related industries
get_cross_referencesGet exclusions and see-also refs
get_sector_summarySector statistics
get_similar_codesPre-computed similar codes (fast)
get_cross_sector_alternativesFind codes in different sectors
get_relationship_statsRelationship statistics for a code

Workbook Tools

Tools for audit trails and documentation:

ToolPurpose
write_to_workbookSave classification decision
read_workbookRetrieve saved classifications

Diagnostic Tools

Tools for server health and guidance:

ToolPurpose
pingQuick health check
get_server_healthDetailed component status
check_readinessKubernetes readiness probe
get_workflow_guideClassification workflow guidance

Common Patterns

Basic Classification

1. classify_business(description) 2. If low confidence → present alternatives 3. If cross-ref warnings → explain exclusions

Exploration

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:

CodeMeaning
INVALID_CODENAICS code doesn’t exist
INVALID_INPUTMissing or malformed parameter
RATE_LIMITEDToo many requests
NOT_READYServer still initializing