# Search Line Items

`Search_Line_Items` searches GovTribe state and local awarded line items using the standard GovTribe `Search_*` contract.

## Purpose

Use this tool when an agent needs awarded state/local line-item pricing evidence, unit-price comparisons, quantity-backed comparables, or parent award / IDV / vehicle context for pricing analysis.

## When To Use

Typical questions this tool answers well:

* Which awarded state/local line items match a product, service phrase, or subtype clue?
* Which line items fall inside a target unit-price or quantity range?
* Which parent awards, IDVs, vehicles, states, NIGP categories, or UNSPSC categories are associated with comparable awarded line items?
* What aggregate unit-price, quantity, unit-of-measure, category, or state patterns exist in the current result set?

## Output Contract

The tool returns the normal GovTribe paginated search envelope:

* `data`
* `current_page`
* `per_page`
* `total`
* `last_page`
* `from`
* `to`
* `aggregations` when requested

Each row in `data` is shaped by `fields_to_return`.

## Usage Notes

* This dataset is state/local only in v1. Do not expect federal line items here.
* Treat these rows as awarded line-item evidence, not normalized labor benchmarks.
* Use `line_item_ids` when you already have nested `line_items` from `Search_State_And_Local_Contract_Awards` or `Search_State_And_Local_Contract_IDVs`.
* Use parent filters when the source contract is known:
  * `state_local_contract_award_ids`
  * `state_local_contract_idv_ids`
  * `state_local_contract_vehicle_ids`
* `unit_price_stats` and `quantity_stats` are useful for quick comparable-range checks.
* `top_unit_of_measurements_by_doc_count` helps separate unlike rows that look textually similar but are priced on different units.
* There is no standalone GovTribe line-item page, so the line-item resource does not expose a direct `govtribe_url`. Use nested parent award / IDV / vehicle references for navigation.

## Examples

Find awarded network support line items in Virginia and return only pricing-relevant fields:

```json
{
  "query": "network support",
  "state_ids": ["<govtribe_state_id>"],
  "unit_price_range": {
    "min": 50,
    "max": 250
  },
  "sort": {
    "key": "unitPrice",
    "direction": "asc"
  },
  "fields_to_return": [
    "govtribe_id",
    "name",
    "description",
    "unit_price",
    "quantity",
    "unit_of_measure",
    "state_local_contract_award",
    "state_local_contract_idv"
  ]
}
```

Rehydrate line items referenced from a parent award response:

```json
{
  "line_item_ids": [
    "<line_item_id_1>",
    "<line_item_id_2>"
  ],
  "fields_to_return": [
    "govtribe_id",
    "description",
    "unit_price",
    "quantity",
    "unit_of_measure",
    "state_local_contract_award"
  ]
}
```

Run an aggregation-heavy comparable scan for a specific vehicle:

```json
{
  "state_local_contract_vehicle_ids": ["<state_local_contract_vehicle_id>"],
  "aggregations": [
    "unit_price_stats",
    "quantity_stats",
    "top_unit_of_measurements_by_doc_count",
    "top_nigp_codes_by_doc_count",
    "top_unspsc_codes_by_doc_count",
    "top_states_by_doc_count"
  ],
  "fields_to_return": [
    "govtribe_id",
    "unit_price",
    "quantity",
    "unit_of_measure"
  ]
}
```


---

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