# Search Vendors

`Search_Vendors` returns GovTribe vendor records with identifiers, registration timing, certification tags, and core relationship context used across award and opportunity research.

## When To Use

Typical questions this tool answers well:

* Which GovTribe vendor record matches a specific company name, UEI, or known vendor ID?
* Which vendors in a topic area match specific small-business designations or SBA certifications?
* Which vendors are registered in a location, primary NAICS, or PSC footprint?
* Which vendors have recent federal contract or grant award activity?
* What are the top NAICS, PSC, or locations represented by the current vendor result set?

## Required Reading

1. [Search\_Mode\_And\_Query\_Guide](/user-guide/mcp/guides/search_mode_and_query_guide.md): Required before setting free-text query strings and choosing keyword vs semantic retrieval.
2. [Date\_Filtering\_Guide](/user-guide/mcp/guides/date_filtering_guide.md): Required before setting date window filters.
3. [Location\_Filtering\_Guide](/user-guide/mcp/guides/location_filtering_guide.md): Required before setting location filters.

## Output Contract

* Top-level keys:
  * `current_page`: Current page number when `per_page > 0`.
  * `data`: Array of result rows when `per_page > 0`.
  * `from`: First row position in the current page.
  * `last_page`: Last page number for current filters.
  * `path`: GovTribe search URL for this result set.
  * `per_page`: Applied page size.
  * `to`: Last row position in the current page.
  * `total`: Total matched row count for current query filters.
  * `contains`: Dataset label for the returned result set.
  * `search_results_id_can_generate_saved_search`: Saved-search eligibility flag.
  * `search_results_id`: Server-side search result identifier.
  * `view_search_results_url`: URL to open this exact result set.
  * `aggregations`: Aggregation payload keyed by requested aggregation names when requested.
  * `per_page: 0` behavior: response omits `data` and pagination keys, returning metadata keys above plus `aggregations` when requested.
* Row keys:
  * `govtribe_id`
  * `govtribe_ai_summary`
  * `govtribe_type`
  * `govtribe_url`
  * `uei`
  * `name`
  * `division`
  * `dba`
  * `location`
  * `address`
  * `activation_date`
  * `registration_date`
  * `registration_deleted_date`
  * `registration_expiration_date`
  * `structure`
  * `sba_certifications`
  * `sba_cert_8a_entry_date`
  * `sba_cert_8a_expiration_date`
  * `sba_cert_8a_joint_venture_entry_date`
  * `sba_cert_8a_joint_venture_expiration_date`
  * `sba_cert_hubzone_entry_date`
  * `sba_cert_hubzone_expiration_date`
  * `sba_cert_small_disadvantaged_business_entry_date`
  * `sba_cert_small_disadvantaged_business_expiration_date`
  * `sba_cert_edwosb_entry_date`
  * `sba_cert_sdvosb_entry_date`
  * `sba_cert_sdvosb_expiration_date`
  * `sba_cert_vosb_entry_date`
  * `sba_cert_vosb_expiration_date`
  * `sba_cert_wosb_entry_date`
  * `business_types`
  * `cage_codes`
  * `parent_or_child`
  * `awarded_federal_contract_award`
  * `awarded_federal_contract_idv`
  * `awarded_federal_contract_vehicle`
  * `awarded_federal_grant_award`
  * `has_federal_contract_prime_awardees`
  * `has_federal_grant_prime_awardees`
  * `updated_at`
  * `parent`
  * `naics_category`
  * `federal_contract_awards`
  * `federal_contract_idvs`
  * `federal_contract_sub_awards`
  * `federal_grant_awards`
  * `federal_grant_sub_awards`
* Activation, registration, and SBA certification date row fields return ISO 8601 Zulu timestamp strings when present.
* `location` returns a nested location object with `govtribe_id`, `govtribe_type`, `name`, `lat`, and `lng` when the vendor location relation is loaded. `address` remains the flattened formatted-address string.
* Supported vendor certification expiration filters on this tool:
  * `vendor_sba_8a_expiration_date_range`
  * `vendor_sba_8a_joint_venture_expiration_date_range`
  * `vendor_sba_hubzone_expiration_date_range`
  * `vendor_sba_small_disadvantaged_business_expiration_date_range`
  * These request keys keep the `vendor_` prefix even on `Search_Vendors`, while the returned row fields omit that prefix.
