# Search Major Defense Programs

`Search_Major_Defense_Programs` is the GovTribe dataset search for DoD acquisition programs, including program identity, code/acronym metadata, AI summary text, and acquisition classification fields.

## When To Use

Typical questions this tool answers well:

* Which major defense programs match a specific name, code, acronym, or GovTribe ID?
* Which programs are associated with a specific federal agency?
* What program types/pathways/acquisition categories appear for a topic?
* Which federal agencies appear most often across major defense program records?
* What programs are semantically similar to a known program?

## Required Reading

1. [Search\_Query\_Guide](https://docs.govtribe.com/user-guide/mcp/guides/search_query_guide): Required before setting free-text query strings when search\_mode is used.
2. [Search\_Mode\_Guide](https://docs.govtribe.com/user-guide/mcp/guides/search_mode_guide): Required before choosing keyword vs semantic retrieval.

## Input Contract

* `query`: Free-text query string. See Required Reading: [Search\_Query\_Guide](https://docs.govtribe.com/user-guide/mcp/guides/search_query_guide).
  * `type`: `string`
  * `required`: `no`
  * `default`: `n/a`
* `page`: 1-based page index.
  * `type`: `null|number`
  * `required`: `no`
  * `default`: `1`
* `per_page`: Rows per page.
  * `type`: `null|number`
  * `required`: `no`
  * `default`: `10`
* `search_mode`: Query interpretation mode. See Required Reading: [Search\_Mode\_Guide](https://docs.govtribe.com/user-guide/mcp/guides/search_mode_guide).
  * `type`: `string`
  * `required`: `no`
  * `default`: `keyword`
  * `options`: `keyword`, `semantic`
* `federal_agency_ids`: Filter by federal agencies. Use GovTribe IDs.
  * `type`: `array<string>`
  * `required`: `no`
  * `default`: `n/a`
* `federal_agency_ids_operator`: Choose whether to include or exclude values for Federal Agency GovTribe IDs.
  * `type`: `null|string`
  * `required`: `no`
  * `default`: `in`
  * `options`: `in`, `not_in`
* `similar_filter`: Find similar to the provided govtribe\_type + govtribe\_id.
  * `type`: `null|object`
  * `required`: `no`
  * `default`: `n/a`
  * `shape`: `{ govtribe_type: string, govtribe_id: string }`
* `major_defense_program_ids`: Include or exclude results by GovTribe IDs.
  * `type`: `array<string>`
  * `required`: `no`
  * `default`: `n/a`
* `major_defense_program_ids_operator`: Choose whether to include or exclude values for GovTribe IDs.
  * `type`: `null|string`
  * `required`: `no`
  * `default`: `in`
  * `options`: `in`, `not_in`
* `aggregations`: Aggregation keys to compute.
  * `type`: `array<string>`
  * `required`: `no`
  * `default`: `n/a`
  * `options`: `top_federal_agencies_by_doc_count`
* `fields_to_return`: Optional field list for row payloads. If omitted and `per_page > 0`, rows default to `govtribe_id`. For `per_page: 0` aggregation/meta calls, this field may be omitted. Specify `fields_to_return` whenever the user asks for fields beyond `govtribe_id`, and prefer omitting it in pure aggregation workflows.
  * `type`: `array<string>`
  * `required`: `no`
  * `default`: `n/a`
  * `options`: `govtribe_id`, `govtribe_ai_summary`, `govtribe_type`, `govtribe_url`, `name`, `code`, `acronyms`, `description`, `defense_program_type`, `aaf_pathway`, `acquisition_category`, `updated_at`, `federal_agency`, `federal_contract_awards`

## Output Contract

* Top-level keys:
  * `data`: Array of result rows when `per_page > 0`.
  * `current_page`, `from`, `to`, `last_page`, `per_page`, `total`: Pagination envelope (`per_page > 0`).
  * `path`: GovTribe search URL for this result set.
  * `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.
* Row keys:
  * `govtribe_id`
  * `govtribe_ai_summary`
  * `govtribe_type`
  * `govtribe_url`
  * `name`
  * `code`
  * `acronyms`
  * `description`
  * `defense_program_type`
  * `aaf_pathway`
  * `acquisition_category`
  * `updated_at`
  * `federal_agency`
  * `federal_contract_awards`
* Relationship retrieval map:
  * `federal_agency`
    * `resource_type`: `federal_agency`
    * `tool`: `Search_Federal_Agencies`
    * `filter`: `federal_agency_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `govtribe_url`, `name`
  * `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`

## Usage Patterns

Pattern A: Lookup by GovTribe program ID Tool: `Search_Major_Defense_Programs`

```json
{
  "query": "",
  "search_mode": "keyword",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 10,
  "major_defense_program_ids": [
    "<MAJOR_DEFENSE_PROGRAM_ID>"
  ],
  "major_defense_program_ids_operator": "in"
}
```

Pattern B: Programs for a target federal agency Tool: `Search_Major_Defense_Programs`

```json
{
  "query": "",
  "search_mode": "keyword",
  "fields_to_return": [
    "govtribe_id"
  ],
  "federal_agency_ids": [
    "9700-A"
  ],
  "federal_agency_ids_operator": "in",
  "page": 1,
  "per_page": 10
}
```

Pattern C: Top agencies by program count (aggregation-only) Tool: `Search_Major_Defense_Programs`

```json
{
  "query": "",
  "search_mode": "keyword",
  "aggregations": [
    "top_federal_agencies_by_doc_count"
  ],
  "per_page": 0
}
```

Pattern D: Semantic exploration by mission/capability topic Tool: `Search_Major_Defense_Programs`

```json
{
  "query": "maritime patrol aircraft and anti-submarine warfare programs",
  "search_mode": "semantic",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 10
}
```

Pattern E: Similar programs from a known source program Tool: `Search_Major_Defense_Programs`

```json
{
  "query": "",
  "search_mode": "semantic",
  "fields_to_return": [
    "govtribe_id"
  ],
  "similar_filter": {
    "govtribe_type": "dod_acquisition_program",
    "govtribe_id": "334-MDP"
  },
  "page": 1,
  "per_page": 10
}
```
