# Search Pipelines

`Search_Pipelines` returns GovTribe pipeline records with owner, creator, and stage context so callers can navigate and manage capture workflows.

## When To Use

Typical questions this tool answers well:

* Which pipeline matches a specific pipeline name?
* Which pipelines are owned by or created by a specific user?
* Which stage IDs exist inside a pipeline so I can create a pursuit in the right stage?
* Which pipelines should be included or excluded by explicit GovTribe IDs?
* How many pipelines match filters before fetching full rows?

## 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 row/pagination keys and returns `path`, `total`, `contains`, `search_results_id_can_generate_saved_search`, `search_results_id`, and `view_search_results_url`.
* Row keys:
  * `govtribe_id`
  * `govtribe_type`
  * `govtribe_url`
  * `name`
  * `description`
  * `created_at`
  * `updated_at`
  * `owner`
  * `creator`
  * `stages`
* 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`
  * `stages`
    * `resource_type`: `stage`
    * `tool`: `Search_Stages`
    * `filter`: `stage_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `govtribe_url`, `name`, `type`

## Usage Patterns

Pattern A: Resolve a pipeline by exact pipeline name. Tool: `Search_Pipelines`

```json
{
  "query": "\"Demo Pipeline\"",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 10
}
```

Pattern B: Find pipelines owned by a specific user (after resolving user ID with `Search_Users`). Tool: `Search_Pipelines`

```json
{
  "fields_to_return": [
    "govtribe_id"
  ],
  "owner_ids": [
    "<USER_ID>"
  ],
  "owner_ids_operator": "in",
  "page": 1,
  "per_page": 25
}
```

Pattern C: Exclude known pipelines while searching by descriptive text. Tool: `Search_Pipelines`

```json
{
  "query": "capture workflow for grants and state procurement",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 20,
  "pipeline_ids": [
    "<PIPELINE_ID_1>",
    "<PIPELINE_ID_2>"
  ],
  "pipeline_ids_operator": "not_in"
}
```

Pattern D: Get match count and reusable result links without fetching rows. Tool: `Search_Pipelines`

```json
{
  "per_page": 0
}
```

Pattern E: Find a destination pipeline and extract a triage-stage ID for pursuit creation. Tool: `Search_Pipelines`

```json
{
  "query": "\"AI Test\"",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 10
}
```

Then select `data[0].stages` entry where `type` is `triage` (or the desired non-terminal `user` stage) and pass that stage ID into `Create_Pursuit`.


---

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