# Search Users

`Search_Users` returns GovTribe workspace user records by matching name or email text and provides canonical user IDs for downstream tool calls.

## When To Use

Typical questions this tool answers well:

* Which workspace user matches this exact name?
* Which workspace user owns this email address?
* What user IDs should I pass to `owner_ids`, `creator_ids`, or task owner fields in other tools?
* Which known user IDs should I include or exclude before running downstream updates?
* How many users match a lookup without 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`
  * `name`
  * `email`
  * `phone`
  * `updated_at`
  * `created_at`
* Relationship retrieval map:
  * `none`: This resource has no relationship fields.

## Usage Patterns

Pattern A: Resolve a user by exact display name. Tool: `Search_Users`

```json
{
  "query": "\"<USER_DISPLAY_NAME>\"",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 10
}
```

Pattern B: Resolve a user by exact email address. Tool: `Search_Users`

```json
{
  "query": "\"<USER_EMAIL_ADDRESS>\"",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 10
}
```

Pattern C: Exclude known users while running a broad lookup. Tool: `Search_Users`

```json
{
  "query": "account admin",
  "fields_to_return": [
    "govtribe_id"
  ],
  "page": 1,
  "per_page": 10,
  "user_ids": [
    "<USER_ID_1>",
    "<USER_ID_2>"
  ],
  "user_ids_operator": "not_in"
}
```

Pattern D: Count matches and capture reusable search-result metadata without row retrieval. Tool: `Search_Users`

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

Pattern E: Resolve owner IDs for downstream pipeline/task filtering. Tool: `Search_Users`

```json
{
  "query": "\"<OWNER_NAME_1>\" | \"<OWNER_NAME_2>\"",
  "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-users.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.
