# Search Federal Transactions

`Search_Federal_Transactions` returns federal contract transaction rows sourced from FPDS transaction-level activity, including obligation amounts, modification context, agencies, and awardee linkage.

## When To Use

Typical questions this tool answers well:

* Which transaction lines are associated with a known award, IDV, or vehicle?
* Which transaction lines are associated with a known major defense program?
* What are the latest modifications for a contract lineage, sorted by transaction date?
* How much was obligated in a filtered slice, and who are the top awardees/agencies/categories by obligated dollars?
* Which transactions match a set-aside, NAICS, PSC, vendor, or agency constraint?
* How do funding agencies differ from contracting agencies for a given transaction cohort?

## 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.

## 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.
* Row keys:
  * `govtribe_id`
  * `govtribe_type`
  * `date`
  * `last_mod_number`
  * `reason_for_modification`
  * `total_value`
  * `federal_value`
  * `non_federal_value`
  * `updated_at`
  * `awardee`
  * `funding_federal_agency`
  * `contracting_federal_agency`
* Relationship retrieval map:
  * `awardee`
    * `resource_type`: `vendor`
    * `tool`: `Search_Vendors`
    * `filter`: `vendor_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `name`, `uei`, `govtribe_url`
  * `contracting_federal_agency`
    * `resource_type`: `federal_agency`
    * `tool`: `Search_Federal_Agencies`
    * `filter`: `federal_agency_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `govtribe_url`, `name`
  * `funding_federal_agency`
    * `resource_type`: `federal_agency`
    * `tool`: `Search_Federal_Agencies`
    * `filter`: `federal_agency_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `govtribe_url`, `name`

## Usage Patterns

Pattern A: Aggregation-only obligated-dollar profile for a funding agency. Tool: `Search_Federal_Transactions`

```json
{
  "aggregations": [
    "dollars_obligated_stats",
    "top_awardees_by_dollars_obligated",
    "top_contracting_federal_agencies_by_dollars_obligated"
  ],
  "funding_federal_agency_ids": [
    "<FEDERAL_AGENCY_ID>"
  ],
  "funding_federal_agency_ids_operator": "in",
  "per_page": 0
}
```

Pattern B: Latest transaction lines for a known award ID. Tool: `Search_Federal_Transactions`

```json
{
  "fields_to_return": [
    "govtribe_id"
  ],
  "federal_contract_award_ids": [
    "<AWARD_GOVTRIBE_ID>"
  ],
  "federal_contract_award_ids_operator": "in",
  "sort": {
    "key": "transactionDate",
    "direction": "desc"
  },
  "page": 1,
  "per_page": 25
}
```

Pattern C: Set-aside plus category slice with top vendors and vehicles. Tool: `Search_Federal_Transactions`

```json
{
  "fields_to_return": [
    "govtribe_id"
  ],
  "aggregations": [
    "top_awardees_by_dollars_obligated",
    "top_federal_contract_vehicles_by_dollars_obligated",
    "top_naics_codes_by_dollars_obligated",
    "top_psc_codes_by_dollars_obligated"
  ],
  "naics_category_ids": [
    "<NAICS_ID_OR_CODE>"
  ],
  "naics_category_ids_operator": "in",
  "psc_category_ids": [
    "<PSC_ID_OR_CODE>"
  ],
  "psc_category_ids_operator": "in",
  "set_aside_types": [
    "Total Small Business"
  ],
  "set_aside_types_operator": "in",
  "per_page": 0
}
```

Pattern D: Major defense program transaction rollup with top IDVs and vehicles. Tool: `Search_Federal_Transactions`

```json
{
  "major_defense_program_ids": [
    "<MAJOR_DEFENSE_PROGRAM_ID>"
  ],
  "major_defense_program_ids_operator": "in",
  "aggregations": [
    "dollars_obligated_stats",
    "top_idvs_by_dollars_obligated",
    "top_federal_contract_vehicles_by_dollars_obligated",
    "top_awardees_by_dollars_obligated"
  ],
  "per_page": 0
}
```

Pattern E: Exclusion workflow to remove known noisy entities while reviewing rows. Tool: `Search_Federal_Transactions`

```json
{
  "fields_to_return": [
    "govtribe_id"
  ],
  "contracting_federal_agency_ids": [
    "<EXCLUDED_CONTRACTING_AGENCY_ID>"
  ],
  "contracting_federal_agency_ids_operator": "not_in",
  "sort": {
    "key": "transactionDate",
    "direction": "desc"
  },
  "vendor_ids": [
    "<EXCLUDED_VENDOR_ID_OR_UEI>"
  ],
  "vendor_ids_operator": "not_in",
  "page": 1,
  "per_page": 50
}
```


---

# 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-federal-transactions.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.
