# SAMHSA Treatment Locator MCP

> SAMHSA Treatment Locator connects to official Substance Abuse and Mental Health Services Administration data. It lets you find specific treatment facilities across the US using precise coordinates and filtering by service type (like detox or inpatient care). If you need accurate, verifiable healthcare resource locations for public health analysis or client coordination, this is it.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** mental-health, substance-abuse, facility-locator, public-health, geospatial-search

## Description

You're connecting to the **SAMHSA Treatment Locator** server, which gives your agent direct access to official Substance Abuse and Mental Health Services Administration data. This tool lets you find precise healthcare resources across the whole country.

To start, you use `search_facilities` when you need to locate a facility within a specific area. You pass latitude and longitude coordinates along with a defined radius to narrow down the search pool. When you run this search, you can restrict results based on service type—you're only looking for detox centers, or maybe inpatient care, or specialized mental health services. This combination of location data and filtering ensures you find exactly what your client needs.

Before you even start searching, you should check the available codes. You use `list_services` to get an exhaustive list of service code categories used by SAMHSA. It shows you every type of care—from outpatient services to specialized treatment programs—so you never have to guess what filter code will work.

Once you've run a search and gotten a facility ID, the `get_facility` tool lets you pull the full report. You give it that unique ID, and it returns every bit of metadata available for that location. This includes all contact details and an exhaustive list of services the center offers. It’s deep data—way more than just a name and address.

Here's how the process works: You first use `list_services` to build your knowledge base, identifying the correct codes. Next, you run `search_facilities`, providing coordinates and filtering by one of those verified service types. That search returns potential facility IDs. Finally, for any ID that looks promising, you use `get_facility`. This last step pulls all the necessary details—the comprehensive report—confirming everything from phone numbers to specific care capabilities. You'll never have to worry about finding a resource because this system lets you verify every piece of data against official SAMHSA records.

## Tools

### get_facility
Retrieves the full set of details for a facility when you provide its unique ID.

### list_services
Returns an exhaustive list of service codes, so you know exactly what types of care to filter by.

### search_facilities
Searches for facilities using coordinates and filters to narrow down results based on location and service type.

## Prompt Examples

**Prompt:** 
```
Search for treatment facilities within 25 miles of latitude 34.05 and longitude -118.24.
```

**Response:** 
```
I found several facilities near Los Angeles. The closest ones include 'Central Recovery Center' and 'Hope Health Services'. Would you like the details for any of these?
```

**Prompt:** 
```
Get the full details for facility ID 'FAC123456'.
```

**Response:** 
```
Retrieving details for FAC123456... This is the 'Evergreen Wellness Center' located at 123 Main St. They offer outpatient mental health services and specialized youth programs.
```

**Prompt:** 
```
List all available service codes for filtering treatment searches.
```

**Response:** 
```
I've compiled the service codes. Categories include 'Substance Use' (codes: DETOX, RES), 'Mental Health' (codes: OP, IP), and 'Special Programs' (codes: VET, LGBTQ). Which category should we filter by?
```

## Capabilities

### Search by Coordinates
Find facilities within a specific radius using latitude and longitude.

### Filter by Service Type
Limit search results to only include care types like detox, mental health, or outpatient services.

### Get Full Facility Report
Retrieve all available metadata—contact details and service lists—for a known facility ID.

### Check Available Codes
List every service code category used by SAMHSA, helping you build accurate search filters.

## Use Cases

### A patient needs immediate local care options.
The coordinator enters a client's lat/long. They run `search_facilities` for 'detox'. The agent gets a list of nearby centers, and the coordinator immediately uses `get_facility` on the top result to confirm hours and contact info.

### A researcher needs to map service gaps.
The researcher first runs `list_services` to see all available codes. Then they loop through multiple coordinates, calling `search_facilities` for 'Mental Health' (OP) in each area to build a heat map of coverage.

### A social worker needs specific program details.
The worker has a facility ID. They skip the search and run `get_facility`. This instantly pulls up if that center offers specialized youth programs, allowing them to match the client's need without clicking through multiple web pages.

### Filtering for complex care needs.
The user knows a facility exists but isn't sure of its codes. They run `list_services` first. Then they use the returned code (e.g., VET) to refine their initial search with `search_facilities`, hitting the target faster.

## Benefits

- Precision over guesswork. Instead of getting vague results, you use `search_facilities` to narrow down options by exact coordinates and specific service codes.
- Saves research time. You don't have to guess the right filter; running `list_services` gives you the full list of approved SAMHSA categories upfront.
- Deep data access. If a client is accepted, you use `get_facility` with their ID to pull comprehensive metadata—contact details and specialties—all in one call.
- Scales research efforts. Public health teams can run massive searches across regions using defined radii without manually logging into separate databases.
- Reduces errors. The server connects directly to the official SAMHSA database, ensuring your client always works with current, verified resource listings.

## How It Works

The bottom line is: You feed the server location data and known criteria; it returns verified facility information from SAMHSA.

1. Subscribe to the server and enter your required SAMHSA API Key.
2. Your agent calls `list_services` first. This retrieves the current list of usable service codes (like DETOX or OP).
3. The agent then uses `search_facilities`, passing in coordinates, a radius, and the specific service code(s) gathered previously.

## Frequently Asked Questions

**How do I find facilities near a specific intersection using the SAMHSA Treatment Locator MCP Server?**
You must use latitude and longitude coordinates, not street addresses. You pass these precise GPS points to `search_facilities` along with your desired service code.

**What should I run first when using the SAMHSA Treatment Locator MCP Server?**
`list_services`. This tool provides a master list of all available codes (like OP or IP). Running this first ensures you use the correct filtering criteria for your search.

**Can I get details on a facility without searching by location?**
Yes. If you already have the unique identifier, run `get_facility` and provide only that ID. It skips geo-search entirely and pulls the full record directly.

**Does SAMHSA Treatment Locator MCP Server support state-by-state filtering?**
Yes, by combining geographic search with specific service codes. You use `search_facilities` and define both a coordinate boundary and the required service code(s) for accurate results.

**How do I authenticate when using the SAMHSA Treatment Locator MCP Server?**
You must provide a valid API Key during setup. Vinkius requires this key to authorize access to the official SAMHSA database. Your AI client needs to pass this credential whenever it invokes any tool, like `search_facilities`.

**Are there rate limits I should be aware of when running 'search_facilities'?**
Yes, the underlying SAMHSA API enforces rate limits on requests. To avoid hitting those limits, we recommend batching multiple searches together or implementing an exponential backoff mechanism in your client code.

**What happens if I try to search for a service code that doesn't exist using 'search_facilities'?**
The server validates all input parameters against the official SAMHSA catalog. If you pass an invalid or deprecated service code, the API returns a clear error message detailing exactly which parameter needs correction.

**Does the SAMHSA Treatment Locator MCP Server support searching outside the United States?**
No, this server uses official data from SAMHSA. Its scope is strictly limited to reporting and locating substance use and mental health facilities within the continental U.S.

**How can I search for treatment facilities near a specific set of coordinates?**
Use the `search_facilities` tool by providing the `lat` (latitude) and `lon` (longitude) parameters. You can also specify a `radius` in miles to define the search area.

**Where can I find the list of service codes to filter my search?**
You can run the `list_services` tool. It will return all available service categories and their corresponding codes which you can then use in the `service_code` parameter of `search_facilities`.

**Can I get the full contact information for a specific facility if I have its ID?**
Yes! Use the `get_facility` tool with the `facility_id`. This will retrieve detailed information including the address, phone number, and the full list of services provided by that location.