* Relationship retrieval map:
  * `federal_contract_awards`
    * `resource_type`: `federal_contract_award`
    * `tool`: `Search_Federal_Contract_Awards`
    * `filter`: `federal_contract_award_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `govtribe_url`, `name`
  * `federal_contract_idvs`
    * `resource_type`: `federal_contract_idv`
    * `tool`: `Search_Federal_Contract_IDVs`
    * `filter`: `federal_contract_i_d_v_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `govtribe_url`, `name`
  * `federal_contract_sub_awards`
    * `resource_type`: `federal_contract_sub_award`
    * `tool`: `Search_Federal_Contract_Sub_Awards`
    * `filter`: `federal_contract_sub_award_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `govtribe_url`, `name`
  * `federal_grant_awards`
    * `resource_type`: `federal_grant_award`
    * `tool`: `Search_Federal_Grant_Awards`
    * `filter`: `federal_grant_award_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `govtribe_url`, `name`
  * `federal_grant_sub_awards`
    * `resource_type`: `federal_grant_sub_award`
    * `tool`: `Search_Federal_Grant_Sub_Awards`
    * `filter`: `federal_grant_sub_award_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `govtribe_url`, `name`
  * `naics_category`
    * `resource_type`: `naics_category`
    * `tool`: `Search_Naics_Categories`
    * `filter`: `naics_category_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `govtribe_url`, `name`
  * `location`
    * `resource_type`: `location`
    * `tool`: `n/a`
    * `filter`: `n/a`
    * `fallback`: No direct Search\_\* tool returns this resource class; use parent dataset filters and parent IDs.
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `name`, `lat`, `lng`
  * `parent`
    * `resource_type`: `vendor`
    * `tool`: `Search_Vendors`
    * `filter`: `vendor_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `name`, `uei`, `govtribe_url`

## Usage Patterns

Pattern A: Resolve a specific vendor by exact name/phrase before downstream award lookups. Tool: `Search_Vendors`

```json
{
  "query": "\"BLN LLC\"",
  "search_mode": "keyword",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 5,
  "sort": {
    "key": "registrationDate",
    "direction": "desc"
  }
}
```

Pattern B: Find small-business vendors in a topic area using certification filters. Tool: `Search_Vendors`

```json
{
  "query": "cybersecurity services for federal agencies",
  "search_mode": "semantic",
  "fields_to_return": [
    "govtribe_id"
  ],
  "business_types": [
    "Woman Owned Small Business",
    "Service Disabled Veteran Owned Business"
  ],
  "business_types_operator": "in",
  "most_recent_federal_contract_award_date_range": {
    "from": "now-3y/d",
    "to": null
  },
  "page": 1,
  "per_page": 25,
  "sba_certifications": [
    "SBA Certified HUBZone Firm"
  ],
  "sba_certifications_operator": "in",
  "sort": {
    "key": "most_recent_federal_contract_award_model_date",
    "direction": "desc"
  }
}
```

Pattern C: Aggregation-only market profile for NAICS/PSC/location distributions. Tool: `Search_Vendors`

```json
{
  "search_mode": "keyword",
  "aggregations": [
    "top_naics_codes_by_doc_count",
    "top_psc_codes_by_doc_count",
    "top_locations_by_doc_count"
  ],
  "most_recent_federal_contract_award_date_range": {
    "from": "now-2y/d",
    "to": null
  },
  "page": 1,
  "per_page": 0
}
```

Pattern D: Similar-vendor discovery from a known vendor record. Tool: `Search_Vendors`

```json
{
  "search_mode": "semantic",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 20,
  "similar_filter": {
    "govtribe_type": "vendor",
    "govtribe_id": "<VENDOR_ID>"
  }
}
```

Pattern E: Vendors with registrations expiring soon, ordered by expiration. Tool: `Search_Vendors`

```json
{
  "search_mode": "keyword",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 25,
  "registration_expiration_date_range": {
    "from": "now/d",
    "to": "now+90d/d"
  },
  "sort": {
    "key": "expirationDate",
    "direction": "asc"
  }
}
```

Pattern F: Vendors with 8(a) certifications expiring in the next 12 months. Tool: `Search_Vendors`

```json
{
  "search_mode": "keyword",
  "fields_to_return": [
    "govtribe_id",
    "name",
    "sba_cert_8a_expiration_date",
    "registration_expiration_date"
  ],
  "vendor_sba_8a_expiration_date_range": {
    "from": "now/d",
    "to": "now+12M/d"
  },
  "page": 1,
  "per_page": 25,
  "sort": {
    "key": "sbaCert8aExpirationDate",
    "direction": "asc"
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.govtribe.com/user-guide/mcp/tools/search-vendors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
