# Search Psc Categories

`Search_Psc_Categories` returns GovTribe Product and Service Code (PSC) category records so downstream workflows can use canonical PSC identifiers.

## When To Use

* Which GovTribe PSC category matches a known PSC code or category phrase?
* Which canonical PSC identifiers should be passed into `psc_category_ids` filters in downstream federal tools?
* Which PSC categories should be included or excluded before running opportunity or award research?
* How many PSC categories match the current lookup criteria before retrieving rows?
* Which result-set ID and URL should be reused for saved-search style follow-on workflows?

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

## 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.
  * `per_page: 0` behavior: returns `path`, `total`, `contains`, `search_results_id_can_generate_saved_search`, `search_results_id`, and `view_search_results_url` without row keys.
* Row keys:
  * `govtribe_id`
  * `govtribe_type`
  * `govtribe_url`
  * `name`
  * `code`
  * `updated_at`
  * `federal_contract_awards`
  * `federal_contract_opportunities`
* 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_opportunities`
    * `resource_type`: `federal_contract_opportunity`
    * `tool`: `Search_Federal_Contract_Opportunities`
    * `filter`: `federal_contract_opportunity_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `govtribe_url`, `name`

## Usage Patterns

Pattern A: Resolve one known PSC code to its canonical GovTribe category row. Tool: `Search_Psc_Categories`

```json
{
  "search_mode": "keyword",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 1,
  "psc_category_ids": [
    "R408"
  ],
  "psc_category_ids_operator": "in"
}
```

Pattern B: Find PSC categories by category phrase using keyword matching. Tool: `Search_Psc_Categories`

```json
{
  "query": "\"program management\"",
  "search_mode": "keyword",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 10
}
```

Pattern C: Exclude known PSC categories while reviewing the remaining category universe. Tool: `Search_Psc_Categories`

```json
{
  "search_mode": "keyword",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 25,
  "psc_category_ids": [
    "R408",
    "D302",
    "5410"
  ],
  "psc_category_ids_operator": "not_in"
}
```

Pattern D: Return metadata only when a workflow needs counts, result IDs, and the results URL. Tool: `Search_Psc_Categories`

```json
{
  "search_mode": "keyword",
  "page": 1,
  "per_page": 0
}
```

Pattern E: Resolve candidate PSCs for downstream opportunity filtering. Tool: `Search_Psc_Categories`

```json
{
  "query": "cybersecurity support services",
  "search_mode": "semantic",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 20
}
```


---

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