# Search Stages

`Search_Stages` returns GovTribe pipeline stage records, including the stage owner, creator, and parent pipeline context needed for capture-workflow analysis.

## When To Use

Typical questions this tool answers well:

* Which stage records match a known stage name, stage ID, or pipeline ID?
* Which stages are owned or created by a specific workspace user?
* Which stages belong to a specific pipeline before creating or reordering pursuits?
* How many stages match a filter set before requesting row payloads?
* Which stage types are present in a pipeline (for example user, triage, or terminal)?
* Which stage IDs should be passed into other capture workflows that depend on stage context?

## 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.
  * `per_page: 0` behavior: response omits pagination keys and `data`, returning metadata keys only.
* Row keys:
  * `govtribe_id`
  * `govtribe_type`
  * `govtribe_url`
  * `name`
  * `description`
  * `type`
  * `created_at`
  * `updated_at`
  * `owner`
  * `creator`
  * `pipeline`
* Relationship retrieval map:
  * `creator`
    * `resource_type`: `user`
    * `tool`: `Search_Users`
    * `filter`: `user_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `name`, `email`
  * `owner`
    * `resource_type`: `user`
    * `tool`: `Search_Users`
    * `filter`: `user_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `name`, `email`
  * `pipeline`
    * `resource_type`: `pipeline`
    * `tool`: `Search_Pipelines`
    * `filter`: `pipeline_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `govtribe_url`, `name`

## Usage Patterns

Pattern A: Resolve stages for a single pipeline before pursuit triage or stage reordering work. Tool: `Search_Stages`

```json
{
  "fields_to_return": [
    "govtribe_id"
  ],
  "pipeline_ids": [
    "<PIPELINE_ID>"
  ],
  "pipeline_ids_operator": "in",
  "page": 1,
  "per_page": 25
}
```

Pattern B: Find stages by exact stage-name phrases across all accessible pipelines. Tool: `Search_Stages`

```json
{
  "query": "\"Triage\" | \"Won\" | \"Lost\"",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 20
}
```

Pattern C: Return a metadata-only count before fetching rows for owner-filtered stage analysis. Tool: `Search_Stages`

```json
{
  "owner_ids": [
    "<OWNER_USER_ID>"
  ],
  "owner_ids_operator": "in",
  "page": 1,
  "per_page": 0
}
```

Then rerun with `per_page > 0` and the same filters when you need row payloads.

Pattern D: Exclude specific pipelines while exploring stage vocabulary. Tool: `Search_Stages`

```json
{
  "query": "proposal review stage and qualification stage",
  "fields_to_return": [
    "govtribe_id"
  ],
  "pipeline_ids": [
    "<PIPELINE_ID>"
  ],
  "pipeline_ids_operator": "not_in",
  "page": 1,
  "per_page": 10
}
```


---

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