# Search Tasks

`Search_Tasks` returns GovTribe task records used in capture execution, including task ownership, creator context, linked pipeline, and linked pursuit.

## When To Use

Typical questions this tool answers well:

* Which tasks belong to a specific pipeline, pursuit, or owner right now?
* Which tasks were created by a specific user, or assigned to a specific user?
* Which exact task records match a known set of GovTribe task IDs?
* How many tasks match my current filter set before requesting row payloads?
* Which tasks mention a topic in name, description, or comments?

## 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: omits row/pagination keys and returns metadata keys (`path`, `total`, `contains`, `search_results_id_can_generate_saved_search`, `search_results_id`, `view_search_results_url`).
* Row keys:
  * `govtribe_id`
  * `govtribe_ai_summary`
  * `govtribe_type`
  * `govtribe_url`
  * `name`
  * `description`
  * `comment`
  * `due_date`
  * `past_due`
  * `due_soon`
  * `priority`
  * `completed_at`
  * `reopened_at`
  * `created_at`
  * `updated_at`
  * `owner`
  * `creator`
  * `pipeline`
  * `pursuit`
  * `stage`
* 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`
  * `pursuit`
    * `resource_type`: `pursuit`
    * `tool`: `Search_Pursuits`
    * `filter`: `pursuit_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `govtribe_url`, `name`
  * `stage`
    * `resource_type`: `stage`
    * `tool`: `Search_Stages`
    * `filter`: `stage_ids`
    * `nested_keys`: `govtribe_id`, `govtribe_type`, `govtribe_url`, `name`, `type`

## Usage Patterns

Pattern A: Pipeline work queue for one owner (resolve IDs first with `Search_Users` and `Search_Pipelines`). Tool: `Search_Tasks`

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

Pattern B: Retrieve tasks for a specific pursuit during capture reviews. Tool: `Search_Tasks`

```json
{
  "fields_to_return": [
    "govtribe_id"
  ],
  "pursuit_ids": [
    "<PURSUIT_ID>"
  ],
  "page": 1,
  "per_page": 20
}
```

Pattern C: Count matching tasks before fetching rows. Tool: `Search_Tasks`

```json
{
  "query": "\"compliance matrix\" | \"pink team\"",
  "per_page": 0
}
```

Then rerun with `per_page > 0` and the same filters when row payloads are needed.

Pattern D: Exclude completed historical IDs from a focused task list. Tool: `Search_Tasks`

```json
{
  "fields_to_return": [
    "govtribe_id"
  ],
  "owner_ids": [
    "<USER_ID>"
  ],
  "page": 1,
  "per_page": 15,
  "task_ids": [
    "<TASK_ID_1>",
    "<TASK_ID_2>"
  ],
  "task_ids_operator": "not_in"
}
```

Pattern E: Text search for related execution work across pursuits. Tool: `Search_Tasks`

```json
{
  "query": "draft proposal artifacts and compliance deliverables due soon",
  "fields_to_return": [
    "govtribe_id"
  ],
  "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-tasks.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.
